Skip to main content

aiagent

函数名函数描述/介绍
aiagent.AllYakScriptAiTools
aiagent.CreateForge
aiagent.CreateLiteForge
aiagent.ExecuteForge
aiagent.ExtractActionExtractAction 从字符串中提取指定的 Action 对象,支持别名,这里隐含一个强校验行为,即会等待处理完毕之后检查是否有可用的Action
aiagent.ExtractPlan
aiagent.GetDefaultContextProvider
aiagent.NewExecutor
aiagent.NewExecutorFromJson
aiagent.ParseYakScriptToAiTools
aiagent.UpdateYakScriptMetaData
aiagent.agreeAuto
aiagent.agreeManual
aiagent.agreePolicy
aiagent.agreePolicyAI
aiagent.agreeYOLO
aiagent.aiAutoRetryWithAIAutoRetry sets AiAutoRetry count.
aiagent.aiCallbackCallback setters
aiagent.aiTransactionRetryWithAITransactionRetry alias to existing WithAITransactionAutoRetry for naming compatibility.
aiagent.allowRequireForUserInteractInteractive / review / require_user
aiagent.appendPersistentMemoryWithAppendPersistentMemory appends keys to PersistentMemory.
aiagent.context
aiagent.coordinatorAICallback
aiagent.debugWithDebug toggles both prompt and event debug flags.
aiagent.debugPromptDebug flags
aiagent.disableOutputTypeWithDisableOutputEvent is a name-compatible wrapper for disabling output event types.
aiagent.disableToolUse
aiagent.disallowRequireForUserPromptWithDisallowRequireForUserPrompt disables require-for-user-interact.
aiagent.extendAIDOptions
aiagent.extendedActionCallbackWithExtendedActionCallback sets the ExtendedActionCallback map.
aiagent.forgeName
aiagent.forgePlanMockerWithPlanMocker 设置AI助手的计划生成器
aiagent.forgeToolsWithTools 为AI助手添加可用的工具 这些工具可以扩展AI的能力,使其能够执行特定的任务
aiagent.initPromptWithInitializePrompt 设置AI助手的初始化提示词 这个提示词会在AI助手启动时被使用,用于定义AI的初始状态和行为
aiagent.initializePromptWithInitializePrompt 设置AI助手的初始化提示词 这个提示词会在AI助手启动时被使用,用于定义AI的初始状态和行为
aiagent.liteForgeOutputSchema
aiagent.liteForgeOutputSchemaRaw
aiagent.liteForgePrompt
aiagent.liteForgedRequireParams
aiagent.manualAssistantCallbackWithManualAssistantCallback is an alias to the agree/manual callback setter.
aiagent.offsetSeqWithSequence sets the starting sequence/id and installs a simple id generator that increments it.
aiagent.omniSearchTool
aiagent.originYaklangCliCodeWithOriginYaklangCliCode 设置原始的Yaklang CLI代码 这个结构需要 Yak 引擎根据 CLI 代码构建出正确的用户需要输入的工具 这个结构是表单构建的核心依据,可以使用 Yak 原声插件基础设施直接构建表单
aiagent.persistentPromptWithPersistentPrompt 设置AI助手的持久提示词 这个提示词会在整个会话过程中持续存在,确保AI行为的一致性
aiagent.persistentPromptForgeWithPersistentPrompt 设置AI助手的持久提示词 这个提示词会在整个会话过程中持续存在,确保AI行为的一致性
aiagent.plan
aiagent.planAICallback
aiagent.resultHandlercycle import issue
aiagent.resultHandlerForgeWithResultHandler 设置AI助手的结果处理函数 这个函数会在AI助手生成结果后被调用,用于处理AI的输出
aiagent.resultPromptWithResultPrompt 设置AI助手的生成结果提示词 这个提示词会在AI助手生成结果时被使用,用于定义AI的输出格式和内容
aiagent.resultPromptForgeWithResultPrompt 设置AI助手的生成结果提示词 这个提示词会在AI助手生成结果时被使用,用于定义AI的输出格式和内容
aiagent.systemFileOperator
aiagent.taskAICallback
aiagent.timelineContentLimitWithTimelineContentLimit sets timeline content size limit (keeps naming parity).
aiagent.toolWithTool is a convenience wrapper to add a single tool (delegates to WithTools).
aiagent.toolKeywordsWithToolKeywords 设置AI助手的工具关键词 这些关键词可以扩展AI的能力,使其能够执行特定的任务
aiagent.tools

