Counting and truncating a prompt's tokens (Effect's Tokenizer).
Re-exports#
- From
pyfect.ai.ai_error:AiError
Types#
| Type | Definition | Description |
|---|---|---|
Tokenize | type Tokenize = Callable[[P.Prompt], Effect[Sequence[int], AiError]] |
Classes#
Functions#
make#
make(*, tokenize) -> Service| Parameter | Type | Description |
|---|---|---|
tokenize | Tokenize |
Returns Service
def make(*, tokenize: Tokenize) -> Service:
return Service(tokenize)