builtin

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package builtin 提供框架内置的技能(如 echo)。

内置技能与业务解耦:All() 汇总全部技能供统一注册。新增内置技能时,在本包 新建一个文件实现该技能,并把它的构造函数追加到 All(),即可自动接入各 Provider 的 skill-call 链路,无需改动上层注册逻辑。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All() []skill.Skill

All 返回框架内置的全部技能。新增内置技能时在此追加。

func Echo

func Echo() skill.Skill

Echo 是一个示例技能:原样返回输入文本。

它演示了 Func 型(强类型函数)技能的最小实现,同时作为 SkillRunner / Invoker 的测试目标。

func GetWeather

func GetWeather() skill.Skill

GetWeather 返回一个「获取天气」技能(当前返回模拟数据,供演示 / 联调)。

同一城市返回确定的温度,便于测试断言。后续接入真实天气服务时,只需替换 mockWeather 的内部实现,技能定义与签名保持不变。

func ReviewGuide

func ReviewGuide() skill.Skill

ReviewGuide 返回一个「代码评审指南」静态技能。

它演示了 Static 型(纯指令型)技能:没有可执行逻辑(无 fn),只有一段 markdown 指令正文。这类技能的 Invoke 会原样返回 Instructions,主要用于把「教模型怎么 做」的上下文注入到 system prompt,供模型在没有 function calling 时也能感知。

Types

type GetWeatherInput

type GetWeatherInput struct {
	City string `json:"city"` // 城市名(必填)
	Unit string `json:"unit"` // 温度单位:celsius / fahrenheit,默认 celsius
}

GetWeatherInput 是 get_weather 技能的入参。

type GetWeatherOutput

type GetWeatherOutput struct {
	City        string  `json:"city"`
	Temperature float64 `json:"temperature"`
	Unit        string  `json:"unit"`
	Condition   string  `json:"condition"`
	Humidity    int     `json:"humidity"`
}

GetWeatherOutput 是 get_weather 技能的返回。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL