Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigHTTP ¶
type ConfigHTTP struct {
BaseURL string
}
ConfigHTTP contains configuration for the HTTP client.
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
HTTPClient implements the Tokenizer interface using HTTP calls to the tokenizer service.
func (*HTTPClient) CountTokens ¶
CountTokens implements the Tokenizer interface using the Tokenize method.
func (*HTTPClient) OptimalModel ¶
OptimalModel returns the optimal model for tokenization based on the given model. This is a client-side implementation mirroring the server's logic.
type MockTokenizer ¶
MockTokenizer is a mock implementation of the Tokenizer interface.
func (MockTokenizer) CountTokens ¶
func (MockTokenizer) OptimalModel ¶
type Tokenizer ¶
type Tokenizer interface {
Tokenize(ctx context.Context, modelName string, prompt string) ([]int, error)
CountTokens(ctx context.Context, modelName string, prompt string) (int, error)
OptimalModel(ctx context.Context, baseModel string) (string, error)
}
func NewHTTPClient ¶
NewHTTPClient creates a new HTTP-based tokenizer client.
func WithActivityTracker ¶
func WithActivityTracker(client Tokenizer, tracker activitytracker.ActivityTracker) Tokenizer
WithActivityTracker decorates the given Tokenizer with activity tracking
Click to show internal directories.
Click to hide internal directories.