anthropic

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2025 License: MIT Imports: 17 Imported by: 2

Documentation

Index

Constants

View Source
const Provider = "Anthropic"
View Source
const Version = "2023-06-01"

Variables

View Source
var GenModel_3_5_haiku_20241022 = gen.Model{
	Provider:                Provider,
	Name:                    "claude-3-5-haiku-20241022",
	Description:             "",
	InputContentTypes:       nil,
	InputMaxToken:           0,
	OutputMaxToken:          0,
	SupportTools:            false,
	SupportStructuredOutput: false,
}
View Source
var GenModel_3_5_haiku_latest = gen.Model{
	Provider:                Provider,
	Name:                    "claude-3-5-haiku-latest",
	Description:             "",
	InputContentTypes:       nil,
	InputMaxToken:           0,
	OutputMaxToken:          0,
	SupportTools:            false,
	SupportStructuredOutput: false,
}
View Source
var GenModel_3_5_sonnet_20240620 = gen.Model{
	Provider:                Provider,
	Name:                    "claude-3-5-sonnet-20240620",
	Description:             "",
	InputContentTypes:       nil,
	InputMaxToken:           0,
	OutputMaxToken:          0,
	SupportTools:            false,
	SupportStructuredOutput: false,
}
View Source
var GenModel_3_5_sonnet_20241022 = gen.Model{
	Provider:                Provider,
	Name:                    "claude-3-5-sonnet-20241022",
	Description:             "",
	InputContentTypes:       nil,
	InputMaxToken:           0,
	OutputMaxToken:          0,
	SupportTools:            false,
	SupportStructuredOutput: false,
}
View Source
var GenModel_3_5_sonnet_latest = gen.Model{
	Provider:                Provider,
	Name:                    "claude-3-5-sonnet-latest",
	Description:             "",
	InputContentTypes:       nil,
	InputMaxToken:           0,
	OutputMaxToken:          0,
	SupportTools:            false,
	SupportStructuredOutput: false,
}
View Source
var GenModel_3_7_sonnet_20250219 = gen.Model{
	Provider:       Provider,
	Name:           "claude-3-7-sonnet-20250219",
	InputMaxToken:  200_000,
	OutputMaxToken: 64_000,
}
View Source
var GenModel_3_7_sonnet_latest = gen.Model{
	Provider:       Provider,
	Name:           "claude-3-7-sonnet-latest",
	InputMaxToken:  200_000,
	OutputMaxToken: 64_000,
}

https://docs.anthropic.com/en/docs/about-claude/models

View Source
var GenModel_3_haiku_20240307 = gen.Model{
	Provider:                Provider,
	Name:                    "claude-3-haiku-20240307",
	Description:             "",
	InputContentTypes:       nil,
	InputMaxToken:           0,
	OutputMaxToken:          0,
	SupportTools:            false,
	SupportStructuredOutput: false,
}
View Source
var GenModel_3_opus_20240229 = gen.Model{
	Provider:                Provider,
	Name:                    "claude-3-opus-20240229",
	Description:             "",
	InputContentTypes:       nil,
	InputMaxToken:           0,
	OutputMaxToken:          0,
	SupportTools:            false,
	SupportStructuredOutput: false,
}
View Source
var GenModel_3_opus_latest = gen.Model{
	Provider:                Provider,
	Name:                    "claude-3-opus-latest",
	Description:             "",
	InputContentTypes:       nil,
	InputMaxToken:           0,
	OutputMaxToken:          0,
	SupportTools:            false,
	SupportStructuredOutput: false,
}
View Source
var GenModel_4_0_opus_20250514 = gen.Model{
	Provider:                Provider,
	Name:                    "claude-opus-4-20250514",
	Description:             "",
	InputContentTypes:       nil,
	InputMaxToken:           0,
	OutputMaxToken:          0,
	SupportTools:            false,
	SupportStructuredOutput: false,
}
View Source
var GenModel_4_0_sonnet_20250514 = gen.Model{
	Provider:       Provider,
	Name:           "claude-sonnet-4-20250514",
	InputMaxToken:  200_000,
	OutputMaxToken: 64_000,
}
View Source
var GenModel_4_1_opus_20250805 = gen.Model{
	Provider:                Provider,
	Name:                    "claude-opus-4-1-20250805",
	Description:             "Exceptional model for specialized reasoning tasks",
	InputContentTypes:       nil,
	InputMaxToken:           200_000,
	OutputMaxToken:          32_000,
	SupportTools:            false,
	SupportStructuredOutput: false,
}
View Source
var GenModel_4_5_haiku_20251001 = gen.Model{
	Provider:                Provider,
	Name:                    "claude-haiku-4-5-20251001",
	Description:             "Our fastest model with near-frontier intelligence",
	InputContentTypes:       nil,
	InputMaxToken:           200_000,
	OutputMaxToken:          64_000,
	SupportTools:            true,
	SupportStructuredOutput: true,
}
View Source
var GenModel_4_5_haiku_latest = gen.Model{
	Provider:                Provider,
	Name:                    "claude-haiku-4-5",
	Description:             "Our fastest model with near-frontier intelligence",
	InputContentTypes:       nil,
	InputMaxToken:           200_000,
	OutputMaxToken:          64_000,
	SupportTools:            true,
	SupportStructuredOutput: true,
}
View Source
var GenModel_4_5_sonnet_20250929 = gen.Model{
	Provider:       Provider,
	Description:    "Our smartest model for complex agents and coding",
	Name:           "claude-sonnet-4-5-20250929",
	InputMaxToken:  200_000,
	OutputMaxToken: 64_000,
}
View Source
var GenModel_4_5_sonnet_latest = gen.Model{
	Provider:       Provider,
	Description:    "Our smartest model for complex agents and coding",
	Name:           "claude-4-5-sonnet",
	InputMaxToken:  200_000,
	OutputMaxToken: 64_000,
}

