anthropic

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: May 13, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

README

Anthropic Plugin

This plugin provides a simple interface for using Anthropic's services.

Prerequisites

  • Go installed on your system
  • An Anthropic API key

Running Tests

First, set your Anthropic API key as an environment variable:

export ANTHROPIC_API_KEY=<your-api-key>
Running All Tests

To run all tests in the directory:

go test -v .
Running Tests from Specific Files

To run tests from a specific file:

# Run only generate_live_test.go tests
go test -run "^TestGenerator"

# Run only anthropic_live_test.go tests
go test -run "^TestPlugin"
Running Individual Tests

To run a specific test case:

# Run only the streaming test from anthropic_live_test.go
go test -run "TestPlugin/streaming"

# Run only the Complete test from generate_live_test.go
go test -run "TestGenerator_Complete"

# Run only the Stream test from generate_live_test.go
go test -run "TestGenerator_Stream"
Test Output Verbosity

Add the -v flag for verbose output:

go test -v -run "TestPlugin/streaming"

Note: All live tests require the ANTHROPIC_API_KEY environment variable to be set. Tests will be skipped if the API key is not provided.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Anthropic

type Anthropic struct {
	Opts []option.RequestOption
	// contains filtered or unexported fields
}

func (*Anthropic) DefineModel

func (a *Anthropic) DefineModel(g *genkit.Genkit, name string, info ai.ModelInfo) (ai.Model, error)

func (*Anthropic) Init

func (a *Anthropic) Init(ctx context.Context, g *genkit.Genkit) error

func (*Anthropic) Model

func (a *Anthropic) Model(g *genkit.Genkit, name string) ai.Model

func (*Anthropic) Name

func (a *Anthropic) Name() string

Name implements genkit.Plugin.

Jump to

Keyboard shortcuts

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