token

package
v0.2602020.1141-preview Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountBetaTokensViaTiktoken

func CountBetaTokensViaTiktoken(req *anthropic.BetaMessageCountTokensParams) (int, error)

CountBetaTokensViaTiktoken approximates token count for OpenAI-style providers using tiktoken

func CountTokensViaTiktoken

func CountTokensViaTiktoken(req *anthropic.MessageCountTokensParams) (int, error)

CountTokensViaTiktoken approximates token count for OpenAI-style providers using tiktoken

func EstimateInputTokens

func EstimateInputTokens(req *openai.ChatCompletionNewParams) (int, error)

EstimateInputTokens estimates input tokens from OpenAI request using tiktoken

func EstimateOutputTokens

func EstimateOutputTokens(content string) int

EstimateOutputTokens estimates output tokens from accumulated content

Types

This section is empty.

Jump to

Keyboard shortcuts

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