POST /v1/stream-query
Changed onStream responses as you search for relevant results, highlight relevant snippets, and do Retrieval Augmented Generation (RAG).
Instead of receiving a complete response like with the Standard Query API, you receive partial responses in this order:
- Search results.
- If summarization is enabled, you get chunks of the summary, like "This", "is", "a", "summary".
- If FCS is enabled, then the FCS is the final response.
Some tips for this API:
- This operation authenticates with either an API Key or OAuth 2.0 (in a JWT "Bearer Token"). You can find details of how to set up an API key or use OAuth 2.0 here.
- The Query API takes an array of queries, since you can have Vectara perform more than 1 query in a single API call. The results that are returned are thus in an array as well, with each element in the response array corresponding to the input query array.
- Custom dimensions (the dim array) is a feature that is only available to Scale accounts.
- Reranking enhances search accuracy and variety and more details can be found here.
Request
- Base URLhttps://api.vectara.io
- Auth
- API key in header x-api-key
- or OAuth 2Client credentialsToken URLhttps://vectara-prod-YOUR_VECTARA_CUSTOMER_ID.auth.us-west-2.amazoncognito.com/oauth2/token
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Headers
Enter the Customer ID to use for the request.
(Optional) Enter the timeout value of the request in seconds, such as 10S or 30S.
Request body
Example request
{
"query": [
{
"query": "What is the answer to the life, the universe, and everything?",
"start": 0,
"numResults": 10,
"contextConfig": {
"sentencesBefore": 3,
"sentencesAfter": 3,
"startTag": "<b>",
"endTag": "</b>"
},
"corpusKey": [
{
"customerId": 12345,
"corpusId": 12
}
],
"summary": [
{
"maxSummarizedResults": 10,
"responseLang": "en"
}
]
}
]
}Response
A successful response.(streaming responses)
Changes
- breaking
the request property
became required - breaking
the response property
///////became optional for the status - breaking
the response property
/////became optional for the status - warning
removed the request property
//// - warning
removed the request property
//// - warning
removed the optional property
///////from the response with the status - warning
removed the optional property
/////from the response with the status - info
added the new optional request property
///// - info
added the new optional request property
//// - info
the request property
////became optional - info
the
///request property format was generalized fromint32to no format - info
the
///request property format was generalized fromint32to no format - info
the
///request property format was generalized fromint32to no format - info
the
///request property format was generalized fromint32to no format - info
the
////request property format was generalized fromint64to no format - info
the
////request property format was generalized fromint64to no format - info
the
/////request property format was generalized fromfloatto no format - info
the
////request property format was generalized fromint64to no format - info
the
/////request property format was generalized fromfloatto no format - info
the
/////request property format was generalized fromint64to no format - info
the
/////request property format was generalized fromfloatto no format - info
the
/////request property format was generalized fromfloatto no format - info
the
////request property format was generalized fromint64to no format
- breaking