Response Structure

Standard Response (search / asearch)

llm_response
string
The main response from the language model based on search results.
response_time
float
Time taken to process the request in seconds.
input_tokens
integer
Number of input tokens used.
output_tokens
integer
Number of output tokens generated.
llmlayer_cost
integer
LLMLayer infrastructure cost for the request.
model_cost
integer
Model cost for the request, based on the model used.
sources
array
List of source documents used (when return_sources=true).
images
array
List of relevant images (when return_images=true).

Streaming Response (search_stream / asearch_stream)

The streaming response sends Server-Sent Events with different types:
type='llm'
event
type='sources'
event
type='images'
event
type='done'
event
type='usage'
event

Best Practices