Skip to main content
POST
Create a query

Parameters

string
required
The ID of the library you are going to ask a question

Body

string
required
The question you will make to the library.
string | null
Optional. Use this for a continuation of the conversation. You will receive a conversation id on the first query you send.
boolean | null
Optional. Whether or not you want to receive a streamed response. Default value is False.

Response

The response will vary according to the value of the streaming attribute.

Non-streamed response

When streaming is equal to false the response will be a JSON object containing the following fields
string
required
The response from the library for the query provided in the request body
string
required
Optional. Use this in follow-up requests for a continuation of the conversation. You will receive a conversation id on the first query you send.
json
required
A map containing data used to generate the query response. It provides additional sources of information to the reply.

Streamed response

When streaming is equal to true the response is sent as a series of chunk where each of them will be a JSON object.
string
required
Specifies the type of the chunk that is being sentPossible values are: initializing, token, response, done
string | null
It only appears when type == token.It represents the token that is currently being sent as part of a partial response. If you concatenate all tokens you will have the complete response.
json | null
It only appears when type == response.A json object containing the final response and metadata for the gptQuery.