Versions in this module Expand all Collapse all v1 v1.0.2 Aug 26, 2025 v1.0.1 Aug 26, 2025 Changes in this version + const GraphName + const ModelNodeName + const ToolsNodeName + func BuildAgentCallback(modelHandler *template.ModelCallbackHandler, ...) callbacks.Handler + func SetReturnDirectly(ctx context.Context) error + func WithChatModelOptions(opts ...model.Option) agent.AgentOption + func WithToolList(tools ...tool.BaseTool) agent.AgentOption + func WithToolOptions(opts ...tool.Option) agent.AgentOption + type Agent struct + func NewAgent(ctx context.Context, config *AgentConfig) (_ *Agent, err error) + func (r *Agent) ExportGraph() (compose.AnyGraph, []compose.GraphAddNodeOpt) + func (r *Agent) Generate(ctx context.Context, input []*schema.Message, opts ...agent.AgentOption) (*schema.Message, error) + func (r *Agent) Stream(ctx context.Context, input []*schema.Message, opts ...agent.AgentOption) (output *schema.StreamReader[*schema.Message], err error) + type AgentConfig struct + GraphName string + MaxStep int + MessageModifier MessageModifier + Model model.ChatModel + ModelNodeName string + StreamToolCallChecker func(ctx context.Context, modelOutput *schema.StreamReader[*schema.Message]) (bool, error) + ToolCallingModel model.ToolCallingChatModel + ToolReturnDirectly map[string]struct{} + ToolsConfig compose.ToolsNodeConfig + ToolsNodeName string + type Iterator struct + func (iter *Iterator[T]) Next() (T, bool, error) + type MessageFuture interface + GetMessageStreams func() *Iterator[*schema.StreamReader[*schema.Message]] + GetMessages func() *Iterator[*schema.Message] + func WithMessageFuture() (agent.AgentOption, MessageFuture) + type MessageModifier func(ctx context.Context, input []*schema.Message) []*schema.Message + func NewPersonaModifier(persona string) MessageModifier