types¶
ChatRequest
dataclass
¶
A request for chat completion.
Attributes:
| Name | Type | Description |
|---|---|---|
messages |
list[Message]
|
The list of messages in the conversation. |
model |
Optional[str]
|
The model to use for completion. |
temperature |
float
|
Sampling temperature for response generation. |
max_tokens |
Optional[int]
|
Maximum tokens to generate in the response. |
tools |
Optional[Sequence[ToolSpec]]
|
Tools available for the LLM to call. |
tool_choice |
Literal['auto', 'none', 'required']
|
Tool calling behavior. |
response_format |
Literal['text', 'json']
|
Desired response format. |
stream |
bool
|
Whether to stream the response. |
task_tag |
Optional[str]
|
Optional tag for tracking the request. |
Source code in wintermute/ai/types.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | |
ChatResponse
dataclass
¶
A response from a chat completion.
Attributes:
| Name | Type | Description |
|---|---|---|
content |
str
|
The content of the response. |
tool_calls |
Optional[list[ToolCall]]
|
List of tool calls made by the LLM. |
model |
Optional[str]
|
The model used for the response. |
provider |
Optional[str]
|
The provider of the model. |
prompt_tokens |
Optional[int]
|
Number of tokens in the prompt. |
completion_tokens |
Optional[int]
|
Number of tokens in the completion. |
latency_ms |
Optional[int]
|
Latency of the request in milliseconds. |
Source code in wintermute/ai/types.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |
Message
dataclass
¶
A message in a chat conversation.
Attributes:
| Name | Type | Description |
|---|---|---|
role |
Role
|
The role of the message sender. |
content |
str
|
The content of the message. |
tool_name |
Optional[str]
|
Name of the tool if role is "tool". |
tool_call_id |
Optional[str]
|
ID of the tool call if role is "tool". |
Source code in wintermute/ai/types.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | |
ToolCall
dataclass
¶
A tool call made by the LLM during chat completion.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Unique identifier for the tool call. |
name |
str
|
Name of the tool being called. |
arguments |
JSONObject
|
The arguments passed to the tool as a JSON object. |
Source code in wintermute/ai/types.py
71 72 73 74 75 76 77 78 79 80 81 82 83 | |
ToolSpec
dataclass
¶
Specification for a tool that can be called by the LLM.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Name of the tool. |
description |
str
|
Description of the tool's purpose. |
input_schema |
JSONObject
|
JSON schema defining the tool's input. |
output_schema |
Optional[JSONObject]
|
Optional JSON schema for the tool's output. |
Source code in wintermute/ai/types.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |