Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig config
Functions ¶
func WithConfig ¶
Types ¶
type Option ¶ added in v0.0.9
type Option func(*Tool)
func WithDescription ¶ added in v0.0.9
func WithFunction ¶ added in v0.0.9
func WithParameters ¶ added in v0.0.9
type Parameter ¶
type Parameter struct {
Name string
Label string
HumanDescription string
Placeholder string
Type ParameterType
LLMDescrition string
Required bool
Default any
Min float64
Max float64
Options []string
}
Parameter 用于描述API参数的结构体
type ParameterType ¶
type ParameterType string
ParameterType 枚举类型
const ( Array ParameterType = "array" String ParameterType = "string" Number ParameterType = "number" Boolean ParameterType = "boolean" Select ParameterType = "select" SecretInput ParameterType = "secret-input" File ParameterType = "file" )
type Tool ¶
type Tool struct {
ID int64 // 引用的工具ID
Kind string // 引用的工具类型
Name string
Description string
Parameters []Parameter `json:"parameters,omitempty"` // 参数,可选
AuthenticationType string
AuthenticationValue string
ServerURL string `json:"server_url"` // 服务器URL
Method string `json:"method"` // 方法
Body string `json:"body"` // body
Invokex func(context.Context, map[string]any) (string, error)
}
Click to show internal directories.
Click to hide internal directories.