Documentation
¶
Index ¶
- Constants
- func FindOrCreateConversation(ctx context.Context, app core.App, ownerID, clientID string) (*core.Record, error)
- func Hydrate(msgs []Message) []llm.Message
- func PersistMessage(ctx context.Context, app core.App, conversation *core.Record, msg Message, ...) error
- func ToolResultText(name, output string) string
- type Message
- type MessagePart
- type ToolPartData
Constants ¶
View Source
const ( CollectionConversation = "chat_conversation" CollectionMessage = "chat_message" )
View Source
const (
PartTypeText = "text"
)
Variables ¶
This section is empty.
Functions ¶
func PersistMessage ¶
func ToolResultText ¶
Types ¶
type Message ¶
type Message struct {
ID string `json:"id"`
Role string `json:"role"`
Parts []MessagePart `json:"parts"`
}
func ExtractNewMessages ¶
type MessagePart ¶
type MessagePart struct {
Type string `json:"type"`
Text string `json:"text,omitempty"`
Data json.RawMessage `json:"data,omitempty"`
}
func TextPart ¶
func TextPart(text string) MessagePart
type ToolPartData ¶
type ToolPartData struct {
ToolCallID string `json:"toolCallId"`
ToolName string `json:"toolName"`
Input json.RawMessage `json:"input"`
Output string `json:"output"`
}
Click to show internal directories.
Click to hide internal directories.