Documentation
¶
Overview ¶
@Project: mvptianyu @Module: manus @File : manus.go
@Project: mvptianyu @Module: aihub @File : response.go
@Project: aihub @Module: aihub @File : session.go
Index ¶
- Constants
- Variables
- func AgentCall(ctx context.Context, input *AgentCallReq, output *Message) (err error)
- func ContextWithSession(ctx context.Context, session *Session) context.Context
- func HTTPCall(surl string, method string, req interface{}, reqHeader *http.Header, ...) (rsp *http.Response, err error)
- func HasMarkdownSyntax(s string) bool
- type AgentCallReq
- type AgentConfig
- type AgentRuntimeCfg
- type BriefInfo
- type ChatCompletionRspChoice
- type ChatCompletionRspError
- type ChatCompletionRspFinishReason
- type CreateChatCompletionReq
- type CreateChatCompletionRsp
- type HTTPOption
- type HTTPOptions
- type IAgent
- type IAgentHub
- type IBriefInfo
- type ILLM
- type ILLMHub
- type IMCPHub
- type IMCPServer
- type IMemory
- type IMiddleware
- type IMiddlewareHub
- type ISession
- type IToolHub
- type IToolInput
- type LLMConfig
- type LLMType
- type Message
- type MessageContentAudio
- type MessageContentAudioFormat
- type MessageContentFile
- type MessageContentImage
- type MessageContentPart
- type MessageContentType
- type MessageRoleType
- type MessageToolCall
- type OPENAPIConfig
- type OPENAPIInfo
- type OPENAPIOperation
- type OPENAPIPathItem
- type OPENAPIRequestBody
- type OPENAPIResponse
- type OPENAPIServer
- type OPENAPITag
- type Response
- type RunOptionFunc
- func WithAgents(agents []string) RunOptionFunc
- func WithContext(context interface{}) RunOptionFunc
- func WithDebug(debug bool) RunOptionFunc
- func WithRuntimeCfg(runtimeCfg AgentRuntimeCfg) RunOptionFunc
- func WithSessionData(sessionData map[string]interface{}) RunOptionFunc
- func WithSessionID(sessionID string) RunOptionFunc
- func WithSystemPrompt(systemPrompt string) RunOptionFunc
- type RunOptions
- type RunState
- type RunStep
- type Session
- type StepType
- type Tool
- type ToolEntry
- type ToolFunction
- type ToolInputBase
- type ToolMethod
Constants ¶
const ( ToolArgumentsRawInputKey = "INPUT_" ToolArgumentsRawSessionKey = "SESSION_" )
const AgentCallFuncName = "AgentCall"
=======AgentCall注册==========
const ContextAIHubSessionKey = "AIHUB_SESSION"
const DefaultHTTPSessionID = "DEFAULT_HTTP_SESSION_ID"
const (
ToolTypeFunction = "function"
)
Variables ¶
var ( ErrUnknown = errors.New("unknown error") ErrConfiguration = errors.New("invalid agent or llm configuration") ErrToolRegisterRepeat = errors.New("tool function name register repeated") ErrProviderRateLimit = errors.New("llm trigger rate limit") ErrAgentRunTimeout = errors.New("agent run timeout") ErrCallNameNotMatch = errors.New("not found matched call name with mcp/tool entry") ErrMCPResponseEmpty = errors.New("mcp call response empty") ErrChatCompletionOverMaxStep = errors.New("chat request over max step quit") ErrMessageContentFieldsMisused = errors.New("message content fields are missing") ErrHTTPRequestURLInvalid = errors.New("http request url invalid") ErrHTTPRequestBodyInvalid = errors.New("http request body invalid") ErrHTTPRequestTimeout = errors.New("http request timeout") ErrToolCallResponseEmpty = errors.New("tool call response empty") )
Functions ¶
func AgentCall ¶
func AgentCall(ctx context.Context, input *AgentCallReq, output *Message) (err error)
func ContextWithSession ¶
func HTTPCall ¶
func HTTPCall(surl string, method string, req interface{}, reqHeader *http.Header, options ...HTTPOption) (rsp *http.Response, err error)
HTTPCall 统一发送http请求方法入口
Examples:
httpcli.Call( ctx, "http://www.xxx.com/", "GET", "aa=2", HTTPWithTimeOut(3) )
func HasMarkdownSyntax ¶
HasMarkdownSyntax 函数用于检查输入的字符串是否包含 Markdown 语法
Types ¶
type AgentCallReq ¶
type AgentCallReq struct {
ToolInputBase
RunStep `yaml:",inline"`
}
type AgentConfig ¶
type AgentConfig struct {
BriefInfo `yaml:",inline"` // yaml解析inline结构
AgentRuntimeCfg `yaml:",inline"` // yaml解析inline结构
Tools []string `json:"tools,omitempty" yaml:"tools,omitempty"` // 用到的工具名
Mcps []string `json:"mcps,omitempty" yaml:"mcps,omitempty"` // 用到的MCP服务
Middlewares []string `json:"middlewares,omitempty" yaml:"middlewares,omitempty"` // 用到的Middleware
SessionData map[string]interface{} `json:"session_data,omitempty" yaml:"session_data,omitempty"` // 用到的Session数据
}
AgentConfig agent配置结构
func YamlDataToAgentConfig ¶
func YamlDataToAgentConfig(yamlData []byte) (*AgentConfig, error)
func (*AgentConfig) AutoFix ¶
func (cfg *AgentConfig) AutoFix() error
type AgentRuntimeCfg ¶
type AgentRuntimeCfg struct {
MemoryTimeout int64 `json:"memory_timeout,omitempty" yaml:"memory_timeout,omitempty"` // 历史消息缓存过期时间秒数
MaxStoreMemory int `json:"max_store_memory,omitempty" yaml:"max_store_memory,omitempty"` // 限制总体缓存会话记忆条数
MaxUseMemory int `json:"max_use_memory,omitempty" yaml:"max_use_memory,omitempty"` // 限制请求时使用的消息条数,避免输入token泛滥
MaxStepQuit int `json:"max_step_quit,omitempty" yaml:"max_step_quit,omitempty"` // 限制单次会话的最大执行步数,避免AI死循环
MaxTokens int `json:"max_tokens,omitempty" yaml:"max_tokens,omitempty"` // 限制最大token数
FrequencyPenalty float64 `json:"frequency_penalty,omitempty" yaml:"frequency_penalty,omitempty"` // 频率惩罚[-2.0~2.0],值越大,模型越倾向于避免重复已经生成过的词
PresencePenalty float64 `json:"presence_penalty,omitempty" yaml:"presence_penalty,omitempty"` // 存在惩罚[-2.0~2.0],值越大,模型生成的文本中重复出现的词就越少
Temperature float64 `json:"temperature,omitempty" yaml:"temperature,omitempty"` // 温度[0.0~2.0],值越大,模型生成的文本灵活性更高
LLM string `json:"llm,omitempty" yaml:"llm,omitempty"` // LLM提供商配置
SystemPrompt string `json:"system_prompt,omitempty" yaml:"system_prompt,omitempty"` // 系统提示词
StopWords string `json:"stop_words,omitempty" yaml:"stop_words,omitempty"` // 结束退出词
RunTimeout int64 `json:"run_timeout,omitempty" yaml:"run_timeout,omitempty"` // 执行超时秒数
Claim string `json:"claim,omitempty" yaml:"claim,omitempty"` // 宣称文案,例如:本次返回由xxx提供
Debug bool `json:"debug,omitempty" yaml:"debug,omitempty"` // debug输出标志,开启则输出具体工具调用过程信息
}
AgentRuntimeCfg 运行时配置
func (*AgentRuntimeCfg) AutoFix ¶
func (cfg *AgentRuntimeCfg) AutoFix() error
type BriefInfo ¶
type BriefInfo struct {
Name string `json:"name" yaml:"name"` // 名称
Description string `json:"description" yaml:"description"` // 描述
}
BriefInfo 公共基础简介
type ChatCompletionRspChoice ¶
type ChatCompletionRspChoice struct {
Index int `json:"index"`
Message *Message `json:"message,omitempty"` // stream = false时返回
Delta *Message `json:"delta,omitempty"` // stream = true时返回
Logprobs interface{} `json:"logprobs"`
FinishReason ChatCompletionRspFinishReason `json:"finish_reason"`
}
type ChatCompletionRspError ¶
type ChatCompletionRspFinishReason ¶
type ChatCompletionRspFinishReason string
const ( ChatCompletionRspFinishReasonStop ChatCompletionRspFinishReason = "stop" ChatCompletionRspFinishReasonLength ChatCompletionRspFinishReason = "length" ChatCompletionRspFinishReasonToolCalls ChatCompletionRspFinishReason = "tool_calls" ChatCompletionRspFinishReasonContentFilter ChatCompletionRspFinishReason = "content_filter" ChatCompletionRspFinishReasonContentFunctionCall ChatCompletionRspFinishReason = "function_call" )
type CreateChatCompletionReq ¶
type CreateChatCompletionReq struct {
Messages []*Message `json:"messages"`
Model string `json:"model"`
FrequencyPenalty float64 `json:"frequency_penalty,omitempty"`
MaxTokens int `json:"max_tokens,omitempty"`
PresencePenalty float64 `json:"presence_penalty,omitempty"`
Stop string `json:"stop,omitempty"`
Stream bool `json:"stream,omitempty"`
Temperature float64 `json:"temperature,omitempty"`
TopP int `json:"top_p,omitempty"`
Tools []*Tool `json:"tools,omitempty"`
}
CreateChatCompletionReq 参见https://platform.openai.com/docs/api-reference/chat/create
type CreateChatCompletionRsp ¶
type CreateChatCompletionRsp struct {
Id string `json:"id,omitempty"`
Object string `json:"object,omitempty"`
Created int `json:"created,omitempty"`
Model string `json:"model,omitempty"`
Choices []*ChatCompletionRspChoice `json:"choices,omitempty"`
Usage struct {
PromptTokens int `json:"prompt_tokens"`
CompletionTokens int `json:"completion_tokens"`
TotalTokens int `json:"total_tokens"`
PromptTokensDetails struct {
CachedTokens int `json:"cached_tokens"`
AudioTokens int `json:"audio_tokens"`
} `json:"prompt_tokens_details"`
CompletionTokensDetails struct {
ReasoningTokens int `json:"reasoning_tokens"`
AudioTokens int `json:"audio_tokens"`
AcceptedPredictionTokens int `json:"accepted_prediction_tokens"`
RejectedPredictionTokens int `json:"rejected_prediction_tokens"`
} `json:"completion_tokens_details"`
} `json:"usage,omitempty"`
ServiceTier string `json:"service_tier,omitempty"`
SystemFingerprint string `json:"system_fingerprint,omitempty"`
Error *ChatCompletionRspError `json:"error,omitempty"`
}
CreateChatCompletionRsp 参见https://platform.openai.com/docs/api-reference/chat/create
type HTTPOption ¶
type HTTPOption func(c *HTTPOptions)
func HTTPWithRetry ¶
func HTTPWithRetry(retry int) HTTPOption
func HTTPWithRetryWait ¶
func HTTPWithRetryWait(retrywait time.Duration) HTTPOption
func HTTPWithTimeOut ¶
func HTTPWithTimeOut(timeout int64) HTTPOption
type HTTPOptions ¶
type HTTPOptions struct {
Header http.Header // header头设定
TimeOut time.Duration // 超时设定
Retry int // 重试次数设定
RetryWait time.Duration // 重试间隔设定,退火策略
}
HTTPOptions http请求选项设置
type IAgent ¶
type IAgent interface {
IBriefInfo
// Run 执行Agent请求
Run(ctx context.Context, input string, opts ...RunOptionFunc) *Response
// RunStream 执行Agent请求,支持流式返回
RunStream(ctx context.Context, input string, opts ...RunOptionFunc) (stream *ssestream.StreamReader[Response])
// ResetMemory 重置会话记忆
ResetMemory(ctx context.Context, opts ...RunOptionFunc) error
// GetToolFunctions 获取工具配置
GetToolFunctions() []ToolFunction
// InvokeToolCall 调度指定工具命令
InvokeToolCall(ctx context.Context, name string, args string, output *Message) (err error)
}
IAgent 智能体
type IAgentHub ¶
type IAgentHub interface {
GetAllNameList() []string
GetAgentList(names ...string) []IAgent
GetAgent(name string) IAgent
DelAgent(name string) error
SetAgent(cfg *AgentConfig) (IAgent, error)
SetAgentByYamlData(yamlData []byte) (IAgent, error)
SetAgentByYamlFile(yamlFile string) (IAgent, error)
GetMCPServer() IMCPServer
}
func GetAgentHub ¶
func GetAgentHub() IAgentHub
type IBriefInfo ¶
type IBriefInfo interface {
GetBriefInfo() BriefInfo
}
type ILLM ¶
type ILLM interface {
IBriefInfo
// CreateChatCompletion 创建Chat
CreateChatCompletion(ctx context.Context, request *CreateChatCompletionReq) (response *CreateChatCompletionRsp, err error)
// CreateChatCompletionStream 创建Chat以及stream返回
CreateChatCompletionStream(ctx context.Context, request *CreateChatCompletionReq) (stream *ssestream.StreamReader[CreateChatCompletionRsp])
}
ILLM 模型相关能力
type ILLMHub ¶
type IMCPHub ¶
type IMCPHub interface {
GetAllNameList() []string
GetClient(addrs ...string) []*client.SSEMCPClient
DelClient(addrs ...string) error
SetClient(addrs ...string) error
ProxyCall(ctx context.Context, name string, input string, output *Message) (err error)
GetToolFunctions(addrs []string, names []string) []ToolFunction
ConvertToOPENAPIConfig() string
}
type IMCPServer ¶
type IMCPServer interface {
Start(listenAddr string) error
Shutdown(ctx context.Context) error
GetSSEPath() string
GetMessagePath() string
AddTools(tools ...server.ServerTool)
DelTools(names ...string)
ServeHTTP(w http.ResponseWriter, r *http.Request)
}
IMCPServer MCP服务定义
type IMemory ¶
type IMemory interface {
// Push 塞入会话消息记录
Push(opts *RunOptions, msg ...*Message)
// GetLatest 获取最近会话消息记录
GetLatest(opts *RunOptions) []*Message
// Clear 清理指定消息记录
Clear(opts *RunOptions)
}
IMemory 会话记录
type IMiddleware ¶
type IMiddleware interface {
// BeforeProcessing 前处理
BeforeProcessing(ctx context.Context, req *Message, rsp []*Message, opts *RunOptions) error
// AfterProcessing 后处理
AfterProcessing(ctx context.Context, req *Message, rsp []*Message, opts *RunOptions) error
}
IMiddleware 调用拦截器
type IMiddlewareHub ¶
type IMiddlewareHub interface {
GetAllNameList() []string
GetMiddleware(names ...string) []IMiddleware
DelMiddleware(names ...string) error
SetMiddleware(middlewares ...IMiddleware) error
}
func GetMiddlewareHub ¶
func GetMiddlewareHub() IMiddlewareHub
type ISession ¶
type ISession interface {
// SetSessionData 设置数据KV
SetSessionData(key string, value interface{})
// GetSessionData 获取数据KV
GetSessionData(key string) interface{}
// GetAllSessionData 获取所有数据KV
GetAllSessionData() map[string]interface{}
// GetSessionID 获取sessionid
GetSessionID() string
}
ISession 会话session数据
type IToolHub ¶
type IToolHub interface {
GetAllNameList() []string
GetToolFunctions(names ...string) []ToolFunction
GetTool(names ...string) []ToolEntry
DelTool(names ...string) error
SetTool(objs ...ToolEntry) error
ProxyCall(ctx context.Context, name string, input string, output *Message) (err error)
ConvertToOPENAPIConfig() string
GetMCPServer() IMCPServer
}
func GetToolHub ¶
func GetToolHub() IToolHub
type IToolInput ¶
type IToolInput interface {
GetRawInput() string
SetRawInput(str string)
GetRawSession() string
SetRawSession(str string)
}
IToolInput 工具入参格式定义
type LLMConfig ¶
type LLMConfig struct {
BriefInfo `yaml:",inline"` // yaml解析inline结构
ModelType LLMType `json:"model_type" yaml:"model_type"`
Provider string `json:"provider" yaml:"provider"` // 提供商名称,例如openai
BaseURL string `json:"base_url" yaml:"base_url"`
Version string `json:"version" yaml:"version"`
APIKey string `json:"api_key" yaml:"api_key"`
MaxTokens int `json:"max_tokens" yaml:"max_tokens"` // 模型本身限制的最大token数
RateLimit int `json:"rate_limit" yaml:"rate_limit"`
}
LLMConfig provider配置结构
func YamlDataToLLMConfig ¶
type Message ¶
type Message struct {
Content string `json:"-"`
MultiContent []*MessageContentPart `json:"-"`
Role MessageRoleType `json:"role"`
Name string `json:"name,omitempty"`
ToolCallID string `json:"tool_call_id,omitempty"` // Role=tool发出请求时携带之前由Role=assistant返回的ToolCallID
ToolCalls []*MessageToolCall `json:"tool_calls,omitempty"` // Role=assistant返回的Message所带的ToolCalls
Refusal string `json:"refusal,omitempty"`
CreateTime int64 `json:"-"`
SessionID string `json:"-"`
}
func (*Message) MarshalJSON ¶
func (*Message) UnmarshalJSON ¶
type MessageContentAudio ¶
type MessageContentAudio struct {
Data string `json:"data"`
Format MessageContentAudioFormat `json:"format"` // mp3|wav
}
type MessageContentAudioFormat ¶
type MessageContentAudioFormat string
const ( MessageContentAudioFormatMP3 MessageContentAudioFormat = "mp3" MessageContentAudioFormatWAV MessageContentAudioFormat = "wav" )
type MessageContentFile ¶
type MessageContentImage ¶
type MessageContentImage struct {
URL string `json:"url"` // 图片url或base64数据
}
type MessageContentPart ¶
type MessageContentPart struct {
Type MessageContentType `json:"type"`
Text string `json:"text,omitempty"`
ImageUrl *MessageContentImage `json:"image_url,omitempty"`
InputAudio *MessageContentAudio `json:"input_audio,omitempty"`
File *MessageContentFile `json:"file,omitempty"`
}
type MessageContentType ¶
type MessageContentType string
const ( MessageContentTypeText MessageContentType = "text" MessageContentTypeImage MessageContentType = "image_url" MessageContentTypeAudio MessageContentType = "input_audio" MessageContentTypeFile MessageContentType = "file" )
type MessageRoleType ¶
type MessageRoleType string
const ( MessageRoleUser MessageRoleType = "user" MessageRoleAssistant MessageRoleType = "assistant" MessageRoleSystem MessageRoleType = "system" MessageRoleTool MessageRoleType = "tool" )
type MessageToolCall ¶
type OPENAPIConfig ¶
type OPENAPIConfig struct {
OpenAPI string `json:"openapi"`
Info OPENAPIInfo `json:"info"`
Paths map[string]OPENAPIPathItem `json:"paths"`
Tags []OPENAPITag `json:"tags"`
}
OPENAPIConfig 定义 OPENAPI 规范的根结构体
func (*OPENAPIConfig) AddToolFunction ¶
func (cfg *OPENAPIConfig) AddToolFunction(toolFunctions []ToolFunction, server string)
AddToolFunction 将 ToolFunction 加入OPENAPIConfig 结构体
type OPENAPIInfo ¶
type OPENAPIInfo struct {
Title string `json:"title"`
Description string `json:"description"`
Version string `json:"version"`
}
OPENAPIInfo 定义 OPENAPIConfig 规范中的 info 部分
type OPENAPIOperation ¶
type OPENAPIOperation struct {
Summary string `json:"summary"`
Description string `json:"description"`
RequestBody OPENAPIRequestBody `json:"requestBody"`
Responses map[string]OPENAPIResponse `json:"responses"`
Servers []OPENAPIServer `json:"servers,omitempty"`
Tags []string `json:"tags,omitempty"`
}
OPENAPIOperation 定义 OPENAPIConfig 规范中的 operation 部分
type OPENAPIPathItem ¶
type OPENAPIPathItem struct {
Post OPENAPIOperation `json:"post"`
}
OPENAPIPathItem 定义 OPENAPIConfig 规范中的 pathItem 部分
type OPENAPIRequestBody ¶
type OPENAPIRequestBody struct {
Required bool `json:"required"`
Content map[string]interface{} `json:"content"`
}
OPENAPIRequestBody 定义 OPENAPIConfig 规范中的 requestBody 部分
type OPENAPIResponse ¶
type OPENAPIResponse struct {
Description string `json:"description"`
}
OPENAPIResponse 定义 OPENAPIConfig 规范中的 response 部分
type OPENAPIServer ¶
OPENAPIServer 定义 OPENAPIConfig 规范中的 servers 部分
type OPENAPITag ¶
type Response ¶
type Response struct {
Err error `json:"-"`
// contains filtered or unexported fields
}
func (*Response) MarshalJSON ¶
func (*Response) UnmarshalJSON ¶
type RunOptionFunc ¶
type RunOptionFunc func(*RunOptions)
RunOptionFunc 运行时选项
func WithAgents ¶
func WithAgents(agents []string) RunOptionFunc
func WithContext ¶
func WithContext(context interface{}) RunOptionFunc
func WithDebug ¶
func WithDebug(debug bool) RunOptionFunc
func WithRuntimeCfg ¶
func WithRuntimeCfg(runtimeCfg AgentRuntimeCfg) RunOptionFunc
func WithSessionData ¶
func WithSessionData(sessionData map[string]interface{}) RunOptionFunc
func WithSessionID ¶
func WithSessionID(sessionID string) RunOptionFunc
func WithSystemPrompt ¶
func WithSystemPrompt(systemPrompt string) RunOptionFunc
type RunOptions ¶
type RunOptions struct {
*Session
RuntimeCfg AgentRuntimeCfg // 运行时配置
Tools []BriefInfo // 用到的关联tool定义
Agents []BriefInfo // 用到的关联Agent定义
Context interface{} // 可选,上下文信息,例如知识库等
// contains filtered or unexported fields
}
func (*RunOptions) AddStep ¶
func (opts *RunOptions) AddStep(src *RunStep)
func (*RunOptions) CheckStepQuit ¶
func (opts *RunOptions) CheckStepQuit() bool
func (*RunOptions) RenderFinalAnswer ¶
func (opts *RunOptions) RenderFinalAnswer() string
func (*RunOptions) UpdateSystemPrompt ¶
func (opts *RunOptions) UpdateSystemPrompt(content string) string
type RunStep ¶
type RunStep struct {
Action string `json:"_action_" yaml:"_action_" description:"该步骤名称" required:"true"` // 该步骤名称
State RunState `` // 该步骤状态:0-初始化(默认),1-执行中,2-成功退出,3-失败退出,4-异常终止
/* 165-byte string literal not displayed */
Question string `` // 该步骤需要解决的问题
/* 132-byte string literal not displayed */
Think string `json:"_think_" yaml:"_think_" description:"该步骤结合用户请求和上下文的思考概述" required:"true"` // 该步骤的推理思考概要
Result string `json:"_result_,omitempty" yaml:"_result_,omitempty" description:"该步骤运行结果文字内容"` // 该步骤完成的输出结果
EndTime time.Time `json:",omitempty" yaml:",omitempty"` // 该步骤完成时间
StepType StepType `json:",omitempty" yaml:",omitempty"` // 该步骤类别
}
type Session ¶
type Session struct {
SessionID string `json:"session_id"`
SessionData map[string]interface{} `json:"session_data"`
// contains filtered or unexported fields
}
func SessionFromContext ¶
func (*Session) GetAllSessionData ¶
func (*Session) GetSessionData ¶
func (*Session) GetSessionID ¶
func (*Session) MergeSessionData ¶
func (*Session) SetSessionData ¶
type Tool ¶
type Tool struct {
Type string `json:"type"`
Function ToolFunction `json:"function"`
}
type ToolEntry ¶
type ToolEntry struct {
Description string
Function interface{} // 方法入口
// contains filtered or unexported fields
}
type ToolFunction ¶
type ToolFunction struct {
BriefInfo
Parameters *jsonschema.Definition `json:"parameters,omitempty" yaml:"parameters,omitempty"`
Strict bool `json:"strict,omitempty" yaml:"strict,omitempty"`
}
type ToolInputBase ¶
type ToolInputBase struct {
Session string `json:"SESSION_" description:"记录session的key名,默认为空,无需设置" required:"false"`
// contains filtered or unexported fields
}
func (*ToolInputBase) GetRawInput ¶
func (t *ToolInputBase) GetRawInput() string
func (*ToolInputBase) GetRawSession ¶
func (t *ToolInputBase) GetRawSession() string
func (*ToolInputBase) SetRawInput ¶
func (t *ToolInputBase) SetRawInput(str string)
func (*ToolInputBase) SetRawSession ¶
func (t *ToolInputBase) SetRawSession(str string)
type ToolMethod ¶
type ToolMethod func(ctx context.Context, input IToolInput, output *Message) (err error)
ToolMethod 工具方法入口签名,Input派生自ToolInputBase
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
agent_sql
command
|
|
|
agent_with_tools
command
|
|
|
llm
command
|
|
|
manus
command
|
|
|
Package jsonschema provides very simple functionality for representing a JSON schema as a (nested) struct.
|
Package jsonschema provides very simple functionality for representing a JSON schema as a (nested) struct. |