The response object
A response is Jockey’s reply to a request, generated by reasoning over the content in a knowledge store.
The object is composed of the following fields:
id: A string representing the unique identifier of the response.knowledge_store_id: A string representing the unique identifier of the knowledge store the response was generated against.session_id: A string representing the session identifier for the conversation. Pass it in subsequent requests to continue the multi-turn conversation.type: A string representing the object type. The value is alwaysresponse.object: A string with the same value astype. Only the response itself has anobjectfield; output items, annotations, and stream events are identified bytypealone and have noobjectfield.status: A string representing the status of the response. See the Response statuses section for the meaning of each value.output: An array of output items. By default, only the final message is included. To also receive function call items, setincludeto["intermediate_outputs"]in the request. Each message item has aphasefield whose value iscommentaryfor intermediate output orfinal_answerfor the answer; a message withoutphaseis the final answer. Thetextfield of each content part may contain citation markers, each a number in square brackets such as[1]. Theannotationsarray of the part contains the citations. Each citation identifies a span of thetextfield and the source it cites. Media citations use the markers, and a web citation (url_citation) can cover text that is not a marker. Theannotationsarray is always present and may be empty. For the full list of fields on each citation, see Create a response.incomplete_details: The reason the response was truncated before the answer was complete. Always present; contains a value only whenstatusisincomplete, andnullon every other status. See the Incomplete responses section.billing: The billing information for this response. Itsamountfield is the cost of the response in US dollars, as a decimal string with six decimal places, and itscurrencyfield isUSD. The amount is the list price, before any discount on your account. An incomplete response counts the work done before it stopped, andamountisnullwhen the cost could not be determined at the time the response finished; your invoice shows the charge. A request that fails is not charged. Only a finished response carriesbilling: the last event of a stream (response.completedorresponse.failed) and the non-streamed response. Earlier stream events do not. This amount is informational: it is the list price, before your plan and any discount on your account. Your invoice is the authoritative record of charges.created_at: A string representing the date and time, in the RFC 3339 format, when the response was created.
Response statuses
The status field of a response has one of the following values:
in_progress: The response is being generated.completed: The response has been generated successfully.incomplete: The response ended before the answer was complete. Readincomplete_details.reasonto find out why.failed: The response generation has failed.
Incomplete responses
The incomplete_details field is always present and is null on every status except incomplete,
so null means the answer was not truncated, not that the platform does not report the
reason. When it contains a value, its reason says what stopped the answer:
max_output_tokens: the answer reached the output token limit. The text inoutputis an incomplete answer, not the full one.
Treat a value you do not recognize as an incomplete answer for an unknown reason, not as an error.
Citations
Each citation identifies a span of the answer text and the source that supports it. Media citations point to knowledge store items and collections, and web citations point to public web sources.
The platform can add new citation types. If you encounter a citation type you do not recognize, keep the response text and display the citations you do recognize.
Citation offsets count Unicode code points, and both bounds are inclusive. Use the offsets of an annotation to locate the text it covers. When multiple annotations cover the same text, keep the source of each one.