provider

package
v1.40.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: MIT Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EstimateCostWithCostMap added in v1.28.0

func EstimateCostWithCostMap(model string, tks int, div float64, costMap map[string]float64) (float64, error)

func EstimateTotalCostWithCostMaps added in v1.28.0

func EstimateTotalCostWithCostMaps(model string, ptks, ctks int, div float64, promptCostMap map[string]float64, completionCostMap map[string]float64) (float64, error)

Types

type CostMap added in v1.15.0

type CostMap struct {
	PromptCostPerModel     map[string]float64 `json:"promptCostPerModel"`
	CompletionCostPerModel map[string]float64 `json:"completionCostPerModel"`
	EmbeddingsCostPerModel map[string]float64 `json:"embeddingsCostPerModel"`
}

type Provider

type Provider string
const (
	OpenAiProvider Provider = "openai"
)

type Setting added in v1.0.0

type Setting struct {
	CreatedAt     int64             `json:"createdAt"`
	UpdatedAt     int64             `json:"updatedAt"`
	Provider      string            `json:"provider"`
	Setting       map[string]string `json:"setting,omitempty"`
	Id            string            `json:"id"`
	Name          string            `json:"name"`
	AllowedModels []string          `json:"allowedModels"`
	CostMap       *CostMap          `json:"costMap"`
}

func (*Setting) GetParam added in v1.7.0

func (s *Setting) GetParam(key string) string

type UpdateSetting added in v1.4.1

type UpdateSetting struct {
	UpdatedAt     int64             `json:"updatedAt"`
	Setting       map[string]string `json:"setting,omitempty"`
	Name          *string           `json:"name"`
	AllowedModels *[]string         `json:"allowedModels,omitempty"`
	CostMap       *CostMap          `json:"costMap,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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