Skip to main content

Class: EchoAdapter

Defined in: provider-sdk/src/adapters/echo.ts:34

A provider that can generate completions and optionally speech, images and transcriptions (ТЗ §4.3). Text generation is the base capability; the other modalities are optional so an LLM-only adapter stays a valid provider.

Implements​

Constructors​

Constructor​

new EchoAdapter(config?): EchoAdapter

Defined in: provider-sdk/src/adapters/echo.ts:39

Parameters​

config?​

ProviderRuntimeConfig = ...

Returns​

EchoAdapter

Properties​

capabilities​

readonly capabilities: object

Defined in: provider-sdk/src/adapters/echo.ts:37

Optional generation-wire capabilities. Plugin adapters must opt in before a connection profile can use the respective feature; the host never silently drops a persisted profile override.

assistantPrefill​

readonly assistantPrefill: true = true

Implementation of​

ProviderAdapter.capabilities


kind​

readonly kind: "echo" = 'echo'

Defined in: provider-sdk/src/adapters/echo.ts:35

Stable provider kind, e.g. "openai-compatible".

Implementation of​

ProviderAdapter.kind


modalities​

readonly modalities: readonly ("text" | "speech" | "transcription" | "image")[]

Defined in: provider-sdk/src/adapters/echo.ts:36

Declared capabilities. Defaults to ['text'] when omitted. Hosts use it to reject unsupported modalities with a typed error before any call.

Implementation of​

ProviderAdapter.modalities

Methods​

countTokens()​

countTokens(request): Promise<TokenCount>

Defined in: provider-sdk/src/adapters/echo.ts:147

Optional local token counting (approximation allowed with a flag).

Parameters​

request​

TokenCountRequest

Returns​

Promise<TokenCount>

Implementation of​

ProviderAdapter.countTokens


generate()​

generate(request, signal): AsyncIterable<{ chatId: string; messages: object[]; meta: {[key: string]: unknown; }; requestId: string; responseToken: string; type: "plugin_intercept"; } | { requestId: string; type: "start"; } | { text: string; type: "delta"; } | { text: string; type: "done"; usage?: { completionTokens: number; promptTokens: number; totalTokens: number; }; } | { code: string; message: string; type: "error"; }>

Defined in: provider-sdk/src/adapters/echo.ts:51

Generate a completion, streaming unified events. Exactly one terminal event (done or error) is yielded. Must abort promptly on signal.

Parameters​

request​
assistantPrefill?​

string

Provider-neutral assistant prefill. Adapters serialize it as the beginning of the assistant turn; the host prepends it to the streamed/saved reply. Plugin adapters must explicitly opt in before a connection profile using this field can be applied.

frequencyPenalty?​

number

maxTokens​

number

messages​

object[]

minP?​

number

model​

string

presencePenalty?​

number

reasoning?​

boolean

reasoningEffort?​

"none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max"

repetitionPenalty?​

number

seed?​

number

stop?​

string[]

stream​

boolean

temperature​

number

topA?​

number

topK?​

number

topP?​

number

signal​

AbortSignal

Returns​

AsyncIterable<{ chatId: string; messages: object[]; meta: {[key: string]: unknown; }; requestId: string; responseToken: string; type: "plugin_intercept"; } | { requestId: string; type: "start"; } | { text: string; type: "delta"; } | { text: string; type: "done"; usage?: { completionTokens: number; promptTokens: number; totalTokens: number; }; } | { code: string; message: string; type: "error"; }>

Implementation of​

ProviderAdapter.generate


image()​

image(request, signal): AsyncIterable<{ requestId: string; type: "start"; } | { dataBase64: string; mime: string; type: "image"; } | { count: number; type: "done"; } | { code: string; message: string; type: "error"; }>

Defined in: provider-sdk/src/adapters/echo.ts:120

Offline image generation: a 1x1 PNG per requested image.

Parameters​

request​
count?​

number

height?​

number

model​

string

prompt​

string

width?​

number

signal​

AbortSignal

Returns​

AsyncIterable<{ requestId: string; type: "start"; } | { dataBase64: string; mime: string; type: "image"; } | { count: number; type: "done"; } | { code: string; message: string; type: "error"; }>

Implementation of​

ProviderAdapter.image


listModels()​

listModels(_signal): Promise<object[]>

Defined in: provider-sdk/src/adapters/echo.ts:47

List available models. Must respect the abort signal.

Parameters​

_signal​

AbortSignal

Returns​

Promise<object[]>

Implementation of​

ProviderAdapter.listModels


speech()​

speech(request, signal): AsyncIterable<{ requestId: string; type: "start"; } | { dataBase64: string; mime: string; type: "audio"; } | { bytes: number; mime: string; type: "done"; } | { code: string; message: string; type: "error"; }>

Defined in: provider-sdk/src/adapters/echo.ts:100

Offline TTS: a valid silent WAV whose length scales with the input, so clients exercise the real audio path without any network.

Parameters​

request​
format?​

"wav" | "mp3"

input​

string

model​

string

voice?​

string

signal​

AbortSignal

Returns​

AsyncIterable<{ requestId: string; type: "start"; } | { dataBase64: string; mime: string; type: "audio"; } | { bytes: number; mime: string; type: "done"; } | { code: string; message: string; type: "error"; }>

Implementation of​

ProviderAdapter.speech


transcribe()​

transcribe(request, _signal): Promise<{ language?: string; text: string; }>

Defined in: provider-sdk/src/adapters/echo.ts:139

Offline transcription: reports the byte size instead of guessing words.

Parameters​

request​
audioBase64​

string

mime​

string

model​

string

_signal​

AbortSignal

Returns​

Promise<{ language?: string; text: string; }>

Implementation of​

ProviderAdapter.transcribe


validateConfig()​

validateConfig(): Promise<ValidationResult>

Defined in: provider-sdk/src/adapters/echo.ts:43

Validate provider configuration without performing network calls.

Returns​

Promise<ValidationResult>

Implementation of​

ProviderAdapter.validateConfig