Documentation ¶
Index ¶
- Variables
- type Agent
- func (c *Agent) Ask(prompt string, content string) (rxgo.Observable, error)
- func (c *Agent) Call(ctx context.Context, content string, functions []llms.FunctionDefinition) (*schema.FunctionCall, error)
- func (c *Agent) GenerateImages(ctx context.Context, prompt string) ([]string, error)
- func (c *Agent) Prompt(ctx context.Context, prompt string) (string, error)
- func (c *Agent) PromptToProto(ctx context.Context, prompt string, p protoreflect.ProtoMessage, ...) error
- type Config
- type Definition
- type FunctionCallJSON
- type LogHandler
- func (l *LogHandler) HandleAgentAction(_ context.Context, action schema.AgentAction)
- func (l *LogHandler) HandleChainEnd(_ context.Context, outputs map[string]any)
- func (l *LogHandler) HandleChainStart(_ context.Context, inputs map[string]any)
- func (l *LogHandler) HandleLLMEnd(_ context.Context, output llms.LLMResult)
- func (l *LogHandler) HandleLLMStart(_ context.Context, prompts []string)
- func (l *LogHandler) HandleRetrieverEnd(ctx context.Context, query string, documents []schema.Document)
- func (l *LogHandler) HandleRetrieverStart(_ context.Context, query string)
- func (l *LogHandler) HandleStreamingFunc(ctx context.Context, chunk []byte)
- func (l *LogHandler) HandleText(_ context.Context, text string)
- func (l *LogHandler) HandleToolEnd(_ context.Context, output string)
- func (l *LogHandler) HandleToolStart(_ context.Context, input string)
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderSet = wire.NewSet( NewConfig, NewAgent, )
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
func (*Agent) Call ¶
func (c *Agent) Call( ctx context.Context, content string, functions []llms.FunctionDefinition, ) (*schema.FunctionCall, error)
func (*Agent) GenerateImages ¶
func (*Agent) PromptToProto ¶
func (c *Agent) PromptToProto( ctx context.Context, prompt string, p protoreflect.ProtoMessage, jsonSchemaDef []byte, ) error
type Config ¶
type Config struct { APIKey string `yaml:"api_key"` Timeout time.Duration `yaml:"timeout"` Model string `yaml:"model"` }
func NewDefaultConfig ¶
func NewDefaultConfig() Config
type Definition ¶
type Definition struct { Properties json.RawMessage `json:"properties"` AdditionalProperties bool `json:"additionalProperties"` Type string `json:"type"` Title string `json:"title"` }
type FunctionCallJSON ¶
type FunctionCallJSON struct { Schema string `json:"$schema"` Ref string `json:"$ref"` Definitions map[string]Definition `json:"definitions"` }
type LogHandler ¶
type LogHandler struct {
// contains filtered or unexported fields
}
LogHandler is a callback handler that prints to the standard output.
func NewHandler ¶
func NewHandler(ops ...Option) *LogHandler
func (*LogHandler) HandleAgentAction ¶
func (l *LogHandler) HandleAgentAction(_ context.Context, action schema.AgentAction)
func (*LogHandler) HandleChainEnd ¶
func (l *LogHandler) HandleChainEnd(_ context.Context, outputs map[string]any)
func (*LogHandler) HandleChainStart ¶
func (l *LogHandler) HandleChainStart(_ context.Context, inputs map[string]any)
func (*LogHandler) HandleLLMEnd ¶
func (l *LogHandler) HandleLLMEnd(_ context.Context, output llms.LLMResult)
func (*LogHandler) HandleLLMStart ¶
func (l *LogHandler) HandleLLMStart(_ context.Context, prompts []string)
func (*LogHandler) HandleRetrieverEnd ¶
func (*LogHandler) HandleRetrieverStart ¶
func (l *LogHandler) HandleRetrieverStart(_ context.Context, query string)
func (*LogHandler) HandleStreamingFunc ¶
func (l *LogHandler) HandleStreamingFunc(ctx context.Context, chunk []byte)
func (*LogHandler) HandleText ¶
func (l *LogHandler) HandleText(_ context.Context, text string)
func (*LogHandler) HandleToolEnd ¶
func (l *LogHandler) HandleToolEnd(_ context.Context, output string)
func (*LogHandler) HandleToolStart ¶
func (l *LogHandler) HandleToolStart(_ context.Context, input string)
type Option ¶
type Option func(*LogHandler)
func WithEvents ¶
func WithEvents(events chan rxgo.Item) Option
Click to show internal directories.
Click to hide internal directories.