API Reference
Complete reference for all public exports from tsfm.
Classes
| Class | Description |
|---|---|
| SystemLanguageModel | On-device model access and availability |
| LanguageModelSession | Conversation session with all generation methods |
| GenerationSchema | Schema builder for structured output |
| Tool | Abstract base class for tool calling |
| Transcript | Session history export and import |
Types and Enums
| Export | Description |
|---|---|
| GenerationOptions | Options for temperature, tokens, sampling |
| SamplingMode | Greedy or random sampling strategies |
| GenerationGuide | Output constraints for schema properties |
| GeneratedContent | Structured generation result |
| Errors | Error hierarchy and error codes |
Installation
ts
import {
SystemLanguageModel,
LanguageModelSession,
GenerationSchema,
GenerationGuide,
Tool,
Transcript,
SamplingMode,
} from "tsfm-sdk";