函数定义#

AllYakScriptAiTools#

详细描述#

定义#

AllYakScriptAiTools() []*aitool.Tool

返回值#

返回值(顺序)返回值类型返回值解释
r1[]*aitool.Tool

CreateForge#

详细描述#

定义#

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

参数#

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

返回值#

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

CreateLiteForge#

详细描述#

定义#

CreateLiteForge(name string, opts ...any) (*aiforge.LiteForge, error)

参数#

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

返回值#

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

ExecuteForge#

详细描述#

定义#

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

参数#

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

返回值#

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

ExtractAction#

详细描述#

ExtractAction 从字符串中提取指定的 Action 对象,支持别名,这里隐含一个强校验行为,即会等待处理完毕之后检查是否有可用的Action

定义#

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

参数#

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

返回值#

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

ExtractPlan#

详细描述#

定义#

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

参数#

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

返回值#

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

GetDefaultContextProvider#

详细描述#

定义#

GetDefaultContextProvider() *PromptContextProvider

返回值#

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

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

ParseYakScriptToAiTools#

详细描述#

定义#

ParseYakScriptToAiTools(name string, content string) *schema.AIYakTool

参数#

参数名参数类型参数解释
namestring
contentstring

返回值#

返回值(顺序)返回值类型返回值解释
r1*schema.AIYakTool

UpdateYakScriptMetaData#

详细描述#

定义#

UpdateYakScriptMetaData(name string, content string, forceUpdate bool) (string, *metadata.YakScriptMetadata, error)

参数#

参数名参数类型参数解释
namestring
contentstring
forceUpdatebool

返回值#

返回值(顺序)返回值类型返回值解释
r1string
r2*metadata.YakScriptMetadata
r3error

agreeAuto#

详细描述#

定义#

agreeAuto() error

返回值#

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

agreeManual#

详细描述#

定义#

agreeManual() error

返回值#

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

agreePolicy#

详细描述#

定义#

agreePolicy(p AgreePolicyType) ConfigOption

参数#

参数名参数类型参数解释
pAgreePolicyType

返回值#

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

agreePolicyAI#

详细描述#

定义#

agreePolicyAI() error

返回值#

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

agreeYOLO#

详细描述#

定义#

agreeYOLO(b ...bool) ConfigOption

参数#

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

返回值#

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

aiAutoRetry#

详细描述#

WithAIAutoRetry sets AiAutoRetry count.

定义#

aiAutoRetry(n int64) ConfigOption

参数#

参数名参数类型参数解释
nint64

返回值#

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

aiCallback#

详细描述#

Callback setters

定义#

aiCallback(cb AICallbackType) ConfigOption

参数#

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

返回值#

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

aiTransactionRetry#

详细描述#

WithAITransactionRetry alias to existing WithAITransactionAutoRetry for naming compatibility.

定义#

aiTransactionRetry(n int64) ConfigOption

参数#

参数名参数类型参数解释
nint64

返回值#

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

allowRequireForUserInteract#

详细描述#

Interactive / review / require_user

定义#

allowRequireForUserInteract(v bool) ConfigOption

参数#

参数名参数类型参数解释
vbool

返回值#

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

appendPersistentMemory#

详细描述#

WithAppendPersistentMemory appends keys to PersistentMemory.

定义#

appendPersistentMemory(keys ...string) ConfigOption

参数#

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

返回值#

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

context#

详细描述#

定义#

context(ctx context.Context) AIAgentOption

参数#

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

返回值#

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

coordinatorAICallback#

详细描述#

定义#

coordinatorAICallback(cb AICallbackType) ConfigOption

参数#

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

返回值#

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

debug#

详细描述#

WithDebug toggles both prompt and event debug flags.

定义#

debug(v bool) ConfigOption

