anthropic

package
v0.7.15 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTokenLimitError

func IsTokenLimitError(err error) bool

IsTokenLimitError reports whether err is an Anthropic API error indicating that the prompt exceeds the model's context window.

Types

type Client

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

Client is an Anthropic Messages API client.

func New

func New() (*Client, error)

New creates an Anthropic API client. It resolves the API key via config (env > config file) and reads ANTHROPIC_BASE_URL from the environment.

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.

Jump to

Keyboard shortcuts

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