@dtelecom/agents-js 0.1.17 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { i as STTPlugin, j as STTStreamOptions, S as STTStream, L as LLMPlugin, M as Message, e as LLMChatOptions, f as LLMChunk, k as TTSPlugin } from '../types-AWgTLEQ-.js';
1
+ import { i as STTPlugin, j as STTStreamOptions, S as STTStream, L as LLMPlugin, M as Message, e as LLMChatOptions, f as LLMChunk, k as TTSPlugin } from '../types-BBKtiPvm.js';
2
2
  import '@dtelecom/server-sdk-node';
3
3
 
4
4
  /**
@@ -94,6 +94,46 @@ declare class OpenRouterLLM implements LLMPlugin {
94
94
  chat(messages: Message[], signal?: AbortSignal, options?: LLMChatOptions): AsyncGenerator<LLMChunk>;
95
95
  }
96
96
 
97
+ /**
98
+ * OpenAILLM — streaming LLM via OpenAI API.
99
+ *
100
+ * Uses native fetch() with SSE parsing for streaming responses.
101
+ * No SDK dependency — just HTTP.
102
+ */
103
+
104
+ interface OpenAILLMOptions {
105
+ apiKey: string;
106
+ /** Model identifier (e.g. 'gpt-4o', 'gpt-4o-mini') */
107
+ model: string;
108
+ /** Max tokens in response (default: 512) */
109
+ maxTokens?: number;
110
+ /** Sampling temperature 0-2 (default: 0.7) */
111
+ temperature?: number;
112
+ /** Structured output via constrained decoding (e.g. for multi-language segment routing) */
113
+ responseFormat?: {
114
+ type: 'json_schema';
115
+ json_schema: {
116
+ name: string;
117
+ strict: boolean;
118
+ schema: Record<string, unknown>;
119
+ };
120
+ };
121
+ }
122
+ declare class OpenAILLM implements LLMPlugin {
123
+ private readonly apiKey;
124
+ private readonly model;
125
+ private readonly maxTokens;
126
+ private readonly temperature;
127
+ private readonly responseFormat?;
128
+ constructor(options: OpenAILLMOptions);
129
+ /**
130
+ * Warm up the LLM by sending the system prompt and a short message.
131
+ * Primes the HTTP/TLS connection and model loading on the provider side.
132
+ */
133
+ warmup(systemPrompt: string): Promise<void>;
134
+ chat(messages: Message[], signal?: AbortSignal, options?: LLMChatOptions): AsyncGenerator<LLMChunk>;
135
+ }
136
+
97
137
  /**
98
138
  * CartesiaTTS — real-time streaming TTS via Cartesia WebSocket API.
99
139
  *
@@ -215,8 +255,10 @@ declare class DeepgramTTS implements TTSPlugin {
215
255
  */
216
256
 
217
257
  interface DtelecomSTTOptions {
218
- /** WebSocket server URL, e.g. "ws://192.168.1.100:8765" */
258
+ /** Server base URL, e.g. "https://stt-xxx.dtel.network" */
219
259
  serverUrl: string;
260
+ /** JWT session key from x402 gateway */
261
+ sessionKey: string;
220
262
  /** Initial language (default: "auto" for Parakeet auto-detect) */
221
263
  language?: string;
222
264
  /** Force Whisper model even if Parakeet supports the language */
@@ -251,8 +293,10 @@ interface VoiceConfig {
251
293
  langCode: string;
252
294
  }
253
295
  interface DtelecomTTSOptions {
254
- /** WebSocket server URL, e.g. "ws://192.168.1.100:8766" */
296
+ /** Server base URL, e.g. "https://tts-xxx.dtel.network" */
255
297
  serverUrl: string;
298
+ /** JWT session key from x402 gateway */
299
+ sessionKey: string;
256
300
  /** Voice config per language: { en: { voice: "af_heart", langCode: "a" }, es: { voice: "bf_emma", langCode: "b" } } */
257
301
  voices: Record<string, VoiceConfig>;
258
302
  /** Default language code (default: "en") */
@@ -262,6 +306,7 @@ interface DtelecomTTSOptions {
262
306
  }
263
307
  declare class DtelecomTTS implements TTSPlugin {
264
308
  private readonly serverUrl;
309
+ private readonly sessionKey;
265
310
  private readonly voices;
266
311
  private readonly defaultLang;
267
312
  private readonly speed;
@@ -283,4 +328,4 @@ declare class DtelecomTTS implements TTSPlugin {
283
328
  private ensureConnection;
284
329
  }
285
330
 
286
- export { CartesiaTTS, type CartesiaTTSOptions, DeepgramSTT, type DeepgramSTTOptions, DeepgramTTS, type DeepgramTTSOptions, DtelecomSTT, type DtelecomSTTOptions, DtelecomTTS, type DtelecomTTSOptions, type VoiceConfig as DtelecomVoiceConfig, OpenRouterLLM, type OpenRouterLLMOptions };
331
+ export { CartesiaTTS, type CartesiaTTSOptions, DeepgramSTT, type DeepgramSTTOptions, DeepgramTTS, type DeepgramTTSOptions, DtelecomSTT, type DtelecomSTTOptions, DtelecomTTS, type DtelecomTTSOptions, type VoiceConfig as DtelecomVoiceConfig, OpenAILLM, type OpenAILLMOptions, OpenRouterLLM, type OpenRouterLLMOptions };