memory

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

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
}

Client is an in-memory implementation of conversation.Client. It is intended for tests and local runs without SQL/Datly.

func New

func New() *Client

func (*Client) DeleteConversation

func (c *Client) DeleteConversation(_ context.Context, id string) error

DeleteConversation removes a conversation and its dependent messages in-memory.

func (*Client) DeleteMessage added in v0.2.2

func (c *Client) DeleteMessage(_ context.Context, conversationID, messageID string) error

DeleteMessage removes a message by id from indexes and the conversation transcript.

func (*Client) EnsureConversation

func (c *Client) EnsureConversation(id string, opts ...func(*convcli.MutableConversation)) error

EnsureConversation creates a conversation if it does not exist.

func (*Client) GetConversation

func (c *Client) GetConversation(ctx context.Context, id string, options ...convcli.Option) (*convcli.Conversation, error)

GetConversation returns a single conversation with optional filtering.

func (*Client) GetConversations

func (c *Client) GetConversations(ctx context.Context, input *convcli.Input) ([]*convcli.Conversation, error)

GetConversations returns all conversations without transcript for summary.

func (*Client) GetMessage

func (c *Client) GetMessage(_ context.Context, id string, _ ...convcli.Option) (*convcli.Message, error)

GetMessage returns a message by id.

func (*Client) GetMessageByElicitation

func (c *Client) GetMessageByElicitation(_ context.Context, conversationID, elicitationID string) (*convcli.Message, error)

GetMessageByElicitation returns a message matching the given conversation and elicitation IDs.

func (*Client) GetPayload

func (c *Client) GetPayload(_ context.Context, id string) (*convcli.Payload, error)

GetPayload returns a payload by id.

func (*Client) PatchConversations

func (c *Client) PatchConversations(ctx context.Context, in *convcli.MutableConversation) error

PatchConversations upserts conversations and merges fields according to Has flags.

func (*Client) PatchMessage

func (c *Client) PatchMessage(_ context.Context, in *convcli.MutableMessage) error

PatchMessage upserts a message and places it into its conversation/turn transcript.

func (*Client) PatchModelCall

func (c *Client) PatchModelCall(_ context.Context, in *convcli.MutableModelCall) error

PatchModelCall upserts/attaches model-call to a message.

func (*Client) PatchPayload

func (c *Client) PatchPayload(_ context.Context, p *convcli.MutablePayload) error

PatchPayload upserts a payload.

func (*Client) PatchToolCall

func (c *Client) PatchToolCall(_ context.Context, in *convcli.MutableToolCall) error

PatchToolCall upserts/attaches tool-call to a message.

func (*Client) PatchTurn

func (c *Client) PatchTurn(_ context.Context, in *convcli.MutableTurn) error

PatchTurn upserts a turn and attaches to a conversation.

Jump to

Keyboard shortcuts

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