zep

package
v0.0.105 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Code    int    `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(baseURL string, optFns ...func(o *Options)) *Client

func (*Client) AddMemory

func (c *Client) AddMemory(ctx context.Context, sessionID string, memory *Memory) (string, error)

AddMemory adds a new memory to a specific session.

func (*Client) DeleteMemory

func (c *Client) DeleteMemory(ctx context.Context, sessionID string) (string, error)

DeleteMemory deletes the memory of a specific session.

func (*Client) GetMemory

func (c *Client) GetMemory(ctx context.Context, sessionID string) (*Memory, error)

GetMemory retrieves memory for 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 HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL