anthropic

package
v0.7.31 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrKeyNotFound indicates no Anthropic API key was found in env or config.
	ErrKeyNotFound = errors.New("api key not found")

	// ErrTokenLimit indicates the prompt exceeds the model's context window.
	ErrTokenLimit = errors.New("prompt exceeds context window")
)

Functions

This section is empty.

Types

type Client

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

Client is an Anthropic Messages API client.

func New

func New(cfg Config) (*Client, error)

func (*Client) AnalyzeReviews

func (c *Client) AnalyzeReviews(ctx context.Context, prompt, model string) (string, error)

AnalyzeReviews sends review data to Claude for pattern analysis.

func (*Client) Ask

func (c *Client) Ask(ctx context.Context, model string, maxTokens int, prompt string, system ...string) (string, error)

Ask sends a single user message and returns the assistant text. An optional system prompt can be passed as the last argument.

func (*Client) GenerateReviewPrompt

func (c *Client) GenerateReviewPrompt(ctx context.Context, analysis, model string, includeAttribution bool) (string, error)

GenerateReviewPrompt uses Claude to generate a PR review prompt from analysis.

type Config added in v0.7.29

type Config struct {
	APIKey  string
	BaseURL string
}

type StatusError added in v0.7.29

type StatusError = hc.StatusError

StatusError is an alias for the shared httpcl.StatusError type.

Jump to

Keyboard shortcuts

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