Documentation
¶
Overview ¶
Package builtin 提供框架内置的工具(如 get_weather)。
内置工具与业务解耦:All() 汇总全部工具供统一注册。新增内置工具时,在本包 新建一个文件实现该工具,并把它的构造函数追加到 All(),即可自动接入各 Provider 的 tool-call 链路,无需改动上层注册逻辑。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetWeather ¶
GetWeather 返回一个「获取天气」工具(当前返回模拟数据,供演示 / 联调)。
同一城市返回确定的温度,便于测试断言。后续接入真实天气服务时,只需替换 mockWeather 的内部实现,工具定义与签名保持不变。
Types ¶
type GetWeatherInput ¶
type GetWeatherInput struct {
City string `json:"city"` // 城市名(必填)
Unit string `json:"unit"` // 温度单位:celsius / fahrenheit,默认 celsius
}
GetWeatherInput 是 get_weather 工具的入参。
Click to show internal directories.
Click to hide internal directories.