# Chat ## Domain Types ### Completion Message - Not supported A message containing the model's (assistant) response in a chat conversation. - **Role:** `Assistant` Must be "assistant" to identify this as the model's response - `Assistant` - **Content:** `CompletionMessageContentUnion` The content of the model's response. - `string` - Not supported A text content item - **Text:** `string` Text content - **Type:** `MessageTextContentItemType` Discriminator type of the content item. Always "text" - `MessageTextContentItemType` - **StopReason:** `CompletionMessageStopReason` The reason why we stopped. Options are: - "stop": The model reached a natural stopping point. - "tool_calls": The model finished generating and invoked a tool call. - "length": The model reached the maxinum number of tokens specified in the request. - `CompletionMessageStopReason` - `CompletionMessageStopReason` - `CompletionMessageStopReason` - **ToolCalls:** `[]CompletionMessageToolCall` The tool calls generated by the model, such as function calls. - **ID:** `string` The ID of the tool call. - **Function:** `CompletionMessageToolCallFunction` The function that the model called. - **Arguments:** `string` The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. - **Name:** `string` The name of the function to call. ### Create Chat Completion Response - Not supported Response from a chat completion request. - **CompletionMessage:** `CompletionMessage` The complete response message - **ID:** `string` The unique identifier of the chat completion request. - **Metrics:** `[]CreateChatCompletionResponseMetric` - **Metric:** `string` - **Value:** `float64` - **Unit:** `string` ### Create Chat Completion Response Stream Chunk - Not supported A chunk of a streamed chat completion response. - **Event:** `CreateChatCompletionResponseStreamChunkEvent` The event containing the new content - **Delta:** `CreateChatCompletionResponseStreamChunkEventDeltaUnion` Content generated since last event. This can be one or more tokens, or a tool call. - Not supported - **Text:** `string` - **Type:** `Text` - `Text` - Not supported - **Function:** `CreateChatCompletionResponseStreamChunkEventDeltaToolCallFunction` - **Arguments:** `string` The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. - **Name:** `string` The name of the function to call. - **Type:** `ToolCall` - `ToolCall` - **ID:** `string` The ID of the tool call. - **EventType:** `string` Type of the event - `CreateChatCompletionResponseStreamChunkEventEventType` - `CreateChatCompletionResponseStreamChunkEventEventType` - `CreateChatCompletionResponseStreamChunkEventEventType` - `CreateChatCompletionResponseStreamChunkEventEventType` - **Metrics:** `[]CreateChatCompletionResponseStreamChunkEventMetric` - **Metric:** `string` - **Value:** `float64` - **Unit:** `string` - **StopReason:** `string` The reason why we stopped. Options are: - "stop": The model reached a natural stopping point. - "tool_calls": The model finished generating and invoked a tool call. - "length": The model reached the maxinum number of tokens specified in the request. - `CreateChatCompletionResponseStreamChunkEventStopReason` - `CreateChatCompletionResponseStreamChunkEventStopReason` - `CreateChatCompletionResponseStreamChunkEventStopReason` - **ID:** `string` The unique identifier of the chat completion request. ### Message - Not supported A message from the user in a chat conversation. - `UserMessage` - `SystemMessage` - `ToolResponseMessage` - Not supported A message containing the model's (assistant) response in a chat conversation. - **Role:** `Assistant` Must be "assistant" to identify this as the model's response - `Assistant` - **Content:** `CompletionMessageContentUnion` The content of the model's response. - `string` - Not supported A text content item - **Text:** `string` Text content - **Type:** `MessageTextContentItemType` Discriminator type of the content item. Always "text" - `MessageTextContentItemType` - **StopReason:** `CompletionMessageStopReason` The reason why we stopped. Options are: - "stop": The model reached a natural stopping point. - "tool_calls": The model finished generating and invoked a tool call. - "length": The model reached the maxinum number of tokens specified in the request. - `CompletionMessageStopReason` - `CompletionMessageStopReason` - `CompletionMessageStopReason` - **ToolCalls:** `[]CompletionMessageToolCall` The tool calls generated by the model, such as function calls. - **ID:** `string` The ID of the tool call. - **Function:** `CompletionMessageToolCallFunction` The function that the model called. - **Arguments:** `string` The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. - **Name:** `string` The name of the function to call. ### Message Image Content Item - Not supported A image content item - **ImageURL:** `MessageImageContentItemImageURL` Contains either an image URL or a data URL for a base64 encoded image. - **URL:** `string` Either a URL of the image or the base64 encoded image data. - **Type:** `MessageImageContentItemType` Discriminator type of the content item. Always "image" - `MessageImageContentItemType` ### Message Text Content Item - Not supported A text content item - **Text:** `string` Text content - **Type:** `MessageTextContentItemType` Discriminator type of the content item. Always "text" - `MessageTextContentItemType` ### System Message - Not supported A system message providing instructions or context to the model. - **Content:** `SystemMessageContentUnion` The content of the system message. - `string` - `[]MessageTextContentItem` - **Role:** `System` Must be "system" to identify this as a system message - `System` ### Tool Response Message - Not supported A message representing the result of a tool invocation. - **Content:** `ToolResponseMessageContentUnion` The content of the user message, which can include text and other media. - `string` - `[]MessageTextContentItem` - **Role:** `Tool` Must be "tool" to identify this as a tool response - `Tool` - **ToolCallID:** `string` Unique identifier for the tool call this response is for ### User Message - Not supported A message from the user in a chat conversation. - **Content:** `UserMessageContentUnion` The content of the user message, which can include text and other media. - `string` - `[]UserMessageContentArrayOfContentItemUnion` - **Role:** `UserMessageRole` Must be "user" to identify this as a user message. - `UserMessageRole`