agents

package
v0.0.0-...-7ebd831 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetaKeyModelName       = "modelName"
	MetaKeyAvailableModels = "availableModels"
	MetaKeyDefaultModel    = "defaultModel"
)
View Source
const ChatFlowName = "Chat"

Variables

This section is empty.

Functions

func AllAroundAnalystSystemPrompt

func AllAroundAnalystSystemPrompt(_ context.Context, _ any) (string, error)

AllAroundAnalystSystemPrompt 全能分析师系统提示

func ComprehensiveAnalystSystemPrompt

func ComprehensiveAnalystSystemPrompt(_ context.Context, _ any) (string, error)

ComprehensiveAnalystSystemPrompt 综合分析师系统提示

func FundamentalAnalystSystemPrompt

func FundamentalAnalystSystemPrompt(_ context.Context, _ any) (string, error)

FundamentalAnalystSystemPrompt 基本面分析师系统提示

func GetMetaStringSliceValue

func GetMetaStringSliceValue(meta any, key string) []string

GetMetaStringSliceValue 从 _meta 中获取指定 key 的字符串切片值

func GetMetaStringValue

func GetMetaStringValue(meta any, key string) string

GetMetaStringValue 从 _meta 中获取指定 key 的字符串值

func GetMetaValue

func GetMetaValue(meta any, key string) any

GetMetaValue 从 _meta 中获取指定 key 的值

func MacroeconomicAnalystSystemPrompt

func MacroeconomicAnalystSystemPrompt(_ context.Context, _ any) (string, error)

MacroeconomicAnalystSystemPrompt 宏观经济分析师系统提示

func NewDefaultAgents

func NewDefaultAgents(
	comprehensiveAnalysisTools []ai.ToolRef,
	macroeconomicAnalysisTools []ai.ToolRef,
	fundamentalAnalysisTools []ai.ToolRef,
	technicalAnalysisTools []ai.ToolRef,
) (flows.AgentOptions, []flows.AgentOptions)

NewDefaultAgents 创建默认 Agent 列表

func TechnicalAnalystSystemPrompt

func TechnicalAnalystSystemPrompt(_ context.Context, _ any) (string, error)

TechnicalAnalystSystemPrompt 技术面分析师系统提示

Types

type NFAAgent

type NFAAgent struct {
	// contains filtered or unexported fields
}

NFAAgent NFA Agent

func NewNFA

func NewNFA(opts Options) *NFAAgent

NewNFA 创建 NFA Agent

func (*NFAAgent) Authenticate

Authenticate 认证

func (*NFAAgent) AvailableModels

func (a *NFAAgent) AvailableModels() []string

AvailableModels 获取可用模型名列表

func (*NFAAgent) Cancel

func (a *NFAAgent) Cancel(_ context.Context, params acp.CancelNotification) error

Cancel 取消

func (*NFAAgent) Connect

func (a *NFAAgent) Connect(in io.Reader, out io.Writer) error

Connect 连接

func (*NFAAgent) InitGenkit

func (a *NFAAgent) InitGenkit(ctx context.Context)

InitGenkit 初始化 genkit

func (*NFAAgent) Initialize

Initialize 初始化连接

func (*NFAAgent) NewSession

NewSession 创建会话

func (*NFAAgent) Prompt

func (a *NFAAgent) Prompt(ctx context.Context, params acp.PromptRequest) (acp.PromptResponse, error)

Prompt 对话

func (*NFAAgent) SetSessionMode

SetSessionMode 设置会话模式

type Options

type Options struct {
	Logger         logr.Logger
	ModelProviders []models.ModelProvider
	DataProviders  []dataproviders.DataProvider
	DefaultModel   string
	SingleAgent    bool
}

Options Agent 运行选项

func (*Options) Complete

func (opts *Options) Complete()

Complete 使用默认值补全选项

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session 会话

Directories

Path Synopsis