cmd

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 21 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

func F

func F[T any](v T) *T

F is a helper function to get a pointer to a value

Types

type AnthropicClient added in v0.3.0

type AnthropicClient struct {
	// contains filtered or unexported fields
}

func NewAnthropicClient added in v0.3.0

func NewAnthropicClient(apiKey string) *AnthropicClient

func (*AnthropicClient) CreateMessage added in v0.3.0

func (c *AnthropicClient) CreateMessage(ctx context.Context, req CreateMessageRequest) (*Message, error)

type ContentBlock added in v0.3.0

type ContentBlock struct {
	Type string `json:"type"`
	Text string `json:"text,omitempty"`
	// For tool use blocks
	ID        string          `json:"id,omitempty"`
	ToolUseID string          `json:"tool_use_id,omitempty"`
	Name      string          `json:"name,omitempty"`
	Input     json.RawMessage `json:"input,omitempty"`
	// For tool result blocks
	Content interface{} `json:"content,omitempty"` // Can be string or []ContentBlock
}

type CreateMessageRequest added in v0.3.0

type CreateMessageRequest struct {
	Model     string         `json:"model"`
	Messages  []MessageParam `json:"messages"`
	MaxTokens int            `json:"max_tokens"`
	Tools     []Tool         `json:"tools,omitempty"`
}

type InputSchema added in v0.3.0

type InputSchema struct {
	Type       string                 `json:"type"`
	Properties map[string]interface{} `json:"properties,omitempty"`
	Required   []string               `json:"required,omitempty"`
}

type MCPConfig

type MCPConfig struct {
	MCPServers map[string]struct {
		Command string   `json:"command"`
		Args    []string `json:"args"`
	} `json:"mcpServers"`
}

type Message added in v0.3.0

type Message struct {
	ID           string         `json:"id"`
	Type         string         `json:"type"`
	Role         string         `json:"role"`
	Content      []ContentBlock `json:"content"`
	Model        string         `json:"model"`
	StopReason   *string        `json:"stop_reason"`
	StopSequence *string        `json:"stop_sequence"`
	Usage        Usage          `json:"usage"`
}

type MessageParam added in v0.3.0

type MessageParam struct {
	Role    string         `json:"role"`
	Content []ContentBlock `json:"content"`
}

type Tool added in v0.3.0

type Tool struct {
	Name        string      `json:"name"`
	Description string      `json:"description,omitempty"`
	InputSchema InputSchema `json:"input_schema"`
}

type Usage added in v0.3.0

type Usage struct {
	InputTokens  int `json:"input_tokens"`
	OutputTokens int `json:"output_tokens"`
}

Jump to

Keyboard shortcuts

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