provider

package
v1.31.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: MIT Imports: 1 Imported by: 0

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