adapters

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 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 InternalConversationPersistence

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

func NewInternalConversationPersistence

func NewInternalConversationPersistence(svc *conversation.ConversationService, projectID uuid.UUID) *InternalConversationPersistence

func (*InternalConversationPersistence) LoadMessages

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

LoadMessages implements core.ChatHistory

func (*InternalConversationPersistence) NewRunID added in v0.1.11

NewRunID generates a unique ID for a run

func (*InternalConversationPersistence) SaveMessages

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

SaveMessages implements core.ChatHistory

func (*InternalConversationPersistence) SaveSummary

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

SaveSummary

type InternalLLMGateway

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

InternalLLMGateway uses the internal LLMGatewayAdapter for server-side use. This is used within the agent-server where we have direct access to services. It handles virtual key resolution and provider configuration from the database.

func NewInternalLLMGateway

func NewInternalLLMGateway(gw *gateway.LLMGateway, key string) *InternalLLMGateway

NewInternalLLMGateway creates a provider using the internal gateway. The key can be a virtual key (sk-uno-xxx) which will be resolved to actual API keys, or a direct API key for the provider.

func (*InternalLLMGateway) NewChatCompletion

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

func (*InternalLLMGateway) NewEmbedding

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

func (*InternalLLMGateway) NewResponses

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

func (*InternalLLMGateway) NewSpeech added in v0.1.11

func (p *InternalLLMGateway) NewSpeech(ctx context.Context, providerName llm.ProviderName, req *speech.Request) (*speech.Response, error)

func (*InternalLLMGateway) NewStreamingChatCompletion

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

func (*InternalLLMGateway) NewStreamingResponses

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

func (*InternalLLMGateway) NewStreamingSpeech added in v0.1.11

func (p *InternalLLMGateway) NewStreamingSpeech(ctx context.Context, providerName llm.ProviderName, req *speech.Request) (chan *speech.ResponseChunk, error)

type InternalPromptPersistence

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

InternalPromptPersistence implements core.SystemPromptProvider using internal services

func NewInternalPromptPersistence

func NewInternalPromptPersistence(svc *prompt.PromptService, projectID uuid.UUID, promptID uuid.UUID, version int) *InternalPromptPersistence

func (*InternalPromptPersistence) LoadPrompt

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

type ServiceConfigStore

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

ServiceConfigStore implements gateway.ConfigStore using provider and virtual key services. This is used server-side where we have access to the database services. It maintains an in-memory cache that is automatically updated via PostgreSQL LISTEN/NOTIFY.

func NewServiceConfigStore

func NewServiceConfigStore(providerSvc *provider.ProviderService, virtualKeySvc *virtual_key.VirtualKeyService) *ServiceConfigStore

NewServiceConfigStore creates a config store backed by database services.

func (*ServiceConfigStore) GetProviderConfig

func (s *ServiceConfigStore) GetProviderConfig(providerName llm.ProviderName) (*gateway.ProviderConfig, error)

func (*ServiceConfigStore) GetVirtualKey

func (s *ServiceConfigStore) GetVirtualKey(secretKey string) (*gateway.VirtualKeyConfig, error)

func (*ServiceConfigStore) SubscribeToPubSub

func (s *ServiceConfigStore) SubscribeToPubSub(ps *pubsub.PubSub)

SubscribeToPubSub subscribes to configuration change notifications. This should be called after the pubsub is started.

Jump to

Keyboard shortcuts

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