providers

package
v1.7.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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

func ProviderFactory

func ProviderFactory(config *AIProviderConfig, tokenManagement contracts.ITokenManagement) (contracts.IAIProvider, error)

ProviderFactory creates a Provider based on the given provider config.

Types

type AIProviderConfig

type AIProviderConfig struct {
	ProviderName         string  `mapstructure:"provider_name"`
	BaseURL              string  `mapstructure:"base_url"`
	EmbeddingModel       string  `mapstructure:"embedding_model"`
	ChatCompletionModel  string  `mapstructure:"chat_completion_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