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.
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.
Click to show internal directories.
Click to hide internal directories.