forked from metoro-io/mcp-golang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprompt_api.go
29 lines (24 loc) · 905 Bytes
/
prompt_api.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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,
}
}