llm

package
v0.3.26 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package llm implements LLM data source types for AI model providers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnthropicSource

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

AnthropicSource implements Source + LLMSource for the Anthropic Messages API.

func NewAnthropic

func NewAnthropic(ds types.DataSource, attached bool) (*AnthropicSource, error)

func (*AnthropicSource) Attach

func (s *AnthropicSource) Attach(_ context.Context, _ *db.Pool) error

func (*AnthropicSource) CreateChatCompletion

func (s *AnthropicSource) CreateChatCompletion(ctx context.Context, messages []sources.LLMMessage, opts sources.LLMOptions) (*sources.LLMResult, error)

func (*AnthropicSource) CreateChatCompletionStream added in v0.3.20

func (s *AnthropicSource) CreateChatCompletionStream(ctx context.Context, messages []sources.LLMMessage, opts sources.LLMOptions,
	onEvent func(event *sources.LLMStreamEvent) error) error

func (*AnthropicSource) CreateCompletion

func (s *AnthropicSource) CreateCompletion(ctx context.Context, prompt string, opts sources.LLMOptions) (*sources.LLMResult, error)

func (*AnthropicSource) Definition

func (s *AnthropicSource) Definition() types.DataSource

func (*AnthropicSource) Detach

func (s *AnthropicSource) Detach(_ context.Context, _ *db.Pool) error

func (*AnthropicSource) Engine

func (s *AnthropicSource) Engine() engines.Engine

func (*AnthropicSource) IsAttached

func (s *AnthropicSource) IsAttached() bool

func (*AnthropicSource) ModelInfo

func (s *AnthropicSource) ModelInfo() sources.ModelInfo

func (*AnthropicSource) Name

func (s *AnthropicSource) Name() string

func (*AnthropicSource) ReadOnly

func (s *AnthropicSource) ReadOnly() bool

func (*AnthropicSource) SetDataSourceResolver

func (m *AnthropicSource) SetDataSourceResolver(resolver sources.DataSourceResolver)

type GeminiSource

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

GeminiSource implements Source + LLMSource for the Google Gemini API.

func NewGemini

func NewGemini(ds types.DataSource, attached bool) (*GeminiSource, error)

func (*GeminiSource) Attach

func (s *GeminiSource) Attach(_ context.Context, _ *db.Pool) error

func (*GeminiSource) CreateChatCompletion

func (s *GeminiSource) CreateChatCompletion(ctx context.Context, messages []sources.LLMMessage, opts sources.LLMOptions) (*sources.LLMResult, error)

func (*GeminiSource) CreateChatCompletionStream added in v0.3.20

func (s *GeminiSource) CreateChatCompletionStream(ctx context.Context, messages []sources.LLMMessage, opts sources.LLMOptions,
	onEvent func(event *sources.LLMStreamEvent) error) error

func (*GeminiSource) CreateCompletion

func (s *GeminiSource) CreateCompletion(ctx context.Context, prompt string, opts sources.LLMOptions) (*sources.LLMResult, error)

func (*GeminiSource) Definition

func (s *GeminiSource) Definition() types.DataSource

func (*GeminiSource) Detach

func (s *GeminiSource) Detach(_ context.Context, _ *db.Pool) error

func (*GeminiSource) Engine

func (s *GeminiSource) Engine() engines.Engine

func (*GeminiSource) IsAttached

func (s *GeminiSource) IsAttached() bool

func (*GeminiSource) ModelInfo

func (s *GeminiSource) ModelInfo() sources.ModelInfo

func (*GeminiSource) Name

func (s *GeminiSource) Name() string

func (*GeminiSource) ReadOnly

func (s *GeminiSource) ReadOnly() bool

func (*GeminiSource) SetDataSourceResolver

func (m *GeminiSource) SetDataSourceResolver(resolver sources.DataSourceResolver)

type OpenAISource

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

OpenAISource implements Source + LLMSource for OpenAI-compatible APIs. Covers: OpenAI, Azure OpenAI, Ollama, LM Studio, vLLM, Mistral, Qwen, LiteLLM.

func NewOpenAI

func NewOpenAI(ds types.DataSource, attached bool) (*OpenAISource, error)

func (*OpenAISource) Attach

func (s *OpenAISource) Attach(_ context.Context, _ *db.Pool) error

func (*OpenAISource) CreateChatCompletion

func (s *OpenAISource) CreateChatCompletion(ctx context.Context, messages []sources.LLMMessage, opts sources.LLMOptions) (*sources.LLMResult, error)

func (*OpenAISource) CreateChatCompletionStream added in v0.3.20

func (s *OpenAISource) CreateChatCompletionStream(ctx context.Context, messages []sources.LLMMessage, opts sources.LLMOptions,
	onEvent func(event *sources.LLMStreamEvent) error) error

func (*OpenAISource) CreateCompletion

func (s *OpenAISource) CreateCompletion(ctx context.Context, prompt string, opts sources.LLMOptions) (*sources.LLMResult, error)

func (*OpenAISource) Definition

func (s *OpenAISource) Definition() types.DataSource

func (*OpenAISource) Detach

func (s *OpenAISource) Detach(_ context.Context, _ *db.Pool) error

func (*OpenAISource) Engine

func (s *OpenAISource) Engine() engines.Engine

func (*OpenAISource) IsAttached

func (s *OpenAISource) IsAttached() bool

func (*OpenAISource) ModelInfo

func (s *OpenAISource) ModelInfo() sources.ModelInfo

func (*OpenAISource) Name

func (s *OpenAISource) Name() string

func (*OpenAISource) ReadOnly

func (s *OpenAISource) ReadOnly() bool

func (*OpenAISource) SetDataSourceResolver

func (m *OpenAISource) SetDataSourceResolver(resolver sources.DataSourceResolver)

Jump to

Keyboard shortcuts

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