# Agents ## Create Completion `agents.create_completion(struuid, AgentCreateCompletionParams**kwargs) -> AgentCreateCompletionResponse` **post** `/v1/agents/{UUID}/completions` Create a completion for an agent ### Parameters - **uuid:** `str` - **enable\_conversation\_history:** `bool` Enable conversation history - **messages:** `Iterable[Message]` - **content:** `Union[str, Iterable[MessageContentUnionMember1]]` - **MessageContentUnionMember0:** `str` - **MessageContentUnionMember1:** `Iterable[MessageContentUnionMember1]` - `class MessageContentUnionMember1MessageText` - **text:** `str` - **type:** `Literal["text"]` - `"text"` - `class MessageContentUnionMember1MessageImage` - **file:** `str` - **type:** `Literal["image"]` - `"image"` - **role:** `Literal["user", "agent"]` - `"user"` - `"agent"` - **stream:** `bool` Whether to stream the response using SSE - **enable\_agent\_clarification\_questions:** `bool` - **enable\_editable\_workflow:** `bool` - **sources:** `Iterable[Source]` - `class SourceSourceURL` - **type:** `Literal["url"]` - `"url"` - **url:** `str` - `class SourceSourceFile` - **file\_uri:** `str` - **type:** `Literal["file"]` - `"file"` - **thread\_id:** `Optional[str]` Optional thread identifier - **tools:** `Iterable[Tool]` - **search\_additional\_sources:** `bool` - **search\_depth:** `Literal["dynamic", "quick", "deep"]` - `"dynamic"` - `"quick"` - `"deep"` - **type:** `Literal["web_search"]` - `"web_search"` - **sites:** `Optional[Iterable[ToolSite]]` - **url:** `str` URL for inclusion or exclusion (prefix with '-' for exclusion) - **use\_nested\_youchat\_updates:** `bool` ### Returns - `class AgentCreateCompletionResponse` - **id:** `str` - **content:** `List[Content]` - `class ContentContentThinking` - **citations:** `List[Citation]` - **id:** `int` - **type:** `Literal["file", "url"]` - `"file"` - `"url"` - **attributes:** `Optional[Dict[str, object]]` - **uri:** `Optional[str]` - **text:** `str` - **type:** `Literal["thinking"]` - `"thinking"` - `class ContentContentText` - **text:** `str` - **type:** `Literal["text"]` - `"text"` - **citations:** `Optional[List[Citation]]` - **id:** `int` - **type:** `Literal["file", "url"]` - `"file"` - `"url"` - **attributes:** `Optional[Dict[str, object]]` - **uri:** `Optional[str]` - `class ContentContentImage` - **path:** `str` - **type:** `Literal["image"]` - `"image"` - **type:** `Literal["response"]` - `"response"` - **intermediatary\_results:** `Optional[object]` Intermediate results (type unspecified) - **related\_searches:** `Optional[List[RelatedSearch]]` - **text:** `str` - **sources:** `Optional[List[Source]]` - `class SourceResponseSourceWeb` - **snippet:** `str` - **title:** `str` - **type:** `Literal["web"]` - `"web"` - **url:** `str` - `class SourceResponseSourceFile` - **type:** `Literal["file"]` - `"file"` - **uri:** `str` ### Example ```python 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) ``` ## Domain Types ### Citation - `class Citation` - **id:** `int` - **type:** `Literal["file", "url"]` - `"file"` - `"url"` - **attributes:** `Optional[Dict[str, object]]` - **uri:** `Optional[str]`