Documentation
¶
Overview ¶
Package claude provides a minimal client for the Anthropic Messages API, including non-streaming and streaming text completions.
Index ¶
Constants ¶
View Source
const (
// ModelHaiku is the default Claude Haiku model identifier used by this package.
ModelHaiku = "claude-haiku-4-5"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client calls the Anthropic Messages API.
type MessageRequest ¶
type MessageRequest struct {
Model string `json:"-"`
MaxTokens int `json:"-"`
System string `json:"-"`
CacheSystem bool `json:"-"`
Messages []Message `json:"-"`
Stream bool `json:"-"`
}
MessageRequest describes a request to the Anthropic Messages API.
func (MessageRequest) MarshalJSON ¶
func (r MessageRequest) MarshalJSON() ([]byte, error)
MarshalJSON serializes the request, using a structured system block with cache_control when CacheSystem is true.
Click to show internal directories.
Click to hide internal directories.