Skip to main content

aiagent

函数名函数描述/介绍
aiagent.CreateForge
aiagent.ExecuteForge
aiagent.ExtractAction
aiagent.ExtractPlan
aiagent.NewExecutor
aiagent.NewExecutorFromJson
aiagent.agreeAuto
aiagent.agreeManual
aiagent.agreePolicy
aiagent.agreePolicyAI
aiagent.agreeYOLO
aiagent.aiAgree
aiagent.aiAutoRetry
aiagent.aiCallback
aiagent.aiToolsSearchTool
aiagent.aiTransactionRetry
aiagent.allowRequireForUserInteract
aiagent.appendPersistentMemory
aiagent.context
aiagent.coordinatorAICallback
aiagent.debug
aiagent.debugPrompt
aiagent.disableToolUse
aiagent.disallowRequireForUserPrompt
aiagent.eventHandler
aiagent.eventInputChan
aiagent.extendAIDOptions
aiagent.extendedActionCallback
aiagent.forgeName
aiagent.forgePlanMockerWithPlanMocker 设置AI助手的计划生成器
aiagent.forgeToolsWithTools 为AI助手添加可用的工具 这些工具可以扩展AI的能力,使其能够执行特定的任务
aiagent.initPromptWithInitializePrompt 设置AI助手的初始化提示词 这个提示词会在AI助手启动时被使用,用于定义AI的初始状态和行为
aiagent.initializePromptWithInitializePrompt 设置AI助手的初始化提示词 这个提示词会在AI助手启动时被使用,用于定义AI的初始状态和行为
aiagent.jarOperator
aiagent.manualAssistantCallback
aiagent.memory
aiagent.offsetSeq
aiagent.omniSearchTool
aiagent.originYaklangCliCodeWithOriginYaklangCliCode 设置原始的Yaklang CLI代码 这个结构需要 Yak 引擎根据 CLI 代码构建出正确的用户需要输入的工具 这个结构是表单构建的核心依据,可以使用 Yak 原声插件基础设施直接构建表单
aiagent.persistentPromptWithPersistentPrompt 设置AI助手的持久提示词 这个提示词会在整个会话过程中持续存在,确保AI行为的一致性
aiagent.persistentPromptForgeWithPersistentPrompt 设置AI助手的持久提示词 这个提示词会在整个会话过程中持续存在,确保AI行为的一致性
aiagent.plan
aiagent.planAICallback
aiagent.resultHandler
aiagent.resultHandlerForgeWithResultHandler 设置AI助手的结果处理函数 这个函数会在AI助手生成结果后被调用,用于处理AI的输出
aiagent.resultPromptWithResultPrompt 设置AI助手的生成结果提示词 这个提示词会在AI助手生成结果时被使用,用于定义AI的输出格式和内容
aiagent.resultPromptForgeWithResultPrompt 设置AI助手的生成结果提示词 这个提示词会在AI助手生成结果时被使用,用于定义AI的输出格式和内容
aiagent.systemFileOperator
aiagent.taskAICallback
aiagent.timeLineLimit
aiagent.timelineContentLimit
aiagent.tool
aiagent.toolKeywordsWithToolKeywords 设置AI助手的工具关键词 这些关键词可以扩展AI的能力,使其能够执行特定的任务
aiagent.toolManager
aiagent.tools

函数定义#

CreateForge#

详细描述#

定义#

CreateForge(name string, opts ...any) *aiforge.ForgeBlueprint

参数#

参数名参数类型参数解释
namestring
opts...any

返回值#

返回值(顺序)返回值类型返回值解释
r1*aiforge.ForgeBlueprint

ExecuteForge#

详细描述#

定义#

ExecuteForge(forgeName string, i any, iopts ...any) (any, error)

参数#

参数名参数类型参数解释
forgeNamestring
iany
iopts...any

返回值#

返回值(顺序)返回值类型返回值解释
r1any
r2error

ExtractAction#

详细描述#

定义#

ExtractAction(i string, actionName string, alias ...string) (*Action, error)

参数#

参数名参数类型参数解释
istring
actionNamestring
alias...string

返回值#

返回值(顺序)返回值类型返回值解释
r1*Action
r2error

ExtractPlan#

详细描述#

定义#

ExtractPlan(c *Config, rawResponse string) (*PlanResponse, error)

参数#

参数名参数类型参数解释
c*Config
rawResponsestring

返回值#

返回值(顺序)返回值类型返回值解释
r1*PlanResponse
r2error

NewExecutor#

详细描述#

定义#

NewExecutor(name string, i any, opts ...any) (*aid.Coordinator, error)

参数#

参数名参数类型参数解释
namestring
iany
opts...any

返回值#

返回值(顺序)返回值类型返回值解释
r1*aid.Coordinator
r2error

NewExecutorFromJson#

详细描述#

定义#

NewExecutorFromJson(json string, i any, opts ...any) (*aid.Coordinator, error)

参数#

参数名参数类型参数解释
jsonstring
iany
opts...any