Functions

This section is empty.

Types

type Anthropic

type Anthropic struct {
	Log *slog.Logger `json:"-"`
	// contains filtered or unexported fields
}

func New

func New(apiKey string) *Anthropic

func (*Anthropic) Generator

func (a *Anthropic) Generator(options ...gen.Option) *gen.Generator

func (*Anthropic) Provider added in v0.7.0

func (g *Anthropic) Provider() string

func (*Anthropic) SetLogger

func (g *Anthropic) SetLogger(logger *slog.Logger) *Anthropic

type DataType added in v0.8.0

type DataType string
const (
	Object  DataType = "object"
	Number  DataType = "number"
	Integer DataType = "integer"
	String  DataType = "string"
	Array   DataType = "array"
	Null    DataType = "null"
	Boolean DataType = "boolean"
)

type ExtendedThinkingType added in v0.11.9

type ExtendedThinkingType string
const (
	ExtendedThinkingTypeEnabled  ExtendedThinkingType = "enabled"
	ExtendedThinkingTypeDisabled ExtendedThinkingType = "disabled"
)

type JSONSchema added in v0.8.0

type JSONSchema struct {
	Ref  string                 `json:"$ref,omitempty"`  // #/$defs/... etc, overrides everything else
	Defs map[string]*JSONSchema `json:"$defs,omitempty"` // for $ref
	// Type specifies the data type of the schema. OpenAI uses []string{Type, Null} to represent nullable types.
	Type any `json:"type,omitempty"`
	// Description is the description of the schema.
	Description string `json:"description,omitempty"`
	// Enum is used to restrict a value to a fixed set of values. It must be an array with at least
	// one element, where each element is unique. You will probably only use this with strings.
	Enum    []any  `json:"enum,omitempty"`
	Pattern string `json:"pattern,omitempty"` // Regular expression that the string must match.
	Format  string `json:"format,omitempty"`  // Format of the data, e.g. "email", "date-time", etc.
	// Properties describes the properties of an object, if the schema type is Object.
	Properties map[string]JSONSchema `json:"properties,omitempty"`
	// Required specifies which properties are required, if the schema type is Object.
	Required []string `json:"required,omitempty"`
	// Items specifies which data type an array contains, if the schema type is Array.
	Items *JSONSchema `json:"items,omitempty"`
	// AdditionalProperties is used to control the handling of properties in an object
	// that are not explicitly defined in the properties section of the schema. example:
	// additionalProperties: true
	// additionalProperties: false
	// additionalProperties: jsonschema.JSONSchema{Type: jsonschema.String}
	AdditionalProperties any `json:"additionalProperties,omitempty"`

	Minimum  float64 `json:"minimum,omitempty"`  // Minimum value of the integer and number types.
	Maximum  float64 `json:"maximum,omitempty"`  // Minimum value of the integer and number types.
	MinItems int     `json:"minItems,omitempty"` // Minimum number of items in an array.
	MaxItems int     `json:"maxItems,omitempty"` // Maximum number of items in an array.
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL