Create Agent Completion
Given a prompt, this method lets you retrieve one or more predicted completions along with the probabilities of alternative tokens at each position. The prompt is updated to reflect the agent settings and to use any inputs from enabled integrations, before it is forwarded to the LLM.
To leverage the newest models and features, you should consider using use the Chat Completions API instead.
This method is compatible with the OpenAI endpoint for creating a completion. However, it infers additional inputs to the prompt as described above.
agent_id
Show optional properties
{
"prompt": "hello"
}
{
"create_session": false,
"seed": 0,
"temperature": "number",
"n": 0,
"stop": [
"string"
],
"max_tokens": 0,
"stream": false,
"model": "string",
"prompt": "string",
"store_in_session": "string"
}
If true, the request creates a new agent session and the LLM interaction is stored as context for subsequent agent interactions when using the generated session.
Seed to propagate to the LLM for making repeated requests with the same seed as deterministic as possible. Note that this feature is in beta for most inference servers.
temperature
n
stop
max_tokens
stream
Optional ID of the model to use. If provided, it must match the model specified in the agent configuration. Unless the client needs to validate that the specified model is in use by the agent, do not specify this value and the API will choose the correct model. For compatibility with the OpenAI client SDK, this parameter may either be unset or an empty string may be used to indicate the use of the agent default configuration.
prompt
If set, use and extend the context stored in the given session for all LLM interactions.
Successful Response
Unexpected model in completions message
No agent found with the specified ID or invalid Session ID
Validation Error
"HTTPValidationError Object"
detail
curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"prompt:"string"}' https://{api_host}/api/v1/compatibility/openai/v1/agents/{agent_id}/completions