AnthropicRequest represents a request to the Anthropic Messages API https://docs.anthropic.com/claude/reference/messages_post
| 36 | // AnthropicRequest represents a request to the Anthropic Messages API |
| 37 | // https://docs.anthropic.com/claude/reference/messages_post |
| 38 | type AnthropicRequest struct { |
| 39 | Model string `json:"model"` |
| 40 | Messages []AnthropicMessage `json:"messages"` |
| 41 | MaxTokens int `json:"max_tokens"` |
| 42 | Metadata map[string]string `json:"metadata,omitempty"` |
| 43 | StopSequences []string `json:"stop_sequences,omitempty"` |
| 44 | Stream bool `json:"stream,omitempty"` |
| 45 | System AnthropicSystemParam `json:"system,omitempty"` |
| 46 | Temperature *float64 `json:"temperature,omitempty"` |
| 47 | TopK *int `json:"top_k,omitempty"` |
| 48 | TopP *float64 `json:"top_p,omitempty"` |
| 49 | Tools []AnthropicTool `json:"tools,omitempty"` |
| 50 | ToolChoice any `json:"tool_choice,omitempty"` |
| 51 | |
| 52 | // Internal fields for request handling |
| 53 | Context context.Context `json:"-"` |
| 54 | Cancel context.CancelFunc `json:"-"` |
| 55 | } |
| 56 | |
| 57 | // ModelName implements the LocalAIRequest interface |
| 58 | func (ar *AnthropicRequest) ModelName(s *string) string { |
nothing calls this directly
no outgoing calls
no test coverage detected