参数#

参数名参数类型参数解释
vbool

返回值#

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

debugPrompt#

详细描述#

Debug flags

定义#

debugPrompt(v ...bool) ConfigOption

参数#

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

返回值#

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

disableOutputType#

详细描述#

WithDisableOutputEvent is a name-compatible wrapper for disabling output event types.

定义#

disableOutputType(types ...string) ConfigOption

参数#

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

返回值#

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

disableToolUse#

详细描述#

定义#

disableToolUse(disable bool) ConfigOption

参数#

参数名参数类型参数解释
disablebool

返回值#

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

disallowRequireForUserPrompt#

详细描述#

WithDisallowRequireForUserPrompt disables require-for-user-interact.

定义#

disallowRequireForUserPrompt() ConfigOption

返回值#

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

extendAIDOptions#

详细描述#

定义#

extendAIDOptions(opts ...aicommon.ConfigOption) AIAgentOption

参数#

参数名参数类型参数解释
opts...aicommon.ConfigOption

返回值#

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

extendedActionCallback#

详细描述#

WithExtendedActionCallback sets the ExtendedActionCallback map.

定义#

extendedActionCallback(name string, callback func(config *Config, action *Action)) ConfigOption

参数#

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

返回值#

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

forgeName#

详细描述#

定义#

forgeName(forgeName string) AIAgentOption

参数#

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

返回值#

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

forgePlanMocker#

详细描述#

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

定义#

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

参数#

参数名参数类型参数解释
planfunc(config *aid.Coordinator) *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

liteForgeOutputSchema#

详细描述#

定义#

liteForgeOutputSchema(params ...aitool.ToolOption) LiteForgeOption

参数#

参数名参数类型参数解释
params...aitool.ToolOption

返回值#

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

liteForgeOutputSchemaRaw#

详细描述#

定义#

liteForgeOutputSchemaRaw(actionName string, outputSchema string) LiteForgeOption

参数#

参数名参数类型参数解释
actionNamestring
outputSchemastring

返回值#

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

liteForgePrompt#

详细描述#

定义#

liteForgePrompt(i string) LiteForgeOption

参数#

参数名参数类型参数解释
istring

返回值#

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

liteForgedRequireParams#

详细描述#

定义#

liteForgedRequireParams(params ...aitool.ToolOption) LiteForgeOption

参数#

参数名参数类型参数解释
params...aitool.ToolOption

返回值#

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

manualAssistantCallback#

详细描述#

WithManualAssistantCallback is an alias to the agree/manual callback setter.

定义#

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

参数#

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

返回值#

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

offsetSeq#

详细描述#

WithSequence sets the starting sequence/id and installs a simple id generator that increments it.

定义#

offsetSeq(seq int64) ConfigOption

参数#

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

返回值#

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

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(coordinator *Coordinator) *PlanResponse) aicommon.ConfigOption

参数#

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

返回值#

返回值(顺序)返回值类型返回值解释
r1aicommon.ConfigOption

planAICallback#

详细描述#

定义#

planAICallback(cb AICallbackType) ConfigOption

参数#

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

返回值#

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

resultHandler#

详细描述#

cycle import issue

定义#

resultHandler(h func(c *Coordinator)) aicommon.ConfigOption

参数#

参数名参数类型参数解释
hfunc(c *Coordinator)

返回值#

返回值(顺序)返回值类型返回值解释
r1aicommon.ConfigOption

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) ConfigOption

参数#

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

返回值#

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

timelineContentLimit#

详细描述#

WithTimelineContentLimit sets timeline content size limit (keeps naming parity).

定义#

timelineContentLimit(limit int) ConfigOption

参数#

参数名参数类型参数解释
limitint

返回值#

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

tool#

详细描述#

WithTool is a convenience wrapper to add a single tool (delegates to WithTools).

定义#

tool(tool *aitool.Tool) ConfigOption

参数#

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

返回值#

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

toolKeywords#

详细描述#

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

定义#

toolKeywords(keywords []string) Option

参数#

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

返回值#

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

tools#

详细描述#

定义#

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

参数#

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

返回值#

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