AiBrow
  • Welcome
  • AiBrow web API
    • Getting started
    • Feature comparison
  • AiBrow Extension
    • Getting started
    • Web polyfill
    • Helping users install the AiBrow extension
    • Remove the on-device helper or models
  • Examples
    • Embedding API
    • LanguageDetector API
    • LanguageModel API
    • Rewriter API
    • Summarizer API
    • Translator API
    • Writer API
    • Using different models
    • Model download feedback
    • Getting JSON output
  • API Reference
    • AI
      • AIBrow
      • BrowserAI
      • AIBrowWeb
    • AiBrow
      • Embedding
      • LanguageDetector
      • LanguageModel
      • Rewriter
      • Summarizer
      • Translator
      • Writer
    • Types
      • AIModelAvailability
      • AIModelCoreCompatibility
      • AIModelDtype
      • AIModelGpuEngine
      • AICreateMonitor
      • EmbeddingCreateOptions
      • LanguageDetectorCreateOptions
      • LanguageDetectorDetectResult
      • LanguageModelCreateOptions
      • RewriterCreateOptions
      • RewriterFormat
      • RewriterLength
      • RewriterTone
      • SummarizerCreateOptions
      • SummarizerFormat
      • SummarizerLength
      • SummarizerType
      • TranslatorCreateOptions
      • WriterCreateOptions
      • WriterFormat
      • WriterLength
      • WriterTone
    • Models
Powered by GitBook
On this page
  • Static Methods
  • static availability
  • static compatibility extension web
  • static create
  • Properties
  • gpuEngine extension web
  • dtype extension web
  • flashAttention extension web
  • contextSize
  • inputQuota
  • repeatPenalty extension web
  • sharedContext
  • tone
  • format
  • length
  • expectedInputLanguages
  • expectedContextLanguages
  • Methods
  • write
  • writeStreaming
  • measureInputUsage
  1. API Reference
  2. AiBrow

Writer

PreviousTranslatorNextTypes

Last updated 12 days ago

Static Methods

static availability

static async availability(options) =>

Get the availability of the on-device language model.

Options (optional)

Returns the availability

static compatibility extension web

static async compatibility(options) =>

Get the availability of the on-device language model.

Options (optional)

Returns the compatibility

static create

static async create(options) =>

Creates a new embedding session

Options (optional)

Returns a new Writer session that can be prompted with the pre-provided configuration


Properties

gpuEngine extension web

dtype extension web

flashAttention extension web

boolean

contextSize

number

inputQuota

number

repeatPenalty extension web

number

sharedContext

string

tone

format

length

expectedInputLanguages

string[]

expectedContextLanguages

string[]


Methods

write

async (input, options) => string

writeStreaming

(input, options) => ReadableStream

This prompts the model to rewrite the given input and session options.

Input

A stringcontaining the text to rewrite

Options (optional)

signal optional AbortSignal

context optional string

Returns a readable stream that updates each time new tokens are available from the language model

measureInputUsage

async (input, options) => number

Measures the prompt usage of the input

Input

A string

Options (optional)

signal optional AbortSignal

Returns prompt usage based on the input

options optional

options optional

options optional

See

AIModelAvailability
AIModelCoreCompatibility
Writer
AIModelGpuEngine
AIModelDtype
WriterTone
WriterFormat
WriterLength
writeStreaming
WriterCreateOptions
WriterCreateOptions
WriterCreateOptions