MCPcopy
hub / github.com/mudler/LocalAI / AnthropicRequest

Struct AnthropicRequest

core/schema/anthropic.go:38–55  ·  view source on GitHub ↗

AnthropicRequest represents a request to the Anthropic Messages API https://docs.anthropic.com/claude/reference/messages_post

Source from the content-addressed store, hash-verified

36// AnthropicRequest represents a request to the Anthropic Messages API
37// https://docs.anthropic.com/claude/reference/messages_post
38type 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
58func (ar *AnthropicRequest) ModelName(s *string) string {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected