@codesoul-co/hypha-inference / prefix
- Package index:
@codesoul-co/hypha-inference - Source:
packages/inference/src/prefix.ts - Exports: 2
Using this module
Use the Prefix module for using the public contracts and operations for this capability boundary. It exports 1 class, 1 function.
Import from the package entrypoint
ts
import {
DefaultPrefixSegmenter,
estimateTokenCount,
} from '@codesoul-co/hypha-inference';Usage patterns
- The module exposes 1 class as constructable runtime implementations. Each symbol entry lists its constructor and public methods.
- The module exposes 1 function as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
DefaultPrefixSegmenter | class | new DefaultPrefixSegmenter(): DefaultPrefixSegmenter | Default Prefix Segmenter class with 2 public constructor or member entries; its exact declarations are listed below. |
estimateTokenCount | function | estimateTokenCount(content: string): number | Estimate Token Count function with 1 public call signature; parameters and return types are listed below. |
DefaultPrefixSegmenter
Default Prefix Segmenter class with 2 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { DefaultPrefixSegmenter } from '@codesoul-co/hypha-inference'; - Source module:
prefix
Declaration
text
export declare class DefaultPrefixSegmenter implements PrefixSegmenter {
segment(prompt: CompiledPrompt): Promise<PrefixSegmentationResult>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
constructor | constructor | (): DefaultPrefixSegmenter | Creates an instance of this class. |
segment | method | segment(prompt: CompiledPrompt): Promise<PrefixSegmentationResult> | Public method; parameters and return type are shown in the signature. |
estimateTokenCount
Estimate Token Count function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { estimateTokenCount } from '@codesoul-co/hypha-inference'; - Source module:
prefix
Declaration
text
export declare function estimateTokenCount(content: string): number;Call signature
text
estimateTokenCount(content: string): numberParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
content | string | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
number - Description: The return contract is defined by the type shown above.
