azure

package
v1.34.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AzureOpenAiPerThousandTokenCost = map[string]map[string]float64{
	"prompt": {
		"gpt-4o":                 0.005,
		"gpt-4o-2024-05-13":      0.005,
		"gpt-4-turbo":            0.01,
		"gpt-4-turbo-2024-04-09": 0.01,
		"gpt-4":                  0.03,
		"gpt-4-0125-preview":     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,
		"text-embedding-3-large": 0.00013,
		"text-embedding-3-small": 0.00002,
	},
	"completion": {
		"gpt-4o":                 0.015,
		"gpt-4o-2024-05-13":      0.015,
		"gpt-4-turbo":            0.03,
		"gpt-4-turbo-2024-04-09": 0.03,
		"gpt-4":                  0.06,
		"gpt-4-0125-preview":     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