providers

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChatProviderFactory added in v1.7.4

func ChatProviderFactory(config *AIProviderConfig, tokenManagement contracts.ITokenManagement) (contracts.IChatAIProvider, error)

ChatProviderFactory creates a Provider based on the given provider config.

func EmbeddingsProviderFactory added in v1.7.4

func EmbeddingsProviderFactory(config *AIProviderConfig, tokenManagement contracts.ITokenManagement) (contracts.IEmbeddingAIProvider, error)

EmbeddingsProviderFactory creates a Provider based on the given provider config.

func NewChatHistory added in v1.3.0

func NewChatHistory() contracts.IChatHistory

func NewTokenManager added in v1.3.0

func NewTokenManager() contracts.ITokenManagement

NewTokenManager creates a new token manager

Types

type AIProviderConfig

type AIProviderConfig struct {
	ChatProviderName       string  `mapstructure:"chat_provider_name"`
	EmbeddingsProviderName string  `mapstructure:"embeddings_provider_name"`
	ChatBaseURL            string  `mapstructure:"chat_base_url"`
	EmbeddingsBaseURL      string  `mapstructure:"embeddings_base_url"`
	EmbeddingsModel        string  `mapstructure:"embeddings_model"`
	ChatModel              string  `mapstructure:"chat_model"`
	Stream                 bool    `mapstructure:"stream"`
	Temperature            float32 `mapstructure:"temperature"`
	EncodingFormat         string  `mapstructure:"encoding_format"`
	MaxTokens              int     `mapstructure:"max_tokens"`
	Threshold              float64 `mapstructure:"threshold"`
	ChatApiKey             string  `mapstructure:"chat_api_key"`
	EmbeddingsApiKey       string  `mapstructure:"embeddings_api_key"`
	ChatApiVersion         string  `mapstructure:"chat_api_version"`
	EmbeddingsApiVersion   string  `mapstructure:"embeddings_api_version"`
}

type Models added in v1.5.0

type Models struct {
	ModelDetails map[string]details `json:"models"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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