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(maxTokens int) contracts.ITokenManagement
NewTokenManager creates a new token manager
func ProviderFactory ¶
func ProviderFactory(config *AIProviderConfig) (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"`
BufferingTheme string `mapstructure:"buffering_theme"`
}
type Tokenizer ¶ added in v1.3.0
type Tokenizer struct{}
Tokenizer is a custom tokenizer implementation
func (*Tokenizer) CountTokens ¶ added in v1.3.0
CountTokens returns the number of tokens in the input text.
Click to show internal directories.
Click to hide internal directories.