adapters

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExternalConversationPersistence

type ExternalConversationPersistence struct {
	Endpoint string
	// contains filtered or unexported fields
}

func NewExternalConversationPersistence

func NewExternalConversationPersistence(endpoint string, projectID uuid.UUID) *ExternalConversationPersistence

func (*ExternalConversationPersistence) LoadMessages

func (p *ExternalConversationPersistence) LoadMessages(ctx context.Context, namespace string, previousMessageId string) ([]conversation.ConversationMessage, error)

LoadMessages implements core.ChatHistory

func (*ExternalConversationPersistence) SaveMessages

func (p *ExternalConversationPersistence) SaveMessages(ctx context.Context, namespace, msgId, previousMsgId, conversationId string, messages []responses.InputMessageUnion, meta map[string]any) error

SaveMessages implements core.ChatHistory

func (*ExternalConversationPersistence) SaveSummary

func (p *ExternalConversationPersistence) SaveSummary(ctx context.Context, namespace string, summary conversation.Summary) error

SaveSummary

type ExternalLLMGateway

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

ExternalLLMGateway calls the agent-server's gateway API via HTTP. Use this when you're an SDK consumer calling the agent-server remotely.

func NewExternalLLMGateway

func NewExternalLLMGateway(endpoint, virtualKey string) *ExternalLLMGateway

NewExternalLLMGateway creates a provider that calls agent-server via HTTP.

func (*ExternalLLMGateway) NewChatCompletion

func (p *ExternalLLMGateway) NewChatCompletion(ctx context.Context, providerName llm.ProviderName, req *chat_completion.Request) (*chat_completion.Response, error)

func (*ExternalLLMGateway) NewEmbedding

func (p *ExternalLLMGateway) NewEmbedding(ctx context.Context, providerName llm.ProviderName, req *embeddings.Request) (*embeddings.Response, error)

func (*ExternalLLMGateway) NewResponses

func (p *ExternalLLMGateway) NewResponses(ctx context.Context, providerName llm.ProviderName, req *responses.Request) (*responses.Response, error)

func (*ExternalLLMGateway) NewStreamingChatCompletion

func (p *ExternalLLMGateway) NewStreamingChatCompletion(ctx context.Context, providerName llm.ProviderName, req *chat_completion.Request) (chan *chat_completion.ResponseChunk, error)

func (*ExternalLLMGateway) NewStreamingResponses

func (p *ExternalLLMGateway) NewStreamingResponses(ctx context.Context, providerName llm.ProviderName, req *responses.Request) (chan *responses.ResponseChunk, error)

type ExternalPromptPersistence

type ExternalPromptPersistence struct {
	Endpoint string
	// contains filtered or unexported fields
}

func NewExternalPromptPersistence

func NewExternalPromptPersistence(endpoint string, projectID uuid.UUID, name string, label string) *ExternalPromptPersistence

func (*ExternalPromptPersistence) LoadPrompt

func (p *ExternalPromptPersistence) LoadPrompt(ctx context.Context) (string, error)

type InMemoryConversationPersistence

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

InMemoryConversationPersistence is a simple in-memory implementation of ConversationPersistenceAdapter

func NewInMemoryConversationPersistence

func NewInMemoryConversationPersistence() *InMemoryConversationPersistence

NewInMemoryConversationPersistence creates a new in-memory conversation persistence adapter

func (*InMemoryConversationPersistence) Clear

Clear removes all stored data (useful for testing)

func (*InMemoryConversationPersistence) GetMessageCount

func (p *InMemoryConversationPersistence) GetMessageCount() int

GetMessageCount returns the total number of messages (useful for testing)

func (*InMemoryConversationPersistence) GetThreadCount

func (p *InMemoryConversationPersistence) GetThreadCount() int

GetThreadCount returns the total number of threads (useful for testing)

func (*InMemoryConversationPersistence) LoadMessages

func (p *InMemoryConversationPersistence) LoadMessages(ctx context.Context, namespace string, previousMessageID string) ([]conversation.ConversationMessage, error)

LoadMessages retrieves all messages up to and including the previousMessageID

func (*InMemoryConversationPersistence) SaveMessages

func (p *InMemoryConversationPersistence) SaveMessages(ctx context.Context, namespace, msgId, previousMsgId, conversationId string, messages []responses.InputMessageUnion, meta map[string]any) error

SaveMessages saves messages with support for conversations and threads

func (*InMemoryConversationPersistence) SaveSummary

func (p *InMemoryConversationPersistence) SaveSummary(ctx context.Context, namespace string, summary conversation.Summary) error

SaveSummary saves a conversation summary for a thread

type LangfusePromptPersistence

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

func NewLangfusePromptProvider

func NewLangfusePromptProvider(endpoint, username, password string, name string, label string) *LangfusePromptPersistence

func (*LangfusePromptPersistence) LoadPrompt

func (p *LangfusePromptPersistence) LoadPrompt(ctx context.Context) (string, error)

type Response

type Response[T any] struct {
	Error   bool   `json:"error"`
	Message string `json:"message"`
	Data    T      `json:"data"`
	Status  int    `json:"status"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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