Skip to main content

aim

函数名函数描述/介绍
aim.InvokeReAct
aim.InvokeReActAsyncInvokeReActAsync 异步执行 ReAct 任务,并返回引擎实例
aim.NewAIEngineNewAIEngine 创建新的 AI 引擎实例
aim.aiCallbackWithAICallback 设置 AI 回调
aim.aiConfig
aim.aiReviewMode
aim.aiServiceWithAIService 设置 AI 服务
aim.allowUserInteractWithAllowUserInteract 设置是否允许用户交互
aim.contextWithContext 设置上下文
aim.debugModeWithDebugMode 设置调试模式
aim.disableAIForge
aim.disableMCPServers
aim.disableToolUseWithDisableToolUse 禁用工具调用
aim.enableAISearchToolWithEnableAISearchTool 启用 AI 搜索工具
aim.enableForgeSearchToolWithEnableForgeSearchTool 启用 Forge 搜索工具
aim.excludeToolNamesWithExcludeToolNames 设置排除的工具名称
aim.focusWithFocus 设置焦点
aim.includeToolNamesWithIncludeToolNames 设置包含的工具名称
aim.keywordsWithKeywords 设置关键词
aim.languageWithLanguage 设置响应语言
aim.manualMode
aim.maxIterationWithMaxIteration 设置最大迭代次数
aim.onDataWithOnData 设置数据回调
aim.onEventWithOnEvent 设置事件回调
aim.onFinishedWithOnFinished 设置完成回调
aim.onInputRequiredWithOnInputRequired 设置需要用户输入回调
aim.onInputRequiredRawWithOnInputRequiredRaw 设置需要用户输入回调
aim.onStreamWithOnStream 设置流式输出回调
aim.onStreamEndWithOnStreamEnd 设置流式输出结束回调
aim.reviewPolicyWithReviewPolicy 设置审批策略 policy: "yolo" (自动通过), "ai" (AI 审批), "manual" (手动审批)
aim.sessionIDWithSessionID 设置会话 ID
aim.timelineContentLimitWithTimelineContentLimit 设置 Timeline 内容大小限制
aim.timeout
aim.userInteractLimitWithUserInteractLimit 设置用户交互次数限制
aim.workdirWithWorkdir 设置工作目录
aim.yoloMode

函数定义#

InvokeReAct#

详细描述#

定义#

InvokeReAct(input string, options ...AIEngineConfigOption) error

参数#

参数名参数类型参数解释
inputstring
options...AIEngineConfigOption

返回值#

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

InvokeReActAsync#

详细描述#

InvokeReActAsync 异步执行 ReAct 任务,并返回引擎实例

定义#

InvokeReActAsync(input string, options ...AIEngineConfigOption) (*AIEngine, error)

参数#

参数名参数类型参数解释
inputstring
options...AIEngineConfigOption

返回值#

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

NewAIEngine#

详细描述#

NewAIEngine 创建新的 AI 引擎实例

定义#

NewAIEngine(options ...AIEngineConfigOption) (*AIEngine, error)

参数#

参数名参数类型参数解释
options...AIEngineConfigOption

返回值#

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

aiCallback#

详细描述#

WithAICallback 设置 AI 回调

定义#

aiCallback(callback aicommon.AICallbackType) AIEngineConfigOption

参数#

参数名参数类型参数解释
callbackaicommon.AICallbackType

返回值#

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

aiConfig#

详细描述#

定义#

aiConfig(typeName string, opts ...aispec.AIConfigOption) AIEngineConfigOption

参数#

参数名参数类型参数解释
typeNamestring
opts...aispec.AIConfigOption

返回值#

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

aiReviewMode#

详细描述#

定义#

aiReviewMode()

aiService#

详细描述#

WithAIService 设置 AI 服务

定义#

aiService(service string) AIEngineConfigOption

参数#

参数名参数类型参数解释
servicestring

返回值#

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

allowUserInteract#

详细描述#

WithAllowUserInteract 设置是否允许用户交互

定义#

allowUserInteract(allow bool) AIEngineConfigOption

参数#

参数名参数类型参数解释
allowbool

返回值#

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

context#

详细描述#

WithContext 设置上下文

定义#

context(ctx context.Context) AIEngineConfigOption

参数#

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

返回值#

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

debugMode#

详细描述#

WithDebugMode 设置调试模式

定义#

debugMode(debug bool) AIEngineConfigOption

参数#

参数名参数类型参数解释
debugbool

返回值#

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

disableAIForge#

详细描述#

定义#

disableAIForge(disable bool) AIEngineConfigOption

参数#

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

返回值#

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

disableMCPServers#

详细描述#

定义#

disableMCPServers(disable bool) AIEngineConfigOption

参数#

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

返回值#

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

disableToolUse#

详细描述#

WithDisableToolUse 禁用工具调用

定义#

disableToolUse(disable bool) AIEngineConfigOption

参数#

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

返回值#

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

enableAISearchTool#

详细描述#

WithEnableAISearchTool 启用 AI 搜索工具

定义#

enableAISearchTool(enable bool) AIEngineConfigOption

参数#

参数名参数类型参数解释
enablebool

返回值#

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

enableForgeSearchTool#

详细描述#

WithEnableForgeSearchTool 启用 Forge 搜索工具

定义#

