函数定义#
AllYakScriptAiTools#
详细描述#
AllYakScriptAiTools() []*aitool.Tool
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | []*aitool.Tool | |
CreateForge#
详细描述#
CreateForge(name string, opts ...any) *aiforge.ForgeBlueprint
| 参数名 | 参数类型 | 参数解释 |
|---|
| name | string | |
| opts | ...any | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | *aiforge.ForgeBlueprint | |
CreateLiteForge#
详细描述#
CreateLiteForge(name string, opts ...any) (*aiforge.LiteForge, error)
| 参数名 | 参数类型 | 参数解释 |
|---|
| name | string | |
| opts | ...any | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | *aiforge.LiteForge | |
| r2 | error | |
ExecuteForge#
详细描述#
ExecuteForge(forgeName string, i any, iopts ...any) (any, error)
| 参数名 | 参数类型 | 参数解释 |
|---|
| forgeName | string | |
| i | any | |
| iopts | ...any | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | any | |
| r2 | error | |
ExtractAction#
详细描述#
ExtractAction 从字符串中提取指定的 Action 对象,支持别名,这里隐含一个强校验行为,即会等待处理完毕之后检查是否有可用的Action
ExtractAction(i string, actionName string, alias ...string) (*Action, error)
| 参数名 | 参数类型 | 参数解释 |
|---|
| i | string | |
| actionName | string | |
| alias | ...string | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | *Action | |
| r2 | error | |
ExtractPlan#
详细描述#
ExtractPlan(c *Coordinator, rawResponse string) (*PlanResponse, error)
| 参数名 | 参数类型 | 参数解释 |
|---|
| c | *Coordinator | |
| rawResponse | string | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | *PlanResponse | |
| r2 | error | |
GetDefaultContextProvider#
详细描述#
GetDefaultContextProvider() *PromptContextProvider
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | *PromptContextProvider | |
NewExecutor#
详细描述#
NewExecutor(name string, i any, opts ...any) (*aid.Coordinator, error)
| 参数名 | 参数类型 | 参数解释 |
|---|
| name | string | |
| i | any | |
| opts | ...any | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | *aid.Coordinator | |
| r2 | error | |
NewExecutorFromJson#
详细描述#
NewExecutorFromJson(json string, i any, opts ...any) (*aid.Coordinator, error)
| 参数名 | 参数类型 | 参数解释 |
|---|
| json | string | |
| i | any | |
| opts | ...any | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | *aid.Coordinator | |
| r2 | error | |
ParseYakScriptToAiTools#
详细描述#
ParseYakScriptToAiTools(name string, content string) *schema.AIYakTool
| 参数名 | 参数类型 | 参数解释 |
|---|
| name | string | |
| content | string | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | *schema.AIYakTool | |
UpdateYakScriptMetaData#
详细描述#
UpdateYakScriptMetaData(name string, content string, forceUpdate bool) (string, *metadata.YakScriptMetadata, error)
| 参数名 | 参数类型 | 参数解释 |
|---|
| name | string | |
| content | string | |
| forceUpdate | bool | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | string | |
| r2 | *metadata.YakScriptMetadata | |
| r3 | error | |
agreeAuto#
详细描述#
agreeAuto() error
返回值#
agreeManual#
详细描述#
agreeManual() error
返回值#
agreePolicy#
详细描述#
agreePolicy(p AgreePolicyType) ConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| p | AgreePolicyType | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | ConfigOption | |
agreePolicyAI#
详细描述#
agreePolicyAI() error
返回值#
agreeYOLO#
详细描述#
agreeYOLO(b ...bool) ConfigOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | ConfigOption | |
aiAutoRetry#
详细描述#
WithAIAutoRetry sets AiAutoRetry count.
aiAutoRetry(n int64) ConfigOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | ConfigOption | |
aiCallback#
详细描述#
Callback setters
aiCallback(cb AICallbackType) ConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| cb | AICallbackType | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | ConfigOption | |
aiTransactionRetry#
详细描述#
WithAITransactionRetry alias to existing WithAITransactionAutoRetry for naming compatibility.
aiTransactionRetry(n int64) ConfigOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | ConfigOption | |
allowRequireForUserInteract#
详细描述#
Interactive / review / require_user
allowRequireForUserInteract(v bool) ConfigOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | ConfigOption | |
appendPersistentMemory#
详细描述#
WithAppendPersistentMemory appends keys to PersistentMemory.
appendPersistentMemory(keys ...string) ConfigOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | ConfigOption | |
context#
详细描述#
context(ctx context.Context) AIAgentOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| ctx | context.Context | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIAgentOption | |
coordinatorAICallback#
详细描述#
coordinatorAICallback(cb AICallbackType) ConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| cb | AICallbackType | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | ConfigOption | |
debug#
详细描述#
WithDebug toggles both prompt and event debug flags.
debug(v bool) ConfigOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | ConfigOption | |
debugPrompt#
详细描述#
Debug flags
debugPrompt(v ...bool) ConfigOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | ConfigOption | |
disableOutputType#
详细描述#
WithDisableOutputEvent is a name-compatible wrapper for disabling output event types.
disableOutputType(types ...string) ConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| types | ...string | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | ConfigOption | |
disableToolUse#
详细描述#
disableToolUse(disable bool) ConfigOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | ConfigOption | |
disallowRequireForUserPrompt#
详细描述#
WithDisallowRequireForUserPrompt disables require-for-user-interact.
disallowRequireForUserPrompt() ConfigOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | ConfigOption | |
extendAIDOptions#
详细描述#
extendAIDOptions(opts ...aicommon.ConfigOption) AIAgentOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| opts | ...aicommon.ConfigOption | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIAgentOption | |
extendedActionCallback#
详细描述#
WithExtendedActionCallback sets the ExtendedActionCallback map.
extendedActionCallback(name string, callback func(config *Config, action *Action)) ConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| name | string | |
| callback | func(config *Config, action *Action) | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | ConfigOption | |
forgeName#
详细描述#
forgeName(forgeName string) AIAgentOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| forgeName | string | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIAgentOption | |
forgePlanMocker#
详细描述#
WithPlanMocker 设置AI助手的计划生成器
forgePlanMocker(plan func(config *aid.Coordinator) *aid.PlanResponse) Option
| 参数名 | 参数类型 | 参数解释 |
|---|
| plan | func(config *aid.Coordinator) *aid.PlanResponse | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | Option | |
forgeTools#
详细描述#
WithTools 为AI助手添加可用的工具
这些工具可以扩展AI的能力,使其能够执行特定的任务
forgeTools(tools ...*aitool.Tool) Option
| 参数名 | 参数类型 | 参数解释 |
|---|
| tools | ...*aitool.Tool | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | Option | |
initPrompt#
详细描述#
WithInitializePrompt 设置AI助手的初始化提示词
这个提示词会在AI助手启动时被使用,用于定义AI的初始状态和行为
initPrompt(prompt string) Option
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | Option | |
initializePrompt#
详细描述#
WithInitializePrompt 设置AI助手的初始化提示词
这个提示词会在AI助手启动时被使用,用于定义AI的初始状态和行为
initializePrompt(prompt string) Option
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | Option | |
liteForgeOutputSchema#
详细描述#
liteForgeOutputSchema(params ...aitool.ToolOption) LiteForgeOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| params | ...aitool.ToolOption | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | LiteForgeOption | |
liteForgeOutputSchemaRaw#
详细描述#
liteForgeOutputSchemaRaw(actionName string, outputSchema string) LiteForgeOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| actionName | string | |
| outputSchema | string | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | LiteForgeOption | |
liteForgePrompt#
详细描述#
liteForgePrompt(i string) LiteForgeOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | LiteForgeOption | |
liteForgedRequireParams#
详细描述#
liteForgedRequireParams(params ...aitool.ToolOption) LiteForgeOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| params | ...aitool.ToolOption | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | LiteForgeOption | |
manualAssistantCallback#
详细描述#
WithManualAssistantCallback is an alias to the agree/manual callback setter.
manualAssistantCallback(cb func(context.Context, *Config) (aitool.InvokeParams, error)) ConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| cb | func(context.Context, *Config) (aitool.InvokeParams, error) | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | ConfigOption | |
offsetSeq#
详细描述#
WithSequence sets the starting sequence/id and installs a simple id generator that increments it.
offsetSeq(seq int64) ConfigOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | ConfigOption | |
omniSearchTool#
详细描述#
omniSearchTool() error
返回值#
originYaklangCliCode#
详细描述#
WithOriginYaklangCliCode 设置原始的Yaklang CLI代码
这个结构需要 Yak 引擎根据 CLI 代码构建出正确的用户需要输入的工具
这个结构是表单构建的核心依据,可以使用 Yak 原声插件基础设施直接构建表单
originYaklangCliCode(originYaklangCliCode string) Option
| 参数名 | 参数类型 | 参数解释 |
|---|
| originYaklangCliCode | string | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | Option | |
persistentPrompt#
详细描述#
WithPersistentPrompt 设置AI助手的持久提示词
这个提示词会在整个会话过程中持续存在,确保AI行为的一致性
persistentPrompt(persistentPrompt string) Option
| 参数名 | 参数类型 | 参数解释 |
|---|
| persistentPrompt | string | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | Option | |
persistentPromptForge#
详细描述#
WithPersistentPrompt 设置AI助手的持久提示词
这个提示词会在整个会话过程中持续存在,确保AI行为的一致性
persistentPromptForge(persistentPrompt string) Option
| 参数名 | 参数类型 | 参数解释 |
|---|
| persistentPrompt | string | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | Option | |
plan#
详细描述#
plan(i func(coordinator *Coordinator) *PlanResponse) aicommon.ConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| i | func(coordinator *Coordinator) *PlanResponse | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | aicommon.ConfigOption | |
planAICallback#
详细描述#
planAICallback(cb AICallbackType) ConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| cb | AICallbackType | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | ConfigOption | |
resultHandler#
详细描述#
cycle import issue
resultHandler(h func(c *Coordinator)) aicommon.ConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| h | func(c *Coordinator) | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | aicommon.ConfigOption | |
resultHandlerForge#
详细描述#
WithResultHandler 设置AI助手的结果处理函数
这个函数会在AI助手生成结果后被调用,用于处理AI的输出
resultHandlerForge(handler func(string, error)) Option
| 参数名 | 参数类型 | 参数解释 |
|---|
| handler | func(string, error) | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | Option | |
resultPrompt#
详细描述#
WithResultPrompt 设置AI助手的生成结果提示词
这个提示词会在AI助手生成结果时被使用,用于定义AI的输出格式和内容
resultPrompt(prompt string) Option
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | Option | |
resultPromptForge#
详细描述#
WithResultPrompt 设置AI助手的生成结果提示词
这个提示词会在AI助手生成结果时被使用,用于定义AI的输出格式和内容
resultPromptForge(prompt string) Option
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | Option | |
systemFileOperator#
详细描述#
systemFileOperator() error
返回值#
taskAICallback#
详细描述#
taskAICallback(cb AICallbackType) ConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| cb | AICallbackType | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | ConfigOption | |
timelineContentLimit#
详细描述#
WithTimelineContentLimit sets timeline content size limit (keeps naming parity).
timelineContentLimit(limit int) ConfigOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | ConfigOption | |
tool#
详细描述#
WithTool is a convenience wrapper to add a single tool (delegates to WithTools).
tool(tool *aitool.Tool) ConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| tool | *aitool.Tool | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | ConfigOption | |
toolKeywords#
详细描述#
WithToolKeywords 设置AI助手的工具关键词
这些关键词可以扩展AI的能力,使其能够执行特定的任务
toolKeywords(keywords []string) Option
| 参数名 | 参数类型 | 参数解释 |
|---|
| keywords | []string | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | Option | |
tools#
详细描述#
tools(tool ...*aitool.Tool) ConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| tool | ...*aitool.Tool | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | ConfigOption | |