Ai
1 Star 0 Fork 0

tmfll/mcp-golang

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
prompt_api.go 905 Bytes
一键复制 编辑 原始数据 按行查看 历史
package mcp_golang
type PromptMessage struct {
Content *Content `json:"content" yaml:"content" mapstructure:"content"`
Role Role `json:"role" yaml:"role" mapstructure:"role"`
}
func NewPromptMessage(content *Content, role Role) *PromptMessage {
return &PromptMessage{
Content: content,
Role: role,
}
}
// The server's response to a prompts/get request from the client.
type PromptResponse struct {
// An optional description for the prompt.
Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"`
// Messages corresponds to the JSON schema field "messages".
Messages []*PromptMessage `json:"messages" yaml:"messages" mapstructure:"messages"`
}
func NewPromptResponse(description string, messages ...*PromptMessage) *PromptResponse {
return &PromptResponse{
Description: &description,
Messages: messages,
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tmfll/mcp-golang.git
git@gitee.com:tmfll/mcp-golang.git
tmfll
mcp-golang
mcp-golang
Chrisbattarbee-patch-1

搜索帮助