translator

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Translator

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

func NewWithRateLimit added in v1.0.3

func NewWithRateLimit(prov provider.Provider, model, translationLanguage string, rateLimiter *ratelimit.RateLimiter) (*Translator, error)

NewWithRateLimit creates a new Translator with an optional rate limiter

func (*Translator) StreamTranslate

func (t *Translator) StreamTranslate(ctx context.Context, text string, onChunk func(string)) error

func (*Translator) Translate

func (t *Translator) Translate(ctx context.Context, text string) (string, error)

Translate performs a non-streaming translation (fallback)

Jump to

Keyboard shortcuts

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