函数定义#
InvokeReAct#
详细描述#
InvokeReAct(input string, options ...AIEngineConfigOption) error
| 参数名 | 参数类型 | 参数解释 |
|---|
| input | string | |
| options | ...AIEngineConfigOption | |
返回值#
InvokeReActAsync#
详细描述#
InvokeReActAsync 异步执行 ReAct 任务,并返回引擎实例
InvokeReActAsync(input string, options ...AIEngineConfigOption) (*AIEngine, error)
| 参数名 | 参数类型 | 参数解释 |
|---|
| input | string | |
| options | ...AIEngineConfigOption | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | *AIEngine | |
| r2 | error | |
NewAIEngine#
详细描述#
NewAIEngine 创建新的 AI 引擎实例
NewAIEngine(options ...AIEngineConfigOption) (*AIEngine, error)
| 参数名 | 参数类型 | 参数解释 |
|---|
| options | ...AIEngineConfigOption | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | *AIEngine | |
| r2 | error | |
aiCallback#
详细描述#
WithAICallback 设置 AI 回调
aiCallback(callback aicommon.AICallbackType) AIEngineConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| callback | aicommon.AICallbackType | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
aiConfig#
详细描述#
aiConfig(typeName string, opts ...aispec.AIConfigOption) AIEngineConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| typeName | string | |
| opts | ...aispec.AIConfigOption | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
aiReviewMode#
详细描述#
aiReviewMode()
aiService#
详细描述#
WithAIService 设置 AI 服务
aiService(service string) AIEngineConfigOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
allowUserInteract#
详细描述#
WithAllowUserInteract 设置是否允许用户交互
allowUserInteract(allow bool) AIEngineConfigOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
context#
详细描述#
WithContext 设置上下文
context(ctx context.Context) AIEngineConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| ctx | context.Context | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
debugMode#
详细描述#
WithDebugMode 设置调试模式
debugMode(debug bool) AIEngineConfigOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
disableAIForge#
详细描述#
disableAIForge(disable bool) AIEngineConfigOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
disableMCPServers#
详细描述#
disableMCPServers(disable bool) AIEngineConfigOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
disableToolUse#
详细描述#
WithDisableToolUse 禁用工具调用
disableToolUse(disable bool) AIEngineConfigOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
enableAISearchTool#
详细描述#
WithEnableAISearchTool 启用 AI 搜索工具
enableAISearchTool(enable bool) AIEngineConfigOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
enableForgeSearchTool#
详细描述#
WithEnableForgeSearchTool 启用 Forge 搜索工具
enableForgeSearchTool(enable bool) AIEngineConfigOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
excludeToolNames#
详细描述#
WithExcludeToolNames 设置排除的工具名称
excludeToolNames(names ...string) AIEngineConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| names | ...string | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
focus#
详细描述#
WithFocus 设置焦点
focus(focus string) AIEngineConfigOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
includeToolNames#
详细描述#
WithIncludeToolNames 设置包含的工具名称
includeToolNames(names ...string) AIEngineConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| names | ...string | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
keywords#
详细描述#
WithKeywords 设置关键词
keywords(keywords ...string) AIEngineConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| keywords | ...string | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
language#
详细描述#
WithLanguage 设置响应语言
language(lang string) AIEngineConfigOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
manualMode#
详细描述#
manualMode()
maxIteration#
详细描述#
WithMaxIteration 设置最大迭代次数
maxIteration(max int) AIEngineConfigOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
onData#
详细描述#
WithOnData 设置数据回调
onData(callback func(react aicommon.AIEngineOperator, event *schema.AiOutputEvent, NodeId string, data []byte)) AIEngineConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| callback | func(react aicommon.AIEngineOperator, event *schema.AiOutputEvent, NodeId string, data []byte) | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
onEvent#
详细描述#
WithOnEvent 设置事件回调
onEvent(callback func(aicommon.AIEngineOperator, *schema.AiOutputEvent)) AIEngineConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| callback | func(aicommon.AIEngineOperator, *schema.AiOutputEvent) | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
onFinished#
详细描述#
WithOnFinished 设置完成回调
onFinished(callback func(react aicommon.AIEngineOperator)) AIEngineConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| callback | func(react aicommon.AIEngineOperator) | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
onInputRequired#
详细描述#
WithOnInputRequired 设置需要用户输入回调
onInputRequired(callback func(react aicommon.AIEngineOperator, question string) string) AIEngineConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| callback | func(react aicommon.AIEngineOperator, question string) string | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
onInputRequiredRaw#
详细描述#
WithOnInputRequiredRaw 设置需要用户输入回调
onInputRequiredRaw(callback func(react aicommon.AIEngineOperator, event *schema.AiOutputEvent, question string) string) AIEngineConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| callback | func(react aicommon.AIEngineOperator, event *schema.AiOutputEvent, question string) string | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
onStream#
详细描述#
WithOnStream 设置流式输出回调
onStream(callback func(react aicommon.AIEngineOperator, event *schema.AiOutputEvent, NodeId string, data []byte)) AIEngineConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| callback | func(react aicommon.AIEngineOperator, event *schema.AiOutputEvent, NodeId string, data []byte) | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
onStreamEnd#
详细描述#
WithOnStreamEnd 设置流式输出结束回调
onStreamEnd(callback func(react aicommon.AIEngineOperator, event *schema.AiOutputEvent, NodeId string)) AIEngineConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| callback | func(react aicommon.AIEngineOperator, event *schema.AiOutputEvent, NodeId string) | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
reviewPolicy#
详细描述#
WithReviewPolicy 设置审批策略
policy: "yolo" (自动通过), "ai" (AI 审批), "manual" (手动审批)
reviewPolicy(policy string) AIEngineConfigOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
sessionID#
详细描述#
WithSessionID 设置会话 ID
sessionID(sessionID string) AIEngineConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| sessionID | string | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
timelineContentLimit#
详细描述#
WithTimelineContentLimit 设置 Timeline 内容大小限制
timelineContentLimit(limit int) AIEngineConfigOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
timeout#
详细描述#
timeout(timeout float64) AIEngineConfigOption
| 参数名 | 参数类型 | 参数解释 |
|---|
| timeout | float64 | |
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
userInteractLimit#
详细描述#
WithUserInteractLimit 设置用户交互次数限制
userInteractLimit(limit int64) AIEngineConfigOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
workdir#
详细描述#
WithWorkdir 设置工作目录
workdir(workdir string) AIEngineConfigOption
返回值#
| 返回值(顺序) | 返回值类型 | 返回值解释 |
|---|
| r1 | AIEngineConfigOption | |
yoloMode#
详细描述#
yoloMode()