Documentation
¶
Index ¶
- type AgentConfig
- type CallbackHandler
- func (h CallbackHandler) OnEnd(ctx context.Context, info *callbacks.RunInfo, output callbacks.CallbackOutput) context.Context
- func (h CallbackHandler) OnEndWithStreamOutput(ctx context.Context, info *callbacks.RunInfo, ...) context.Context
- func (h CallbackHandler) OnError(ctx context.Context, info *callbacks.RunInfo, err error) context.Context
- func (h CallbackHandler) OnStart(ctx context.Context, info *callbacks.RunInfo, input callbacks.CallbackInput) context.Context
- func (h CallbackHandler) OnStartWithStreamInput(ctx context.Context, info *callbacks.RunInfo, ...) context.Context
- type ChatModel
- type Generator
- type ModelConfig
- type ModelType
- type ReactAgent
- type ReactAgentOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentConfig ¶
type CallbackHandler ¶
type CallbackHandler struct{}
func (CallbackHandler) OnEnd ¶
func (h CallbackHandler) OnEnd(ctx context.Context, info *callbacks.RunInfo, output callbacks.CallbackOutput) context.Context
func (CallbackHandler) OnEndWithStreamOutput ¶
func (h CallbackHandler) OnEndWithStreamOutput(ctx context.Context, info *callbacks.RunInfo, output *schema.StreamReader[callbacks.CallbackOutput]) context.Context
func (CallbackHandler) OnStart ¶
func (h CallbackHandler) OnStart(ctx context.Context, info *callbacks.RunInfo, input callbacks.CallbackInput) context.Context
func (CallbackHandler) OnStartWithStreamInput ¶
func (h CallbackHandler) OnStartWithStreamInput(ctx context.Context, info *callbacks.RunInfo, input *schema.StreamReader[callbacks.CallbackInput]) context.Context
type ChatModel ¶
type ChatModel interface { model.ToolCallingChatModel }
ChatModel is the interface for making LLM backend.
func NewChatModel ¶
func NewChatModel(m ModelConfig) (model ChatModel)
type Generator ¶
type Generator interface { // Call calls the LLM with the input. Call(ctx context.Context, input string) (string, error) }
Generator is the interface for calling
type ModelConfig ¶
type ModelConfig struct { Name string `json:"name"` // alias of the config, not endpoint! APIType ModelType `json:"type"` BaseURL string `json:"base_url"` APIKey string `json:"api_key"` ModelName string `json:"model_name"` // the endpoint of the model, like `claude-opus-4-20250514` Temperature *float32 `json:"temperature"` // TopP *float32 `json:"top_p"` MaxTokens int `json:"max_tokens"` }
type ReactAgent ¶
func NewReactAgent ¶
func NewReactAgent(name string, opts ReactAgentOptions) *ReactAgent
type ReactAgentOptions ¶
type ReactAgentOptions struct { SysPrompt prompt.Prompt `json:"-"` *react.AgentConfig }
Click to show internal directories.
Click to hide internal directories.