-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprompt.go
57 lines (48 loc) · 1.65 KB
/
prompt.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package mcp
import "errors"
// Prompt represents a server-side prompt template.
type Prompt struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Arguments []PromptArgument `json:"arguments,omitempty"`
}
// PromptArgument defines a customizable parameter for a prompt.
type PromptArgument struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Required bool `json:"required,omitempty"`
}
// PromptContent contains the fully resolved prompt messages.
type PromptContent struct {
Description string `json:"description,omitempty"`
Messages []PromptMessage `json:"messages"`
}
// PromptMessage represents a message in a prompt conversation.
type PromptMessage struct {
Role string `json:"role"`
Content Content `json:"content"`
}
// Content defines multi-modal message content.
type Content struct {
Type string `json:"type"`
Text string `json:"text,omitempty"`
Data string `json:"data,omitempty"`
MimeType string `json:"mimeType,omitempty"`
Resource *Resource `json:"resource,omitempty"`
}
// Resource represents embedded resource content.
type Resource struct {
URI string `json:"uri"`
MimeType string `json:"mimeType"`
Text string `json:"text,omitempty"`
Blob string `json:"blob,omitempty"`
}
// PaginatedPrompts contains a paginated list of prompts.
type PaginatedPrompts struct {
Prompts []Prompt `json:"prompts"`
NextCursor string `json:"nextCursor,omitempty"`
}
var (
ErrPromptNotFound = errors.New("prompt not found")
ErrMissingRequiredArgument = errors.New("missing required argument")
)