anthropic

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package anthropic implements a judge.Provider backed by the Anthropic Messages API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveModel

func ResolveModel(model string) string

ResolveModel maps a shortcut to a full model ID. If the input is not a known shortcut, it is returned as-is.

Types

type Option

type Option func(*Provider)

Option configures a Provider.

func WithBaseURL

func WithBaseURL(url string) Option

WithBaseURL overrides the default Anthropic API base URL.

type Provider

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

Provider evaluates content using the Anthropic Messages API.

func New

func New(apiKey string, opts ...Option) *Provider

New creates an Anthropic judge provider with the given API key.

func (*Provider) Judge

func (p *Provider) Judge(ctx context.Context, req judge.Request) (judge.Verdict, error)

Judge evaluates content against a policy prompt using the Anthropic Messages API. It uses forced tool use to guarantee structured JSON output.

Jump to

Keyboard shortcuts

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