CreateMessageWithToolsParams is a sampling request that includes tools. It extends the basic [CreateMessageParams] fields with tools, tool choice, and messages that support array content (for parallel tool calls). Use with [ServerSession.CreateMessageWithTools].
| 431 | // |
| 432 | // Use with [ServerSession.CreateMessageWithTools]. |
| 433 | type CreateMessageWithToolsParams struct { |
| 434 | Meta `json:"_meta,omitempty"` |
| 435 | IncludeContext string `json:"includeContext,omitempty"` |
| 436 | MaxTokens int64 `json:"maxTokens"` |
| 437 | // Messages supports array content for tool_use and tool_result blocks. |
| 438 | Messages []*SamplingMessageV2 `json:"messages"` |
| 439 | Metadata any `json:"metadata,omitempty"` |
| 440 | ModelPreferences *ModelPreferences `json:"modelPreferences,omitempty"` |
| 441 | StopSequences []string `json:"stopSequences,omitempty"` |
| 442 | SystemPrompt string `json:"systemPrompt,omitempty"` |
| 443 | Temperature float64 `json:"temperature,omitempty"` |
| 444 | // Tools is the list of tools available for the model to use. |
| 445 | Tools []*Tool `json:"tools,omitempty"` |
| 446 | // ToolChoice controls how the model should use tools. |
| 447 | ToolChoice *ToolChoice `json:"toolChoice,omitempty"` |
| 448 | } |
| 449 | |
| 450 | func (x *CreateMessageWithToolsParams) isParams() {} |
| 451 | func (x *CreateMessageWithToolsParams) GetProgressToken() any { return getProgressToken(x) } |
nothing calls this directly
no outgoing calls
no test coverage detected