Skip to content

API Reference

Complete reference for all public exports from tsfm.

Classes

ClassDescription
SystemLanguageModelOn-device model access and availability
LanguageModelSessionConversation session with all generation methods
GenerationSchemaSchema builder for structured output
ToolAbstract base class for tool calling
TranscriptSession history export and import

Types and Enums

ExportDescription
GenerationOptionsOptions for temperature, tokens, sampling
SamplingModeGreedy or random sampling strategies
GenerationGuideOutput constraints for schema properties
GeneratedContentStructured generation result
ErrorsError hierarchy and error codes

Installation

ts
import {
  SystemLanguageModel,
  LanguageModelSession,
  GenerationSchema,
  GenerationGuide,
  Tool,
  Transcript,
  SamplingMode,
} from "tsfm-sdk";

Released under the Apache 2.0 License.