Create a query
Given a query and an optional conversation id, get a response from your library
Parameters
The ID of the library you are going to ask a question
Body
The question you will make to the library.
Optional. Use this for a continuation of the conversation. You will receive a conversation id on the first query you send.
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
The response from the library for the query provided in the request body
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.
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.
Specifies the type of the chunk that is being sent
Possible values are: initializing, token, response, done
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.
It only appears when type == response
.
A json object containing the final response and metadata for the gptQuery.