Documentation
¶
Index ¶
- Variables
- func AttractionTool() *aitool.Tool
- func DFSOrderAiTask(root *AiTask) *linktable.LinkedList[*AiTask]
- func DFSOrderAiTaskPostOrder(root *AiTask) *linktable.LinkedList[*AiTask]
- func EchoTool() *aitool.Tool
- func ErrorTool() *aitool.Tool
- func ExecuteAIForge(ctx context.Context, forgeName string, params []*ypb.ExecParamItem, ...) (*aicommon.Action, error)
- func GetAllMockTools() []*aitool.Tool
- func IsAIDBuildInForgeExisted(forgeName string) bool
- func PrintTool() *aitool.Tool
- func RegisterAIDBuildinForge(forgeName string, fun AIDBuildinForgeExecutor) error
- func RestaurantTool() *aitool.Tool
- func SelectSummary(task *AiTask, callResult *aitool.ToolResult) string
- func TimeDelayTool() *aitool.Tool
- func TimeEstimateTool() *aitool.Tool
- func TransportTool() *aitool.Tool
- func UnregisterAIDBuildinForge(forgeName string) error
- func WeatherTool() *aitool.Tool
- func WithAiForgeSearchTool() aicommon.ConfigOption
- func WithAiToolsSearchTool() aicommon.ConfigOption
- func WithPlanMocker(i func(coordinator *Coordinator) *PlanResponse) aicommon.ConfigOption
- func WithPromptContextProvider(provider *PromptContextProvider) aicommon.ConfigOption
- func WithResultHandler(h func(c *Coordinator)) aicommon.ConfigOption
- type AIDBuildinForgeExecutor
- type AiTask
- func (t *AiTask) AdjustPlan(suggestion string) error
- func (t *AiTask) DeepThink(suggestion string) error
- func (t *AiTask) GenerateDeepThinkPlanPrompt(suggestion string) (string, error)
- func (t *AiTask) GenerateIndex()
- func (t *AiTask) GenerateTaskSummaryPrompt() (string, error)
- func (t *AiTask) GetEmitter() *aicommon.Emitter
- func (t *AiTask) GetFailCallCount() int
- func (t *AiTask) GetSuccessCallCount() int
- func (t *AiTask) GetSummary() string
- func (t *AiTask) GetUserInput() string
- func (t *AiTask) MarshalJSON() ([]byte, error)
- func (t *AiTask) Progress() string
- func (t *AiTask) ProgressWithDetail() string
- func (t *AiTask) QuoteGoal() string
- func (t *AiTask) QuoteName() string
- func (t *AiTask) SetID(id string)
- func (t *AiTask) SingleLineStatusSummary() string
- func (t *AiTask) TaskContinueCount() int
- func (t *AiTask) ToolCallCount() int
- func (t *AiTask) UnmarshalJSON(data []byte) error
- type Coordinator
- func NewCoordinator(userInput string, options ...aicommon.ConfigOption) (*Coordinator, error)
- func NewCoordinatorContext(ctx context.Context, userInput string, options ...aicommon.ConfigOption) (*Coordinator, error)
- func NewFastRecoverCoordinator(uuid string, opt ...aicommon.ConfigOption) (*Coordinator, error)
- func NewFastRecoverCoordinatorContext(ctx context.Context, uuid string, opt ...aicommon.ConfigOption) (*Coordinator, error)
- func NewRecoveredCoordinator(ctx context.Context, pt *schema.AIAgentRuntime, ...) (*Coordinator, error)
- func (c *Coordinator) CallAITransaction(prompt string, postHandler func(response *aicommon.AIResponse) error, ...) error
- func (c *Coordinator) CreateDatabaseSchema(input string) *schema.AIAgentRuntime
- func (c *Coordinator) CreateRequireUserInteract() (*aitool.Tool, error)
- func (c *Coordinator) EmitPopTask(task *AiTask)
- func (c *Coordinator) EmitPushTask(task *AiTask)
- func (c *Coordinator) EmitRequireReviewForPlan(rsp *PlanResponse, id string)
- func (c *Coordinator) EmitRequireReviewForTask(task *AiTask, id string)
- func (c *Coordinator) EmitRequireUserInteractive(i *RequireInteractiveRequest, id string)
- func (c *Coordinator) EmitUpdateTaskStatus(task *AiTask)
- func (c *Coordinator) EnableToolManagerAISearch() error
- func (c *Coordinator) ExecuteLoopTask(taskTypeName string, task aicommon.AIStatefulTask, ...) error
- func (c *Coordinator) GetAIConfig() *aicommon.Config
- func (c *Coordinator) GetContextProvider() *PromptContextProvider
- func (c *Coordinator) GetPromptContextProvider() *PromptContextProvider
- func (c *Coordinator) HandleSearch(query string, items *omap.OrderedMap[string, []string]) ([]*searchtools.KeywordSearchResult, error)
- func (c *Coordinator) ProcessExtendedActionCallback(resp string)
- func (c *Coordinator) RequireUserPrompt(prompt string, opts ...*RequireInteractiveRequestOption) (aitool.InvokeParams, error)
- func (c *Coordinator) RequireUserPromptWithEndpointResult(prompt string, opts ...*RequireInteractiveRequestOption) (aitool.InvokeParams, *aicommon.Endpoint, error)
- func (c *Coordinator) RequireUserPromptWithEndpointResultEx(ctx context.Context, prompt string, opts ...*RequireInteractiveRequestOption) (aitool.InvokeParams, *aicommon.Endpoint, error)
- func (c *Coordinator) Run() error
- type CoordinatorOption
- type HandleToolUseNext
- type InteractiveEventRecord
- type PersistentDataRecord
- type PlanRecord
- type PlanResponse
- type PlanReviewSuggestion
- type PromptContextProvider
- func (m *PromptContextProvider) ApplyOp(memoryOpAction *aicommon.Action)
- func (m *PromptContextProvider) Arch() string
- func (m *PromptContextProvider) BindCoordinator(c *Coordinator)
- func (m *PromptContextProvider) ClearRuntimeConfig()
- func (m *PromptContextProvider) CopyReducibleMemory() *PromptContextProvider
- func (m *PromptContextProvider) CurrentTaskInfo() string
- func (m *PromptContextProvider) CurrentTaskTimeline() string
- func (m *PromptContextProvider) CurrentTaskToolCallResults() []*aitool.ToolResult
- func (m *PromptContextProvider) DeletePersistentData(key string)
- func (m *PromptContextProvider) GetInteractiveEvent(eventID string) (*InteractiveEventRecord, bool)
- func (m *PromptContextProvider) GetInteractiveEventLast() (string, *InteractiveEventRecord, bool)
- func (m *PromptContextProvider) GetPersistentData(key string) (string, bool)
- func (m *PromptContextProvider) GetTimelineInstance() *aicommon.Timeline
- func (m *PromptContextProvider) Now() string
- func (m *PromptContextProvider) OS() string
- func (m *PromptContextProvider) PersistentMemory() string
- func (m *PromptContextProvider) PlanHelp() string
- func (m *PromptContextProvider) Progress() string
- func (m *PromptContextProvider) PromptForToolCallResultsForLastN(n int) string
- func (m *PromptContextProvider) PushPersistentData(values ...string)
- func (m *PromptContextProvider) PushText(id int64, i any)
- func (m *PromptContextProvider) PushToolCallResults(t *aitool.ToolResult)
- func (m *PromptContextProvider) PushUserInteraction(stage aicommon.UserInteractionStage, seq int64, question, userInput string)
- func (m *PromptContextProvider) SafeStoreInteractiveUserInput(eventID string, invoke aitool.InvokeParams)
- func (m *PromptContextProvider) Schema() map[string]string
- func (m *PromptContextProvider) SetPersistentData(key string, value string)
- func (m *PromptContextProvider) SetTimelineInstance(timeline *aicommon.Timeline)
- func (m *PromptContextProvider) SetTimelineLimit(i int)
- func (m *PromptContextProvider) SoftDeleteTimeline(id ...int64)
- func (m *PromptContextProvider) StoreCliParameter(param []*ypb.ExecParamItem)
- func (m *PromptContextProvider) StoreCurrentTask(task *AiTask)
- func (m *PromptContextProvider) StoreInteractiveEvent(eventID string, e *schema.AiOutputEvent)
- func (m *PromptContextProvider) StoreInteractiveUserInput(eventID string, invoke aitool.InvokeParams)
- func (m *PromptContextProvider) StoreQuery(query string)
- func (m *PromptContextProvider) StoreRootTask(t *AiTask)
- func (m *PromptContextProvider) StoreTools(toolList func() []*aitool.Tool)
- func (m *PromptContextProvider) StoreToolsKeywords(keywords func() []string)
- func (m *PromptContextProvider) TaskMaxContinue() int64
- func (m *PromptContextProvider) Timeline() string
- func (m *PromptContextProvider) TimelineDump() string
- func (m *PromptContextProvider) TimelineWithout(n ...any) string
- func (m *PromptContextProvider) ToolsKeywords() string
- func (m *PromptContextProvider) ToolsList() string
- type RequireInteractiveRequest
- type RequireInteractiveRequestOption
- type ReviewSuggestion
- type TaskProgress
- type TaskResponseCallback
- type ToolUseReviewSuggestion
Constants ¶
This section is empty.
Variables ¶
var MemoryOpAction = "operate_memory"
var MemoryOpSchemaOption = []aitool.ToolOption{ aitool.WithStringParam("@action", aitool.WithParam_Const(MemoryOpAction)), aitool.WithStructArrayParam("memory_op", []aitool.PropertyOption{ aitool.WithParam_Description("persistent memory operation, you can use this to store some data in the memory, and it will be used in the next call"), aitool.WithParam_Required(true), aitool.WithParam_MinLength(0), }, nil, aitool.WithStringParam("op", aitool.WithParam_Description("the operation type, can be 'set', 'delete'"), aitool.WithParam_EnumString("set", "delete"), aitool.WithParam_Required(true)), aitool.WithStringParam("key", aitool.WithParam_Description("the key of the persistent memory, if you set op to 'set', this is required"), aitool.WithParam_Required(true)), aitool.WithStringParam("value", aitool.WithParam_Description("the value of the persistent memory, if you set op to 'set', this is required"), aitool.WithParam_Required(false)), ), }
var TaskReviewSuggestions = []*ReviewSuggestion{ { Value: "deeply_think", Prompt: "思考不够深入,根据当前上下文,为当前任务拆分更多子任务", PromptEnglish: "Not deep enough, split more sub-tasks for the current task according to the current context", AllowExtraPrompt: true, ParamSchema: schemaRePlanSuggestion, }, { Value: "inaccurate", Prompt: "回答不够精准,存在未使用工具导致幻觉,或者工具参数不合适", PromptEnglish: "The answer is not accurate enough, there is an illusion caused by not using the tool, or the tool parameters are not appropriate", AllowExtraPrompt: true, }, { Value: "continue", Prompt: "继续执行任务", PromptEnglish: "Continue to execute the task", }, { Value: "adjust_plan", Prompt: "任务需要调整,用户会输入更新后任务建议", PromptEnglish: "The task needs to be adjusted, and the user will enter the updated task", AllowExtraPrompt: true, ParamSchema: schemaRePlanSuggestion, }, }
TaskReviewSuggestions 是任务审查时的建议(内置一些常见选项)
var ToolUseReviewSuggestions = []*ToolUseReviewSuggestion{ { Value: "wrong_tool", Prompt: "工具选择不当", PromptEnglish: "Wrong tool used, need to change to a more appropriate tool", AllowExtraPrompt: true, }, { Value: "wrong_params", Prompt: "参数不合理", PromptEnglish: "Tool parameters are not used properly, need to adjust parameters", AllowExtraPrompt: true, AllowParamsModification: true, }, { Value: "direct_answer", Prompt: "要求AI直接回答", PromptEnglish: "Tool parameters are not used properly, need to adjust parameters", AllowExtraPrompt: true, AllowParamsModification: true, }, { Value: "continue", Prompt: "同意工具使用", PromptEnglish: "Tool usage is correct, continue execution", }, }
ToolUseReviewSuggestions 是工具使用审查时的建议(内置一些常见选项)
Functions ¶
func DFSOrderAiTask ¶
func DFSOrderAiTask(root *AiTask) *linktable.LinkedList[*AiTask]
func DFSOrderAiTaskPostOrder ¶
func DFSOrderAiTaskPostOrder(root *AiTask) *linktable.LinkedList[*AiTask]
DFSOrderAiTaskPostOrder 使用后序遍历(Post-order)来遍历 AiTask 树。 遍历顺序:先访问所有子任务,最后访问父任务。
func ExecuteAIForge ¶
func ExecuteAIForge(ctx context.Context, forgeName string, params []*ypb.ExecParamItem, opts ...aicommon.ConfigOption) (*aicommon.Action, error)
func RegisterAIDBuildinForge ¶
func RegisterAIDBuildinForge(forgeName string, fun AIDBuildinForgeExecutor) error
func SelectSummary ¶
func SelectSummary(task *AiTask, callResult *aitool.ToolResult) string
func WithAiForgeSearchTool ¶
func WithAiForgeSearchTool() aicommon.ConfigOption
func WithPlanMocker ¶
func WithPlanMocker(i func(coordinator *Coordinator) *PlanResponse) aicommon.ConfigOption
func WithPromptContextProvider ¶
func WithPromptContextProvider(provider *PromptContextProvider) aicommon.ConfigOption
func WithResultHandler ¶
func WithResultHandler(h func(c *Coordinator)) aicommon.ConfigOption
cycle import issue
Types ¶
type AIDBuildinForgeExecutor ¶
type AIDBuildinForgeExecutor func(c context.Context, params []*ypb.ExecParamItem, opts ...aicommon.ConfigOption) (*aicommon.Action, error)
type AiTask ¶
type AiTask struct {
*Coordinator
*aicommon.AIStatefulTaskBase
Index string `json:"index"`
Name string `json:"name"`
Goal string `json:"goal"`
ParentTask *AiTask `json:"parent_task"`
Subtasks []*AiTask `json:"subtasks"`
StatusSummary string `json:"status_summary"`
TaskSummary string `json:"task_summary"`
ShortSummary string `json:"short_summary"`
LongSummary string `json:"long_summary"`
// contains filtered or unexported fields
}
func ExtractNextPlanTaskFromRawResponse ¶
func ExtractNextPlanTaskFromRawResponse(c *Coordinator, rawResponse string) ([]*AiTask, error)
func ExtractTaskFromRawResponse ¶
func ExtractTaskFromRawResponse(c *Coordinator, rawResponse string) (retTask *AiTask, err error)
ExtractTaskFromRawResponse 从原始响应中提取Task
func (*AiTask) AdjustPlan ¶
func (*AiTask) GenerateDeepThinkPlanPrompt ¶
func (*AiTask) GenerateIndex ¶
func (t *AiTask) GenerateIndex()
GenerateIndex 为任务树生成层级索引。 调用此方法的任务 (a) 所在树的根节点索引将被设为 "1"。 其子任务将相应地获得如 "1-1", "1-2" 等索引,孙任务如 "1-1-1" 等。
func (*AiTask) GenerateTaskSummaryPrompt ¶
func (*AiTask) GetEmitter ¶
func (*AiTask) GetFailCallCount ¶
func (*AiTask) GetSuccessCallCount ¶
func (*AiTask) GetSummary ¶
func (*AiTask) GetUserInput ¶
func (*AiTask) MarshalJSON ¶
MarshalJSON 实现自定义的JSON序列化,跳过AICallback字段
func (*AiTask) ProgressWithDetail ¶
func (*AiTask) SingleLineStatusSummary ¶
func (*AiTask) TaskContinueCount ¶
TaskContinueCount 返回任务继续执行的次数(从 ReActLoop 获取迭代次数)
func (*AiTask) UnmarshalJSON ¶
UnmarshalJSON 实现自定义的JSON反序列化,跳过AICallback字段
type Coordinator ¶
type Coordinator struct {
*aicommon.Config
PlanMocker func(config *Coordinator) *PlanResponse
ContextProvider *PromptContextProvider
ResultHandler func(cod *Coordinator)
// contains filtered or unexported fields
}
func NewCoordinator ¶
func NewCoordinator(userInput string, options ...aicommon.ConfigOption) (*Coordinator, error)
func NewCoordinatorContext ¶
func NewCoordinatorContext(ctx context.Context, userInput string, options ...aicommon.ConfigOption) (*Coordinator, error)
NewCoordinatorContext 创建一个新的 Coordinator
func NewFastRecoverCoordinator ¶
func NewFastRecoverCoordinator(uuid string, opt ...aicommon.ConfigOption) (*Coordinator, error)
func NewFastRecoverCoordinatorContext ¶
func NewFastRecoverCoordinatorContext(ctx context.Context, uuid string, opt ...aicommon.ConfigOption) (*Coordinator, error)
func NewRecoveredCoordinator ¶
func NewRecoveredCoordinator( ctx context.Context, pt *schema.AIAgentRuntime, options ...aicommon.ConfigOption, ) (*Coordinator, error)
func (*Coordinator) CallAITransaction ¶
func (c *Coordinator) CallAITransaction(prompt string, postHandler func(response *aicommon.AIResponse) error, requestOpts ...aicommon.AIRequestOption) error
func (*Coordinator) CreateDatabaseSchema ¶
func (c *Coordinator) CreateDatabaseSchema(input string) *schema.AIAgentRuntime
func (*Coordinator) CreateRequireUserInteract ¶
func (c *Coordinator) CreateRequireUserInteract() (*aitool.Tool, error)
CreateRequireUserInteract 创建一个需要用户输入的提示工具 这个工具非常有意思,AI 如果调用这个工具,意味着,他觉得他受阻了,需要人的提示来帮助他继续完成任务 调用这个工具会强制让 AI 进入等待状态,直到用户输入提示
func (*Coordinator) EmitPopTask ¶
func (c *Coordinator) EmitPopTask(task *AiTask)
func (*Coordinator) EmitPushTask ¶
func (c *Coordinator) EmitPushTask(task *AiTask)
func (*Coordinator) EmitRequireReviewForPlan ¶
func (c *Coordinator) EmitRequireReviewForPlan(rsp *PlanResponse, id string)
func (*Coordinator) EmitRequireReviewForTask ¶
func (c *Coordinator) EmitRequireReviewForTask(task *AiTask, id string)
func (*Coordinator) EmitRequireUserInteractive ¶
func (c *Coordinator) EmitRequireUserInteractive(i *RequireInteractiveRequest, id string)
func (*Coordinator) EmitUpdateTaskStatus ¶
func (c *Coordinator) EmitUpdateTaskStatus(task *AiTask)
func (*Coordinator) EnableToolManagerAISearch ¶
func (c *Coordinator) EnableToolManagerAISearch() error
func (*Coordinator) ExecuteLoopTask ¶
func (c *Coordinator) ExecuteLoopTask(taskTypeName string, task aicommon.AIStatefulTask, options ...reactloops.ReActLoopOption) error
func (*Coordinator) GetAIConfig ¶
func (c *Coordinator) GetAIConfig() *aicommon.Config
func (*Coordinator) GetContextProvider ¶
func (c *Coordinator) GetContextProvider() *PromptContextProvider
func (*Coordinator) GetPromptContextProvider ¶
func (c *Coordinator) GetPromptContextProvider() *PromptContextProvider
func (*Coordinator) HandleSearch ¶
func (c *Coordinator) HandleSearch(query string, items *omap.OrderedMap[string, []string]) ([]*searchtools.KeywordSearchResult, error)
func (*Coordinator) ProcessExtendedActionCallback ¶
func (c *Coordinator) ProcessExtendedActionCallback(resp string)
func (*Coordinator) RequireUserPrompt ¶
func (c *Coordinator) RequireUserPrompt(prompt string, opts ...*RequireInteractiveRequestOption) (aitool.InvokeParams, error)
func (*Coordinator) RequireUserPromptWithEndpointResult ¶
func (c *Coordinator) RequireUserPromptWithEndpointResult(prompt string, opts ...*RequireInteractiveRequestOption) (aitool.InvokeParams, *aicommon.Endpoint, error)
func (*Coordinator) RequireUserPromptWithEndpointResultEx ¶
func (c *Coordinator) RequireUserPromptWithEndpointResultEx(ctx context.Context, prompt string, opts ...*RequireInteractiveRequestOption) (aitool.InvokeParams, *aicommon.Endpoint, error)
func (*Coordinator) Run ¶
func (c *Coordinator) Run() error
type CoordinatorOption ¶
type CoordinatorOption func(c *Coordinator)
CoordinatorOption 定义配置 Coordinator 的选项接口
func WithCoordinatorPlanMocker ¶
func WithCoordinatorPlanMocker(i func(coordinator *Coordinator) *PlanResponse) CoordinatorOption
func WithCoordinatorResultHandler ¶
func WithCoordinatorResultHandler(h func(c *Coordinator)) CoordinatorOption
type HandleToolUseNext ¶
type HandleToolUseNext string
type InteractiveEventRecord ¶
type InteractiveEventRecord struct {
InteractiveEvent *schema.AiOutputEvent
UserInput aitool.InvokeParams
}
type PersistentDataRecord ¶
type PlanRecord ¶
type PlanRecord struct {
PlanRequest *planRequest
PlanResponse *PlanResponse
}
type PlanResponse ¶
type PlanResponse struct {
RootTask *AiTask `json:"root_task"`
}
func ExtractPlan ¶
func ExtractPlan(c *Coordinator, rawResponse string) (*PlanResponse, error)
func (*PlanResponse) MergeSubtask ¶
func (p *PlanResponse) MergeSubtask(parentIndex string, name string, goal string)
type PlanReviewSuggestion ¶
type PlanReviewSuggestion struct {
Id string `json:"id"`
Value string `json:"value"`
Prompt string `json:"prompt"`
PromptEnglish string `json:"prompt_english"`
AllowExtraPrompt bool `json:"allow_extra_prompt"`
PromptBuilder func(plan *planRequest, rt *runtime) `json:"-"`
ResponseCallback func(reader io.Reader) `json:"-"`
ParamSchema string `json:"param_schema"`
}
type PromptContextProvider ¶
type PromptContextProvider struct {
// user first input
Query string
// persistent data
PersistentData *omap.OrderedMap[string, *PersistentDataRecord]
// task info
CurrentTask *AiTask
RootTask *AiTask
// todo
PlanHistory []*PlanRecord
// tools list
DisableTools bool
Tools func() []*aitool.Tool
// interactive history
InteractiveHistory *omap.OrderedMap[string, *InteractiveEventRecord]
// contains filtered or unexported fields
}
func GetDefaultContextProvider ¶
func GetDefaultContextProvider() *PromptContextProvider
func (*PromptContextProvider) ApplyOp ¶
func (m *PromptContextProvider) ApplyOp(memoryOpAction *aicommon.Action)
ApplyOp applies a list of operations to the memory.
func (*PromptContextProvider) Arch ¶
func (m *PromptContextProvider) Arch() string
func (*PromptContextProvider) BindCoordinator ¶
func (m *PromptContextProvider) BindCoordinator(c *Coordinator)
func (*PromptContextProvider) ClearRuntimeConfig ¶
func (m *PromptContextProvider) ClearRuntimeConfig()
func (*PromptContextProvider) CopyReducibleMemory ¶
func (m *PromptContextProvider) CopyReducibleMemory() *PromptContextProvider
func (*PromptContextProvider) CurrentTaskInfo ¶
func (m *PromptContextProvider) CurrentTaskInfo() string
memory tools current task info
func (*PromptContextProvider) CurrentTaskTimeline ¶
func (m *PromptContextProvider) CurrentTaskTimeline() string
func (*PromptContextProvider) CurrentTaskToolCallResults ¶
func (m *PromptContextProvider) CurrentTaskToolCallResults() []*aitool.ToolResult
func (*PromptContextProvider) DeletePersistentData ¶
func (m *PromptContextProvider) DeletePersistentData(key string)
func (*PromptContextProvider) GetInteractiveEvent ¶
func (m *PromptContextProvider) GetInteractiveEvent(eventID string) (*InteractiveEventRecord, bool)
func (*PromptContextProvider) GetInteractiveEventLast ¶
func (m *PromptContextProvider) GetInteractiveEventLast() (string, *InteractiveEventRecord, bool)
func (*PromptContextProvider) GetPersistentData ¶
func (m *PromptContextProvider) GetPersistentData(key string) (string, bool)
func (*PromptContextProvider) GetTimelineInstance ¶
func (m *PromptContextProvider) GetTimelineInstance() *aicommon.Timeline
func (*PromptContextProvider) Now ¶
func (m *PromptContextProvider) Now() string
constants info memory api
func (*PromptContextProvider) OS ¶
func (m *PromptContextProvider) OS() string
func (*PromptContextProvider) PersistentMemory ¶
func (m *PromptContextProvider) PersistentMemory() string
func (*PromptContextProvider) PlanHelp ¶
func (m *PromptContextProvider) PlanHelp() string
func (*PromptContextProvider) Progress ¶
func (m *PromptContextProvider) Progress() string
func (*PromptContextProvider) PromptForToolCallResultsForLastN ¶
func (m *PromptContextProvider) PromptForToolCallResultsForLastN(n int) string
func (*PromptContextProvider) PushPersistentData ¶
func (m *PromptContextProvider) PushPersistentData(values ...string)
func (*PromptContextProvider) PushText ¶
func (m *PromptContextProvider) PushText(id int64, i any)
func (*PromptContextProvider) PushToolCallResults ¶
func (m *PromptContextProvider) PushToolCallResults(t *aitool.ToolResult)
tool results memory
func (*PromptContextProvider) PushUserInteraction ¶
func (m *PromptContextProvider) PushUserInteraction(stage aicommon.UserInteractionStage, seq int64, question, userInput string)
func (*PromptContextProvider) SafeStoreInteractiveUserInput ¶
func (m *PromptContextProvider) SafeStoreInteractiveUserInput(eventID string, invoke aitool.InvokeParams)
SafeStoreInteractiveUserInput safely stores interactive user input with better error handling
func (*PromptContextProvider) Schema ¶
func (m *PromptContextProvider) Schema() map[string]string
func (*PromptContextProvider) SetPersistentData ¶
func (m *PromptContextProvider) SetPersistentData(key string, value string)
func (*PromptContextProvider) SetTimelineInstance ¶
func (m *PromptContextProvider) SetTimelineInstance(timeline *aicommon.Timeline)
func (*PromptContextProvider) SetTimelineLimit ¶
func (m *PromptContextProvider) SetTimelineLimit(i int)
timeline limit set
func (*PromptContextProvider) SoftDeleteTimeline ¶
func (m *PromptContextProvider) SoftDeleteTimeline(id ...int64)
func (*PromptContextProvider) StoreCliParameter ¶
func (m *PromptContextProvider) StoreCliParameter(param []*ypb.ExecParamItem)
func (*PromptContextProvider) StoreCurrentTask ¶
func (m *PromptContextProvider) StoreCurrentTask(task *AiTask)
func (*PromptContextProvider) StoreInteractiveEvent ¶
func (m *PromptContextProvider) StoreInteractiveEvent(eventID string, e *schema.AiOutputEvent)
interactive history memory
func (*PromptContextProvider) StoreInteractiveUserInput ¶
func (m *PromptContextProvider) StoreInteractiveUserInput(eventID string, invoke aitool.InvokeParams)
func (*PromptContextProvider) StoreQuery ¶
func (m *PromptContextProvider) StoreQuery(query string)
user first input
func (*PromptContextProvider) StoreRootTask ¶
func (m *PromptContextProvider) StoreRootTask(t *AiTask)
task info memory
func (*PromptContextProvider) StoreTools ¶
func (m *PromptContextProvider) StoreTools(toolList func() []*aitool.Tool)
set tools list
func (*PromptContextProvider) StoreToolsKeywords ¶
func (m *PromptContextProvider) StoreToolsKeywords(keywords func() []string)
set tools list
func (*PromptContextProvider) TaskMaxContinue ¶
func (m *PromptContextProvider) TaskMaxContinue() int64
func (*PromptContextProvider) Timeline ¶
func (m *PromptContextProvider) Timeline() string
func (*PromptContextProvider) TimelineDump ¶
func (m *PromptContextProvider) TimelineDump() string
TimelineDump returns the timeline dump safely
func (*PromptContextProvider) TimelineWithout ¶
func (m *PromptContextProvider) TimelineWithout(n ...any) string
func (*PromptContextProvider) ToolsKeywords ¶
func (m *PromptContextProvider) ToolsKeywords() string
func (*PromptContextProvider) ToolsList ¶
func (m *PromptContextProvider) ToolsList() string
type RequireInteractiveRequest ¶
type RequireInteractiveRequest struct {
Id string `json:"id"`
Prompt string `json:"prompt"`
Options []*RequireInteractiveRequestOption `json:"options"`
}
type ReviewSuggestion ¶
type TaskProgress ¶
type TaskProgress struct {
TotalTasks int `json:"total_tasks"` // 总任务数
CompletedTasks int `json:"completed_tasks"` // 已完成任务数
CurrentTask string `json:"current_task"` // 当前执行的任务
CurrentGoal string `json:"current_goal"` // 当前任务的目标
}
TaskProgress 记录任务执行的进度信息
type TaskResponseCallback ¶
type TaskResponseCallback func(ctx *PromptContextProvider, details ...aispec.ChatDetail) (continueThinking bool, prompt string, err error)
TaskResponseCallback 定义Task执行过程中响应回调函数类型
Source Files
¶
- builder_prompts.go
- builder_schema.go
- buildin_forges.go
- coordinator.go
- coordinator_emitter.go
- coordinator_invoker.go
- coordinator_report.go
- database.go
- memory.go
- mocktools.go
- plan.go
- plan_with_interact.go
- recovery.go
- require_prompt.go
- review_plan.go
- review_task.go
- review_use_tool.go
- runtime.go
- task.go
- task_call_tool.go
- task_dfs.go
- task_execute.go
- task_prompts.go
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
command
|
|
|
cmd/aireactdeps/promptui
Package promptui is a library providing a simple interface to create command-line prompts for go.
|
Package promptui is a library providing a simple interface to create command-line prompts for go. |
|
cmd/stdinsys/cmd
command
|
|