Skip to content

@codesoul-co/hypha-inference / prefix

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

SymbolKindSignatureDescription
DefaultPrefixSegmenterclassnew DefaultPrefixSegmenter(): DefaultPrefixSegmenterDefault Prefix Segmenter class with 2 public constructor or member entries; its exact declarations are listed below.
estimateTokenCountfunctionestimateTokenCount(content: string): numberEstimate 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

MemberKindSignatureDescription
constructorconstructor(): DefaultPrefixSegmenterCreates an instance of this class.
segmentmethodsegment(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): number

Parameters

ParameterTypeRequiredDescription
contentstringYesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: number
  • Description: The return contract is defined by the type shown above.