返回值#

返回值(顺序)返回值类型返回值解释
r1*aid.Coordinator
r2error

agreeAuto#

详细描述#

定义#

agreeAuto(interval time.Duration) Option

参数#

参数名参数类型参数解释
intervaltime.Duration

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

agreeManual#

详细描述#

定义#

agreeManual(cb ...func(context.Context, *Config) (aitool.InvokeParams, error)) Option

参数#

参数名参数类型参数解释
cb...func(context.Context, *Config) (aitool.InvokeParams, error)

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

agreePolicy#

详细描述#

定义#

agreePolicy(policy AgreePolicyType) Option

参数#

参数名参数类型参数解释
policyAgreePolicyType

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

agreePolicyAI#

详细描述#

定义#

agreePolicyAI() error

返回值#

返回值(顺序)返回值类型返回值解释
r1error

agreeYOLO#

详细描述#

定义#

agreeYOLO(i ...bool) Option

参数#

参数名参数类型参数解释
i...bool

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

aiAgree#

详细描述#

定义#

aiAgree() error

返回值#

返回值(顺序)返回值类型返回值解释
r1error

aiAutoRetry#

详细描述#

定义#

aiAutoRetry(t int) Option

参数#

参数名参数类型参数解释
tint

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

aiCallback#

详细描述#

定义#

aiCallback(cb AICallbackType) Option

参数#

参数名参数类型参数解释
cbAICallbackType

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

aiToolsSearchTool#

详细描述#

定义#

aiToolsSearchTool() error

返回值#

返回值(顺序)返回值类型返回值解释
r1error

aiTransactionRetry#

详细描述#

定义#

aiTransactionRetry(t int) Option

参数#

参数名参数类型参数解释
tint

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

allowRequireForUserInteract#

详细描述#

定义#

allowRequireForUserInteract(opts ...bool) Option

参数#

参数名参数类型参数解释
opts...bool

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

appendPersistentMemory#

详细描述#

定义#

appendPersistentMemory(i ...string) Option

参数#

参数名参数类型参数解释
i...string

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

context#

详细描述#

定义#

context(ctx context.Context) AIAgentOption

参数#

参数名参数类型参数解释
ctxcontext.Context

返回值#

返回值(顺序)返回值类型返回值解释
r1AIAgentOption

coordinatorAICallback#

详细描述#

定义#

coordinatorAICallback(cb AICallbackType) Option

参数#

参数名参数类型参数解释
cbAICallbackType

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

debug#

详细描述#

定义#

debug(i ...bool) Option

参数#

参数名参数类型参数解释
i...bool

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

debugPrompt#

详细描述#

定义#

debugPrompt(i ...bool) Option

参数#

参数名参数类型参数解释
i...bool

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

disableToolUse#

详细描述#

定义#

disableToolUse(i ...bool) Option

参数#

参数名参数类型参数解释
i...bool

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

disallowRequireForUserPrompt#

详细描述#

定义#

disallowRequireForUserPrompt() error

返回值#

返回值(顺序)返回值类型返回值解释
r1error

eventHandler#

详细描述#

定义#

eventHandler(h func(e *Event)) Option

参数#

参数名参数类型参数解释
hfunc(e *Event)

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

eventInputChan#

详细描述#

定义#

eventInputChan(ch chan *InputEvent) Option

参数#

参数名参数类型参数解释
chchan *InputEvent

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

extendAIDOptions#

详细描述#

定义#

extendAIDOptions(opts ...aid.Option) AIAgentOption

参数#

参数名参数类型参数解释
opts...aid.Option

返回值#

返回值(顺序)返回值类型返回值解释
r1AIAgentOption

extendedActionCallback#

详细描述#

定义#

extendedActionCallback(name string, cb func(config *Config, action *Action)) Option

参数#

参数名参数类型参数解释
namestring
cbfunc(config *Config, action *Action)

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

forgeName#

详细描述#

定义#

forgeName(forgeName string) AIAgentOption

参数#

参数名参数类型参数解释
forgeNamestring

返回值#

返回值(顺序)返回值类型返回值解释
r1AIAgentOption

forgePlanMocker#

详细描述#

WithPlanMocker 设置AI助手的计划生成器

定义#

forgePlanMocker(plan func(config *aid.Config) *aid.PlanResponse) Option

参数#

参数名参数类型参数解释
planfunc(config *aid.Config) *aid.PlanResponse

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

forgeTools#

详细描述#

WithTools 为AI助手添加可用的工具 这些工具可以扩展AI的能力,使其能够执行特定的任务

定义#

forgeTools(tools ...*aitool.Tool) Option

参数#

参数名参数类型参数解释
tools...*aitool.Tool

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

initPrompt#

详细描述#

WithInitializePrompt 设置AI助手的初始化提示词 这个提示词会在AI助手启动时被使用,用于定义AI的初始状态和行为

定义#

initPrompt(prompt string) Option

参数#

参数名参数类型参数解释
promptstring

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

