claude

package
v0.26.10 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticityResult

type AuthenticityResult struct {
	Classification string  `json:"classification"` // human, ai_assisted, ai_generated, uncertain
	Confidence     float64 `json:"confidence"`
	Reasoning      string  `json:"reasoning"`
}

AuthenticityResult is the classification result for PR descriptions.

type Client

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

Client wraps the Anthropic Messages API. Nil-safe — callers should check for nil before use to allow graceful degradation.

func New

func New() *Client

New creates a Claude client from environment variables. Checks DEVTRACE_ANTHROPIC_API_KEY first (service-scoped), then ANTHROPIC_API_KEY. Returns nil if neither is set.

func (*Client) ClassifyPRAuthenticity

func (c *Client) ClassifyPRAuthenticity(ctx context.Context, descriptions []string) (*AuthenticityResult, error)

ClassifyPRAuthenticity classifies PR descriptions.

func (*Client) GenerateRiskNarrative

func (c *Client) GenerateRiskNarrative(ctx context.Context, input RiskInput) (string, error)

GenerateRiskNarrative produces a 1-2 sentence risk assessment.

type RiskInput

type RiskInput struct {
	Username       string             `json:"username"`
	Score          float64            `json:"score"`
	Grade          string             `json:"grade"`
	Categories     map[string]float64 `json:"categories"`
	AccountAge     int64              `json:"account_age_days"`
	PRsMerged      int64              `json:"prs_merged"`
	PRsClosed      int64              `json:"prs_closed"`
	Followers      int64              `json:"followers"`
	PublicRepos    int64              `json:"public_repos"`
	Suspended      bool               `json:"suspended"`
	HasRepoContext bool               `json:"has_repo_context"`
	RepoContext    string             `json:"repo_context,omitempty"`
}

RiskInput contains the data for risk narrative generation.

Jump to

Keyboard shortcuts

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