azure

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 5 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

View Source
var AzureOpenAiPerThousandTokenCost = map[string]map[string]float64{
	"prompt": {
		"gpt-4":                 0.03,
		"gpt-4-32k":             0.06,
		"gpt-4-vision":          0.06,
		"gpt-35-turbo":          0.0015,
		"gpt-35-turbo-instruct": 0.0015,
		"gpt-35-turbo-16k":      0.003,
	},
	"embeddings": {
		"ada": 0.0001,
	},
	"completion": {
		"gpt-4":                 0.06,
		"gpt-4-32k":             0.12,
		"gpt-4-vision":          0.12,
		"gpt-35-turbo":          0.002,
		"gpt-35-turbo-instruct": 0.002,
		"gpt-35-turbo-16k":      0.004,
	},
}

Functions

func Count

func Count(model string, input string) (int, error)

Types

type CostEstimator

type CostEstimator struct {
	// contains filtered or unexported fields
}

func NewCostEstimator

func NewCostEstimator() *CostEstimator

func (*CostEstimator) EstimateChatCompletionStreamCostWithTokenCounts

func (ce *CostEstimator) EstimateChatCompletionStreamCostWithTokenCounts(model string, content string) (int, float64, error)

func (*CostEstimator) EstimateCompletionCost

func (ce *CostEstimator) EstimateCompletionCost(model string, tks int) (float64, error)

func (*CostEstimator) EstimateEmbeddingsCost

func (ce *CostEstimator) EstimateEmbeddingsCost(r *goopenai.EmbeddingRequest) (float64, error)

func (*CostEstimator) EstimateEmbeddingsInputCost

func (ce *CostEstimator) EstimateEmbeddingsInputCost(model string, tks int) (float64, error)

func (*CostEstimator) EstimatePromptCost

func (ce *CostEstimator) EstimatePromptCost(model string, tks int) (float64, error)

func (*CostEstimator) EstimateTotalCost

func (ce *CostEstimator) EstimateTotalCost(model string, promptTks, completionTks int) (float64, error)

Jump to

Keyboard shortcuts

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