enableForgeSearchTool(enable bool) AIEngineConfigOption

参数#

参数名参数类型参数解释
enablebool

返回值#

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

excludeToolNames#

详细描述#

WithExcludeToolNames 设置排除的工具名称

定义#

excludeToolNames(names ...string) AIEngineConfigOption

参数#

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

返回值#

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

focus#

详细描述#

WithFocus 设置焦点

定义#

focus(focus string) AIEngineConfigOption

参数#

参数名参数类型参数解释
focusstring

返回值#

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

includeToolNames#

详细描述#

WithIncludeToolNames 设置包含的工具名称

定义#

includeToolNames(names ...string) AIEngineConfigOption

参数#

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

返回值#

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

keywords#

详细描述#

WithKeywords 设置关键词

定义#

keywords(keywords ...string) AIEngineConfigOption

参数#

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

返回值#

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

language#

详细描述#

WithLanguage 设置响应语言

定义#

language(lang string) AIEngineConfigOption

参数#

参数名参数类型参数解释
langstring

返回值#

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

manualMode#

详细描述#

定义#

manualMode()

maxIteration#

详细描述#

WithMaxIteration 设置最大迭代次数

定义#

maxIteration(max int) AIEngineConfigOption

参数#

参数名参数类型参数解释
maxint

返回值#

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

onData#

详细描述#

WithOnData 设置数据回调

定义#

onData(callback func(react aicommon.AIEngineOperator, event *schema.AiOutputEvent, NodeId string, data []byte)) AIEngineConfigOption

参数#

参数名参数类型参数解释
callbackfunc(react aicommon.AIEngineOperator, event *schema.AiOutputEvent, NodeId string, data []byte)

返回值#

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

onEvent#

详细描述#

WithOnEvent 设置事件回调

定义#

onEvent(callback func(aicommon.AIEngineOperator, *schema.AiOutputEvent)) AIEngineConfigOption

参数#

参数名参数类型参数解释
callbackfunc(aicommon.AIEngineOperator, *schema.AiOutputEvent)

返回值#

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

onFinished#

详细描述#

WithOnFinished 设置完成回调

定义#

onFinished(callback func(react aicommon.AIEngineOperator)) AIEngineConfigOption

参数#

参数名参数类型参数解释
callbackfunc(react aicommon.AIEngineOperator)

返回值#

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

onInputRequired#

详细描述#

WithOnInputRequired 设置需要用户输入回调

定义#

onInputRequired(callback func(react aicommon.AIEngineOperator, question string) string) AIEngineConfigOption

参数#

参数名参数类型参数解释
callbackfunc(react aicommon.AIEngineOperator, question string) string

返回值#

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

onInputRequiredRaw#

详细描述#

WithOnInputRequiredRaw 设置需要用户输入回调

定义#

onInputRequiredRaw(callback func(react aicommon.AIEngineOperator, event *schema.AiOutputEvent, question string) string) AIEngineConfigOption

参数#

参数名参数类型参数解释
callbackfunc(react aicommon.AIEngineOperator, event *schema.AiOutputEvent, question string) string

返回值#

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

onStream#

详细描述#

WithOnStream 设置流式输出回调

定义#

onStream(callback func(react aicommon.AIEngineOperator, event *schema.AiOutputEvent, NodeId string, data []byte)) AIEngineConfigOption

参数#

参数名参数类型参数解释
callbackfunc(react aicommon.AIEngineOperator, event *schema.AiOutputEvent, NodeId string, data []byte)

返回值#

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

onStreamEnd#

详细描述#

WithOnStreamEnd 设置流式输出结束回调

定义#

onStreamEnd(callback func(react aicommon.AIEngineOperator, event *schema.AiOutputEvent, NodeId string)) AIEngineConfigOption

参数#

参数名参数类型参数解释
callbackfunc(react aicommon.AIEngineOperator, event *schema.AiOutputEvent, NodeId string)

返回值#

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

reviewPolicy#

详细描述#

WithReviewPolicy 设置审批策略 policy: "yolo" (自动通过), "ai" (AI 审批), "manual" (手动审批)

定义#

reviewPolicy(policy string) AIEngineConfigOption

参数#

参数名参数类型参数解释
policystring

返回值#

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

sessionID#

详细描述#

WithSessionID 设置会话 ID

定义#

sessionID(sessionID string) AIEngineConfigOption

参数#

参数名参数类型参数解释
sessionIDstring

返回值#

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

timelineContentLimit#

详细描述#

WithTimelineContentLimit 设置 Timeline 内容大小限制

定义#

timelineContentLimit(limit int) AIEngineConfigOption

参数#

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

返回值#

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

timeout#

详细描述#

定义#

timeout(timeout float64) AIEngineConfigOption

参数#

参数名参数类型参数解释
timeoutfloat64

返回值#

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

userInteractLimit#

详细描述#

WithUserInteractLimit 设置用户交互次数限制

定义#

userInteractLimit(limit int64) AIEngineConfigOption

参数#

参数名参数类型参数解释
limitint64

返回值#

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

workdir#

详细描述#

WithWorkdir 设置工作目录

定义#

workdir(workdir string) AIEngineConfigOption

参数#

参数名参数类型参数解释
workdirstring

返回值#

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

yoloMode#

详细描述#

定义#

yoloMode()