Documentation
¶
Index ¶
- Constants
- func EvalFromExperiment(exp *agentv1.Experiment, experimentFilePath string, cookie map[string]string, ...) (map[string]*parserv1.Cell, error)
- func NewClient(cfg config.OpenAIConfig) (*openai.Client, error)
- func NewClientWithKey(key string) (*openai.Client, error)
- func NewClientWithoutKey() *openai.Client
- func NewLlmJudge(client *openai.Client) *llmJudge
- type Agent
- type AgentOptions
- type Asserter
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 NewClientWithoutKey ¶ added in v3.16.6
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 ¶
Types ¶
type Agent ¶
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
func (a *Agent) BuildResponseParams(ctx context.Context, req *agentv1.GenerateRequest) (*responses.ResponseNewParams, []option.RequestOption, error)
func (*Agent) Generate ¶
func (a *Agent) Generate(ctx context.Context, req *connect.Request[agentv1.GenerateRequest], resp *connect.ServerStream[agentv1.GenerateResponse]) error
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
Click to show internal directories.
Click to hide internal directories.