initializePrompt#

详细描述#

WithInitializePrompt 设置AI助手的初始化提示词 这个提示词会在AI助手启动时被使用,用于定义AI的初始状态和行为

定义#

initializePrompt(prompt string) Option

参数#

参数名参数类型参数解释
promptstring

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

jarOperator#

详细描述#

定义#

jarOperator() error

返回值#

返回值(顺序)返回值类型返回值解释
r1error

manualAssistantCallback#

详细描述#

定义#

manualAssistantCallback(cb func(context.Context, *Config) (aitool.InvokeParams, error)) Option

参数#

参数名参数类型参数解释
cbfunc(context.Context, *Config) (aitool.InvokeParams, error)

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

memory#

详细描述#

定义#

memory(m *Memory) Option

参数#

参数名参数类型参数解释
m*Memory

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

offsetSeq#

详细描述#

定义#

offsetSeq(seq int64) Option

参数#

参数名参数类型参数解释
seqint64

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

omniSearchTool#

详细描述#

定义#

omniSearchTool() error

返回值#

返回值(顺序)返回值类型返回值解释
r1error

originYaklangCliCode#

详细描述#

WithOriginYaklangCliCode 设置原始的Yaklang CLI代码 这个结构需要 Yak 引擎根据 CLI 代码构建出正确的用户需要输入的工具 这个结构是表单构建的核心依据,可以使用 Yak 原声插件基础设施直接构建表单

定义#

originYaklangCliCode(originYaklangCliCode string) Option

参数#

参数名参数类型参数解释
originYaklangCliCodestring

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

persistentPrompt#

详细描述#

WithPersistentPrompt 设置AI助手的持久提示词 这个提示词会在整个会话过程中持续存在,确保AI行为的一致性

定义#

persistentPrompt(persistentPrompt string) Option

参数#

参数名参数类型参数解释
persistentPromptstring

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

persistentPromptForge#

详细描述#

WithPersistentPrompt 设置AI助手的持久提示词 这个提示词会在整个会话过程中持续存在,确保AI行为的一致性

定义#

persistentPromptForge(persistentPrompt string) Option

参数#

参数名参数类型参数解释
persistentPromptstring

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

plan#

详细描述#

定义#

plan(i func(*Config) *PlanResponse) Option

参数#

参数名参数类型参数解释
ifunc(*Config) *PlanResponse

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

planAICallback#

详细描述#

定义#

planAICallback(cb AICallbackType) Option

参数#

参数名参数类型参数解释
cbAICallbackType

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

resultHandler#

详细描述#

定义#

resultHandler(h func(*Config)) Option

参数#

参数名参数类型参数解释
hfunc(*Config)

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

resultHandlerForge#

详细描述#

WithResultHandler 设置AI助手的结果处理函数 这个函数会在AI助手生成结果后被调用,用于处理AI的输出

定义#

resultHandlerForge(handler func(string, error)) Option

参数#

参数名参数类型参数解释
handlerfunc(string, error)

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

resultPrompt#

详细描述#

WithResultPrompt 设置AI助手的生成结果提示词 这个提示词会在AI助手生成结果时被使用,用于定义AI的输出格式和内容

定义#

resultPrompt(prompt string) Option

参数#

参数名参数类型参数解释
promptstring

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

resultPromptForge#

详细描述#

WithResultPrompt 设置AI助手的生成结果提示词 这个提示词会在AI助手生成结果时被使用,用于定义AI的输出格式和内容

定义#

resultPromptForge(prompt string) Option

参数#

参数名参数类型参数解释
promptstring

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

systemFileOperator#

详细描述#

定义#

systemFileOperator() error

返回值#

返回值(顺序)返回值类型返回值解释
r1error

taskAICallback#

详细描述#

定义#

taskAICallback(cb AICallbackType) Option

参数#

参数名参数类型参数解释
cbAICallbackType

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

timeLineLimit#

详细描述#

定义#

timeLineLimit(i int) Option

参数#

参数名参数类型参数解释
iint

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

timelineContentLimit#

详细描述#

定义#

timelineContentLimit(i int) Option

参数#

参数名参数类型参数解释
iint

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

tool#

详细描述#

定义#

tool(tool *aitool.Tool) Option

参数#

参数名参数类型参数解释
tool*aitool.Tool

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

toolKeywords#

详细描述#

WithToolKeywords 设置AI助手的工具关键词 这些关键词可以扩展AI的能力,使其能够执行特定的任务

定义#

toolKeywords(keywords []string) Option

参数#

参数名参数类型参数解释
keywords[]string

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

toolManager#

详细描述#

定义#

toolManager(manager *buildinaitools.AiToolManager) Option

参数#

参数名参数类型参数解释
manager*buildinaitools.AiToolManager

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

tools#

详细描述#

定义#

tools(tool ...*aitool.Tool) Option

参数#

参数名参数类型参数解释
tool...*aitool.Tool

返回值#

返回值(顺序)返回值类型返回值解释
r1Option