Create Completion
Create a completion for an agent
agents.create_completion(struuid, AgentCreateCompletionParams**kwargs) -> idstrcontentlisttypeliteralintermediatary_resultsobjectrelated_searcheslistsourceslistAgentCreateCompletionResponse
post/v1/agents/{UUID}/completions
Create a completion for an agent
Parameters
Returns
AgentCreateCompletionResponseclass
from you_api import YouAPI
client = YouAPI(
bearer_token="My Bearer Token",
)
response = client.agents.create_completion(
uuid="UUID",
enable_conversation_history=True,
messages=[{
"content": "string",
"role": "user",
}],
stream=True,
)
print(response.id)
200 Example
{
"id": "id",
"content": [
{
"citations": [
{
"id": 0,
"type": "file",
"attributes": {
"foo": "bar"
},
"uri": "uri"
}
],
"text": "text",
"type": "thinking"
}
],
"type": "response",
"intermediatary_results": {},
"related_searches": [
{
"text": "text"
}
],
"sources": [
{
"snippet": "snippet",
"title": "title",
"type": "web",
"url": "url"
}
]
}