Documentation
¶
Index ¶
- func WithChatOptions(chatOpts []ChatOption) adk.AgentRunOption
- type Agent
- func (this *Agent) Description(ctx context.Context) string
- func (this *Agent) Generate(ctx context.Context, input []*schema.Message, opts ...ChatOption) (*schema.Message, error)
- func (this *Agent) GetAdkAgent() adk.Agent
- func (this *Agent) Name(ctx context.Context) string
- func (this *Agent) Run(ctx context.Context, input *adk.AgentInput, options ...adk.AgentRunOption) *adk.AsyncIterator[*adk.AgentEvent]
- func (this *Agent) Stream(ctx context.Context, input []*schema.Message, opts ...ChatOption) (*schema.StreamReader[*schema.Message], error)
- type ChatOption
- type Option
- func WithDescription(description string) Option
- func WithMaxStep(maxStep int) Option
- func WithMemoryManager(memoryManager *memory.MemoryManager) Option
- func WithName(name string) Option
- func WithSubAgent(agents []adk.Agent) Option
- func WithSystemPrompt(systemPrompt string) Option
- func WithTools(tools []tool.BaseTool) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithChatOptions ¶
func WithChatOptions(chatOpts []ChatOption) adk.AgentRunOption
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
func NewAgentFromADK ¶
NewAgentFromADK 从已存在的adk.Agent创建Agent实例 适用于已经通过adk包创建的Agent
func (*Agent) Generate ¶
func (this *Agent) Generate(ctx context.Context, input []*schema.Message, opts ...ChatOption) (*schema.Message, error)
Generate 生成完整响应(非流式) 性能优化:预分配内存,异步存储消息
func (*Agent) GetAdkAgent ¶
func (*Agent) Run ¶
func (this *Agent) Run(ctx context.Context, input *adk.AgentInput, options ...adk.AgentRunOption) *adk.AsyncIterator[*adk.AgentEvent]
Run adk的Run入口 性能优化:预分配内存,异步存储消息
type ChatOption ¶
type ChatOption func(*chatOptions)
func WithChatComposeOptions ¶
func WithChatComposeOptions(composeOptions []compose.Option) ChatOption
func WithChatSessionID ¶
func WithChatSessionID(sessionID string) ChatOption
func WithChatTools ¶
func WithChatTools(tools []tool.BaseTool) ChatOption
func WithChatUserID ¶
func WithChatUserID(userID string) ChatOption
func WithUserMessageSuffix ¶
func WithUserMessageSuffix(suffix string) ChatOption
WithUserMessageSuffix 添加用户消息后缀
type Option ¶
type Option func(*Agent)
func WithDescription ¶
func WithMaxStep ¶
func WithMemoryManager ¶
func WithMemoryManager(memoryManager *memory.MemoryManager) Option
func WithSubAgent ¶
func WithSystemPrompt ¶
Click to show internal directories.
Click to hide internal directories.