Help us shape the future of Go! Take the 2026 Go Developer Survey

provider

package
v0.2.7 Latest Latest
Warning

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

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

Documentation

Overview

Package provider builds an Eino chat model from a "provider:model" string.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	Chat     model.ToolCallingChatModel
	Provider string
	Name     string
}

Model is a chat model with the names used to label it in events.

func Build

func Build(ctx context.Context, spec string, opts Options) (*Model, error)

Build parses spec and returns the model. Supported forms:

anthropic:<model>   key from ANTHROPIC_API_KEY
openai:<model>      key from OPENAI_API_KEY, optional OPENAI_BASE_URL
script:<path>       a JSON script played back with no network access

A missing key is reported before any network call is made.

type Options

type Options struct {
	// Getenv reads an environment variable. API keys are only ever read here.
	Getenv func(string) string
	// MaxTokens caps the reply length for providers that require a cap.
	MaxTokens int
}

Options are the settings that are not part of the model string.

Jump to

Keyboard shortcuts

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