ai

package
v3.16.10 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultInstructions is the default system prompt to use when generating responses
	DefaultInstructions = `` /* 963-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func EvalFromExperiment

func EvalFromExperiment(exp *agentv1.Experiment, experimentFilePath string, cookie map[string]string, client *openai.Client, log logr.Logger) (map[string]*parserv1.Cell, error)

EvalFromExperiment runs an experiment based on the Experiment config.

func NewClient

func NewClient(cfg config.OpenAIConfig) (*openai.Client, error)

NewClient helper function to create a new OpenAI client from a config

func NewClientWithKey

func NewClientWithKey(key string) (*openai.Client, error)

func NewClientWithoutKey added in v3.16.6

func NewClientWithoutKey() *openai.Client

NewClientWithoutKey returns an OpenAI client configured without an API key. This is intended for OAuth flows where the caller supplies the Authorization header per-request.

func NewLlmJudge

func NewLlmJudge(client *openai.Client) *llmJudge

Types

type Agent

type Agent struct {
	Client *openai.Client
	// contains filtered or unexported fields
}

Agent implements the AI Service https://buf.build/jlewi/foyle/file/main:foyle/v1alpha1/agent.proto#L44

func NewAgent

func NewAgent(opts AgentOptions) (*Agent, error)

func (*Agent) BuildResponseParams added in v3.16.6

type AgentOptions

type AgentOptions struct {
	VectorStores []string
	Client       *openai.Client

	// Instructions are the prompt to use when generating responses
	Instructions string

	// Extra OpenAI API headers for requests that use OAuth access tokens.
	OAuthOpenAIOrganization string
	OAuthOpenAIProject      string
}

AgentOptions are options for creating a new Agent

func (*AgentOptions) FromAssistantConfig

func (o *AgentOptions) FromAssistantConfig(cfg config.CloudAssistantConfig) error

FromAssistantConfig overrides the AgentOptions based on the values from the AssistantConfig

type Asserter

type Asserter interface {
	Assert(ctx context.Context, as *agentv1.Assertion, inputText string, cells map[string]*parserv1.Cell) error
}

Directories

Path Synopsis
Package tools contains code for working with OpenAI tools (as in tool calling and mcp servers).
Package tools contains code for working with OpenAI tools (as in tool calling and mcp servers).

Jump to

Keyboard shortcuts

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