azure

package
v1.25.2 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 5 Imported by: 0

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