providers

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 11 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"`
	EmbeddingURL        string  `mapstructure:"embedding_url"`
	ChatCompletionURL   string  `mapstructure:"chat_completion_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"`
	ApiKey              string  `mapstructure:"api_key"`
}

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