Search…
⌃K

Answer

Answer questions based on your documents

Answer question

Forefront Answer is a question answering API that accurately answers questions based on your documents. See pricing
post
https://solutions.forefront.ai
/v1/organization/{TEAM_ID}/answer
Answer question

Example request

Python
Javascript
cURL
import requests
import json
headers = {
"Authorization": "Bearer {API_KEY}",
"Content-Type": "application/json"
}
body = {
"question": "<QUESTION>",
"documents": ["Document 1", "Document 2", "Document 3"]
}
res = requests.post(
"https://solutions.forefront.ai/v1/organization/{TEAM_ID}/answer",
json=body,
headers=headers
)
data = res.json()
answer = data['answer']
const fetch = require('node-fetch');
const url = 'https://solutions.forefront.ai/v1/organization/{TEAM_ID}/answer';
const headers = {
"Authorization": "Bearer {API_KEY}",
"Content-Type": "application/json"
};
const body = {
"text": "<QUESTION>",
"documents": ["Document 1", "Document 2", "Document 3"]
}
fetch(url, {
method: 'POST',
headers,
body: JSON.stringify(body)
}).then(async (res) => {
const data = await res.json()
console.log(data)
})
curl https://solutions.forefront.ai/v1/organization/{TEAM_ID}/answer \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {API_KEY}' \
-d '{
"text": "<QUESTION>",
"entities": ["Document 1", "Document 2", "Document 3"]
}'
Last modified 3mo ago