Documentation ¶
Index ¶
- type APIError
- type Client
- func (c *Client) AddMemory(ctx context.Context, sessionID string, memory *Memory) (string, error)
- func (c *Client) DeleteMemory(ctx context.Context, sessionID string) (string, error)
- func (c *Client) GetMemory(ctx context.Context, sessionID string) (*Memory, error)
- func (c *Client) SearchMessages(ctx context.Context, sessionID string, payload *SearchPayload) (*SearchResult, error)
- type HTTPClient
- type Memory
- type Message
- type Options
- type SearchPayload
- type SearchResult
- type Summary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) DeleteMemory ¶
DeleteMemory deletes the memory of a specific session.
func (*Client) SearchMessages ¶
func (c *Client) SearchMessages(ctx context.Context, sessionID string, payload *SearchPayload) (*SearchResult, error)
SearchMessages searches memory of a specific session based on search payload provided.
type HTTPClient ¶ added in v0.0.24
type Memory ¶
type Memory struct { // A list of message objects, where each message contains a role and content. Messages []Message `json:"messages,omitempty"` // A dictionary containing metadata associated with the memory. Metadata interface{} `json:"metadata,omitempty"` // A Summary object. Summary Summary `json:"summary,omitempty"` // A unique identifier for the memory. UUID string `json:"uuid,omitempty"` // The timestamp when the memory was created. CreatedAt string `json:"created_at,omitempty"` // The token count of the memory. TokenCount int `json:"token_count,omitempty"` }
Represents a memory object with messages, metadata, and other attributes.
type Message ¶
type Message struct { // The content of the message. Content string `json:"content,omitempty"` // The timestamp of when the message was created. CreatedAt string `json:"created_at,omitempty"` // Metadata associated with the message. Metadata interface{} `json:"metadata,omitempty"` // The role of the sender of the message (e.g., "user", "assistant"). Role string `json:"role,omitempty"` // The number of tokens in the message. TokenCount int `json:"token_count,omitempty"` // The unique identifier of the message. UUID string `json:"uuid,omitempty"` }
Message represents a message in a conversation.
type Options ¶ added in v0.0.24
type Options struct { HTTPClient HTTPClient APIKey string Version string }
type SearchPayload ¶
type SearchPayload struct { // Metadata associated with the search query. Metadata map[string]interface{} `json:"metadata,omitempty"` // The text of the search query. Text string `json:"text,omitempty"` }
SearchPayload represents a search payload for querying memory.
type SearchResult ¶
type SearchResult struct { // The distance metric of the search result. Dist float64 `json:"dist,omitempty"` // The message associated with the search result. Message Message `json:"message,omitempty"` // Metadata associated with the search result. Metadata interface{} `json:"metadata,omitempty"` // The summary of the search result. Summary Summary `json:"summary,omitempty"` }
SearchResult represents a search result from querying memory.
type Summary ¶
type Summary struct { // The content of the summary. Content string `json:"content,omitempty"` // The timestamp of when the summary was created. CreatedAt string `json:"created_at,omitempty"` // // Metadata associated with the summary. Metadata interface{} `json:"metadata,omitempty"` // The unique identifier of the most recent message in the conversation. RecentMessageUUID string `json:"recent_message_uuid,omitempty"` // The number of tokens in the summary. TokenCount int `json:"token_count,omitempty"` // The unique identifier of the summary. UUID string `json:"uuid,omitempty"` }
Summary represents a summary of a conversation.
Click to show internal directories.
Click to hide internal directories.