Q&A
POSThttps://api.aleph-alpha.com/qa
This endpoint has been deprecated and may be replaced or removed in future versions of the API.
Will answer a question about text given in a prompt. This interface is deprecated and will be removed in a later version. New methodologies for processing Q&A tasks will be provided before this is removed.
Request
Query Parameters
Setting this to True, will signal to the API that you intend to be nice to other users by de-prioritizing your request below concurrent ones.
- application/json
Body
required
Possible values: [aleph-alpha
, null
]
Optional parameter that specifies which datacenters may process the request.
You can either set the parameter to "aleph-alpha" or omit it (defaulting to null
).
Not setting this value, or setting it to null
, gives us maximal flexibility in processing your request in our
own datacenters and on servers hosted with other providers. Choose this option for maximum availability.
Setting it to "aleph-alpha" allows us to only process the request in our own datacenters. Choose this option for maximal data privacy.
The question to be answered about the prompt by the model. The prompt may not contain a valid answer.
documents object[]required
Possible values: >= 1
and <= 200
Default value: 30
The maximum number of answers to return for this query. A smaller number of max answers can possibly return answers sooner, since less answers have to be generated.
Responses
- 200
OK
- application/json
- Schema
- Example (from schema)
Schema
model name and version (if any) of the used model for inference
answers object[]
{
"answers": [
{
"answer": "Andreas",
"score": 0.9980973,
"evidence": "Andreas likes Pizza."
}
],
"model_version": "2021-12"
}
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L -X POST 'https://api.aleph-alpha.com/qa' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"query": "Who likes Pizza?",
"documents": [
{
"text": "Andreas likes Pizza."
},
{
"docx": "b64;base64EncodededWordDocument"
}
]
}'