Documentation
¶
Index ¶
- type OpenAIEmbeddingProvider
- func (o *OpenAIEmbeddingProvider) BatchSize() int
- func (o *OpenAIEmbeddingProvider) Dimensions() int
- func (o *OpenAIEmbeddingProvider) EmbedChunks(ctx context.Context, chunks []provider.EmbedRequest) provider.BatchEmbedResult
- func (o *OpenAIEmbeddingProvider) EmbedQuery(ctx context.Context, query string) []float32
- func (o *OpenAIEmbeddingProvider) MaxTokens() int
- func (o *OpenAIEmbeddingProvider) Name() string
- func (o *OpenAIEmbeddingProvider) Validate(ctx context.Context) error
- type OpenAILLMProvider
- func (o *OpenAILLMProvider) Call(ctx context.Context, req provider.LLMRequest) (*provider.LLMResult, *provider.LLMError)
- func (o *OpenAILLMProvider) Name() string
- func (o *OpenAILLMProvider) Stream(ctx context.Context, req provider.LLMRequest, onChunk func(string)) (*provider.LLMResult, *provider.LLMError)
- func (o *OpenAILLMProvider) Validate(ctx context.Context) error
- type OpenAIModelSpec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OpenAIEmbeddingProvider ¶
type OpenAIEmbeddingProvider struct {
// contains filtered or unexported fields
}
OpenAIEmbeddingProvider implements the EmbeddingProvider interface for OpenAI
func NewOpenAIEmbeddingProvider ¶
func NewOpenAIEmbeddingProvider(apiKey, model string, dimensions int) (*OpenAIEmbeddingProvider, error)
NewOpenAIEmbeddingProvider creates a new OpenAI embedding provider
func (*OpenAIEmbeddingProvider) BatchSize ¶
func (o *OpenAIEmbeddingProvider) BatchSize() int
BatchSize returns the maximum batch size
func (*OpenAIEmbeddingProvider) Dimensions ¶
func (o *OpenAIEmbeddingProvider) Dimensions() int
Dimensions returns the embedding vector dimensions
func (*OpenAIEmbeddingProvider) EmbedChunks ¶
func (o *OpenAIEmbeddingProvider) EmbedChunks(ctx context.Context, chunks []provider.EmbedRequest) provider.BatchEmbedResult
EmbedChunks embeds multiple chunks in a batch
func (*OpenAIEmbeddingProvider) EmbedQuery ¶
func (o *OpenAIEmbeddingProvider) EmbedQuery(ctx context.Context, query string) []float32
EmbedQuery embeds a single query for search
func (*OpenAIEmbeddingProvider) MaxTokens ¶
func (o *OpenAIEmbeddingProvider) MaxTokens() int
MaxTokens returns the maximum token limit for the model
func (*OpenAIEmbeddingProvider) Name ¶
func (o *OpenAIEmbeddingProvider) Name() string
Name returns the provider name
type OpenAILLMProvider ¶
type OpenAILLMProvider struct {
// contains filtered or unexported fields
}
OpenAILLMProvider implements the LLMProvider interface for OpenAI
func NewOpenAILLMProvider ¶
func NewOpenAILLMProvider(apiKey, model, fallbackModel string) (*OpenAILLMProvider, error)
NewOpenAILLMProvider creates a new OpenAI LLM provider
func (*OpenAILLMProvider) Call ¶
func (o *OpenAILLMProvider) Call(ctx context.Context, req provider.LLMRequest) (*provider.LLMResult, *provider.LLMError)
Call makes a non-streaming LLM request
func (*OpenAILLMProvider) Name ¶
func (o *OpenAILLMProvider) Name() string
Name returns the provider name
type OpenAIModelSpec ¶
OpenAIModelSpec holds default specifications for an OpenAI embedding model