Custom
Input
All this information are useful for tracking the usage of the API.
The maximum number of tokens to generate. Mind that in case the model generates more tokens than this value, the response will be truncated.
The array of messages to use as context for the model.
The model to use for generating the text.
The provider to use for generating the text. It can be either anthropic
or openai
or a custom provider.
The temperature value to use for generating the text.
The top_p value to use for generating the text.
The array of tools to be eventually used by the model.
The choice of the tool to be used by the model.
Behavior: If the type
is auto
, the model will choose the tool automatically.
Behavior: If the type
is tool
, the model will use the tool with the given name
.
Behavior: If the type
is required
, the model will be forced to use one of the available tools
Behavior: If the type
is none
, the model will not use any tool.
The array of strings that will cause the model to stop generating tokens.
If true
, the model will generate the text in a streaming fashion.
Output
The unique identifier of the response.
The model used to generate the response.
Usually the model is the same as the one used in the request. But in some cases, the model name can be slightly different.
The response message generated by the model.
The reason why the model stopped generating tokens.
max_tokens
: The model reached the maximum token limit.stop_sequence
: The model incountered one of the provided stop_sequence tokens.stop
: The normal stop condition, the model reached the end of the response.
The stop_sequence token that caused the model to stop generating tokens. In
case the stop_reason is not stop_sequence
, this field will be
undefined.
The usage object contains the number of tokens used in the input and output.
The logprobs object contains the log probabilities of the tokens generated by the model.
Request Time
The start time of the request in milliseconds.
The end time of the request in milliseconds.
To get the request time, you can use the following code snippet:
Error
The error object in case the request fails.