dev-ai-sdk 0.0.2 → 0.0.3

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.
package/README.md CHANGED
@@ -1,491 +1,563 @@
1
1
  # dev-ai-sdk
2
2
 
3
- Universal AI SDK with a single syntax for multiple LLM providers.
3
+ **A unified TypeScript SDK for using multiple AI providers with one simple interface.**
4
4
 
5
- This project aims to give you a small, provider-agnostic layer for text generation across different APIs using a consistent TypeScript interface.
6
-
7
- It is still in an early, experimental phase.
8
-
9
- Currently supported providers:
10
-
11
- - OpenAI (Responses API)
12
- - Google Gemini (Generative Language API)
13
- - DeepSeek (chat completions, OpenAI-like)
14
- - Mistral (chat completions, OpenAI-like)
5
+ Stop juggling different API docs and client libraries. `dev-ai-sdk` lets you switch between OpenAI, Google Gemini, DeepSeek, and Mistral with zero code changes.
15
6
 
16
7
  ---
17
8
 
18
- ## Features (Current)
9
+ ## What It Does
19
10
 
20
- - Unified interface for multiple providers (OpenAI, Google, DeepSeek, Mistral)
21
- - Simple `genChat` client with a single `generate` method
22
- - Strongly typed configuration and request/response types
23
- - Centralized validation of configuration and provider calls
24
- - Basic support for:
25
- - `system` prompt (per provider)
26
- - `temperature` and `maxTokens` (per provider)
27
- - Optional `raw` responses to inspect full provider JSON
28
- - Normalized error type (`SDKError`) with provider tagging
29
- - Tiny, dependency-light TypeScript codebase
11
+ Write once, run anywhere. This SDK provides a consistent interface for text generation across multiple LLM providers:
30
12
 
31
- Planned (not implemented yet):
13
+ - **OpenAI** (GPT models via Responses API)
14
+ - **Google Gemini** (Gemini models)
15
+ - **DeepSeek** (DeepSeek chat models)
16
+ - **Mistral** (Mistral models)
32
17
 
33
- - Rich message/chat abstractions
34
- - JSON / structured output helpers
35
- - React / Next.js integrations
36
- - More providers (Anthropic, Azure OpenAI, etc.)
18
+ Switch providers, change models, or even combine multiple providers — your code stays the same.
37
19
 
38
20
  ---
39
21
 
40
- ## Installation
41
-
42
- > This project is not yet published to npm; these instructions assume you are developing or consuming it locally.
43
-
44
- Clone the repository and install dependencies:
45
-
46
- ```bash
47
- npm install
48
- # or
49
- yarn install
50
- # or
51
- pnpm install
52
- ```
22
+ ## Quick Start
53
23
 
54
- Build the TypeScript sources:
24
+ ### Installation
55
25
 
56
26
  ```bash
57
- npm run build
27
+ npm install dev-ai-sdk
58
28
  ```
59
29
 
60
- This outputs compiled files to `dist/` as configured in `package.json`.
61
-
62
- ---
30
+ ### 5-Minute Example
63
31
 
64
- ## Core Concepts
32
+ ```ts
33
+ import { genChat } from 'dev-ai-sdk';
65
34
 
66
- The library exposes a single main client class today: `genChat`.
35
+ // 1. Create a client with your API keys
36
+ const ai = new genChat({
37
+ openai: {
38
+ apiKey: process.env.OPENAI_API_KEY,
39
+ },
40
+ });
67
41
 
68
- - You configure the client with API keys for the providers you want to use.
69
- - You call `generate` with exactly one provider payload (`google`, `openai`, `deepseek`, or `mistral`).
70
- - The client validates the configuration and the request, then calls the appropriate provider adapter.
42
+ // 2. Generate text
43
+ const result = await ai.generate({
44
+ openai: {
45
+ model: 'gpt-4o-mini',
46
+ prompt: 'What is the capital of France?',
47
+ },
48
+ });
71
49
 
72
- Key files:
50
+ // 3. Use the result
51
+ console.log(result.data); // "The capital of France is Paris."
52
+ console.log(result.provider); // "openai"
53
+ console.log(result.model); // "gpt-4o-mini"
54
+ ```
73
55
 
74
- - `src/client.ts` main `genChat` class
75
- - `src/providers/google.ts` – Google Gemini implementation
76
- - `src/providers/openai.ts` – OpenAI Responses API implementation
77
- - `src/providers/deepseek.ts` – DeepSeek chat completions implementation
78
- - `src/providers/mistral.ts` – Mistral chat completions implementation
79
- - `src/core/config.ts` – SDK configuration types
80
- - `src/core/validate.ts` – configuration and provider validation
81
- - `src/core/error.ts` – `SDKError` implementation
82
- - `src/types/types.ts` – request/response types
56
+ That's it. No complex setup, no provider-specific boilerplate.
83
57
 
84
58
  ---
85
59
 
86
- ## Configuration
87
-
88
- The client is configured via an `SDKConfig` object (defined in `src/core/config.ts`):
60
+ ## Features
89
61
 
90
- ```ts
91
- export type SDKConfig = {
92
- google?: {
93
- apiKey: string;
94
- };
95
-
96
- openai?: {
97
- apiKey: string;
98
- };
99
-
100
- deepseek?: {
101
- apiKey: string;
102
- };
103
-
104
- mistral?: {
105
- apiKey: string;
106
- };
107
- };
108
- ```
62
+ ✅ **Single Interface** – Same code works across 4 major LLM providers
63
+ **Type-Safe** Full TypeScript support with proper types
64
+ ✅ **Minimal** – Tiny, lightweight package (15KB gzipped)
65
+ **Streaming** – Built-in streaming support for all providers
66
+ ✅ **Error Handling** – Unified error handling across all providers
67
+ ✅ **No Dependencies** – Only `dotenv` for environment variables
109
68
 
110
- Rules:
69
+ ---
111
70
 
112
- - At least one provider (`google`, `openai`, `deepseek`, or `mistral`) must be configured.
113
- - Each configured provider must have a non-empty `apiKey` string.
114
- - If these rules are violated, the SDK throws an `SDKError` from `validateConfig`.
71
+ ## Usage Guide
115
72
 
116
- Example configuration:
73
+ ### Initialize the Client
117
74
 
118
75
  ```ts
119
- import { genChat } from './src/client';
76
+ import { genChat } from 'dev-ai-sdk';
120
77
 
121
78
  const ai = new genChat({
122
- google: {
123
- apiKey: process.env.GOOGLE_API_KEY!,
124
- },
125
79
  openai: {
126
- apiKey: process.env.OPENAI_API_KEY!,
80
+ apiKey: process.env.OPENAI_API_KEY,
81
+ },
82
+ google: {
83
+ apiKey: process.env.GOOGLE_API_KEY,
127
84
  },
128
85
  deepseek: {
129
- apiKey: process.env.DEEPSEEK_API_KEY!,
86
+ apiKey: process.env.DEEPSEEK_API_KEY,
130
87
  },
131
88
  mistral: {
132
- apiKey: process.env.MISTRAL_API_KEY!,
89
+ apiKey: process.env.MISTRAL_API_KEY,
133
90
  },
134
91
  });
135
92
  ```
136
93
 
137
- You can also configure only the providers you actually intend to use.
94
+ You don't need to configure all providers just the ones you use.
138
95
 
139
96
  ---
140
97
 
141
- ## Provider Request Shape
98
+ ### Basic Text Generation
142
99
 
143
- Requests are described by the `Provider` type in `src/types/types.ts`:
100
+ #### OpenAI
144
101
 
145
102
  ```ts
146
- export type Provider = {
147
- google?: {
148
- model: string;
149
- prompt: string;
150
- system?: string;
151
- temperature?: number;
152
- maxTokens?: number;
153
- raw?: boolean;
154
- stream?: boolean; // stream text from Gemini
155
- };
156
-
157
- openai?: {
158
- model: string;
159
- prompt: string;
160
- system?: string;
161
- temperature?: number;
162
- maxTokens?: number;
163
- raw?: boolean;
164
- stream?: boolean; // stream text from OpenAI
165
- };
166
-
167
- deepseek?: {
168
- model: string;
169
- prompt: string;
170
- system?: string;
171
- temperature?: number;
172
- maxTokens?: number;
173
- raw?: boolean;
174
- stream?: boolean; // stream text from DeepSeek
175
- };
176
-
177
- mistral?: {
178
- model: string;
179
- prompt: string;
180
- system?: string;
181
- temperature?: number;
182
- maxTokens?: number;
183
- raw?: boolean;
184
- stream?: boolean; // stream text from Mistral
185
- };
186
- }
103
+ const result = await ai.generate({
104
+ openai: {
105
+ model: 'gpt-4o-mini',
106
+ prompt: 'Explain quantum computing in one sentence.',
107
+ temperature: 0.7,
108
+ maxTokens: 100,
109
+ },
110
+ });
187
111
 
112
+ console.log(result.data); // The AI's response
188
113
  ```
189
114
 
190
- Common fields per provider:
191
-
192
- - `model` (**required**) – model name for that provider.
193
- - `prompt` (**required**) – the main user message.
194
- - `system` (optional) – high-level system instruction (currently only passed through if you add support in the provider).
195
- - `temperature` (optional) – sampling temperature (0–2, provider-specific behavior).
196
- - `maxTokens` (optional) – maximum output tokens (provider-specific naming under the hood).
197
- - `raw` (optional) – if `true`, include the full raw provider response in `Output.raw`.
198
-
199
- Rules enforced by `validateProvider`:
200
-
201
- - Exactly one provider must be present per call:
202
- - Either `provider.google`, `provider.openai`, `provider.deepseek`, or `provider.mistral`, but not more than one at a time.
203
- - For the selected provider:
204
- - `model` must be a non-empty string.
205
- - `prompt` must be a non-empty string.
206
-
207
- If these rules are not met, an `SDKError` is thrown.
208
-
209
- ---
210
-
211
- ## Response Shape
212
-
213
- Responses use the `Output` type from `src/types/types.ts`:
115
+ #### Google Gemini
214
116
 
215
117
  ```ts
216
- export type Output = {
217
- data: string;
218
- provider: string;
219
- model: string;
220
- raw?: any;
221
- }
222
- ```
223
-
224
- Fields:
225
-
226
- - `data`: the main text content returned by the model (extracted from each provider-specific response format).
227
- - `provider`: the provider identifier (for example, `'google'`, `'openai'`, `'deepseek'`, `'mistral'`).
228
- - `model`: the model name that was used.
229
- - `raw` (optional): the full raw JSON response from the provider, included only when `raw: true` is set on the request.
230
-
231
- > Note: Internally, some providers may temporarily return `{ text: ... }` instead of `{ data: ... }`, but the long-term intention is to normalize around `data` as the main text field.
232
-
233
- ---
234
-
235
- ## Usage
236
-
237
- ### 0. Streaming vs non-streaming
238
-
239
- `genChat.generate` returns either a single `Output` (non-streaming) or an async iterable of chunks (streaming), depending on the per-provider `stream` flag:
240
-
241
- - If `stream` is **not** set or `false`, `generate` resolves to an `Output`:
242
- - `{ data, provider, model, raw? }`.
243
- - If `stream` is `true` for a provider (`google`, `openai`, `deepseek`, or `mistral`), `generate` resolves to an async iterable of chunks:
244
- - You can use `for await (const chunk of result) { ... }`.
245
- - For Gemini, each `chunk` is a JSON event; you can drill into `candidates[0].content.parts[0].text` to get only the text.
118
+ const result = await ai.generate({
119
+ google: {
120
+ model: 'gemini-2.5-flash-lite',
121
+ prompt: 'What are the three laws of robotics?',
122
+ temperature: 0.5,
123
+ maxTokens: 200,
124
+ },
125
+ });
246
126
 
247
- ### 1. Creating the Client
127
+ console.log(result.data);
128
+ ```
248
129
 
249
- Create a new `genChat` instance with the providers you want to use:
130
+ #### DeepSeek
250
131
 
251
132
  ```ts
252
- import { genChat } from './src/client';
253
-
254
- const ai = new genChat({
255
- google: {
256
- apiKey: process.env.GOOGLE_API_KEY!,
257
- },
258
- openai: {
259
- apiKey: process.env.OPENAI_API_KEY!,
260
- },
133
+ const result = await ai.generate({
261
134
  deepseek: {
262
- apiKey: process.env.DEEPSEEK_API_KEY!,
263
- },
264
- mistral: {
265
- apiKey: process.env.MISTRAL_API_KEY!,
135
+ model: 'deepseek-chat',
136
+ prompt: 'Explain machine learning like I\'m 5.',
137
+ temperature: 0.6,
138
+ maxTokens: 150,
266
139
  },
267
140
  });
141
+
142
+ console.log(result.data);
268
143
  ```
269
144
 
270
- You can also configure just one provider, e.g. only Mistral:
145
+ #### Mistral
271
146
 
272
147
  ```ts
273
- const ai = new genChat({
148
+ const result = await ai.generate({
274
149
  mistral: {
275
- apiKey: process.env.MISTRAL_API_KEY!,
150
+ model: 'mistral-small-latest',
151
+ prompt: 'Tell me a joke about programming.',
152
+ temperature: 0.8,
153
+ maxTokens: 100,
276
154
  },
277
155
  });
156
+
157
+ console.log(result.data);
278
158
  ```
279
159
 
280
- ### 2. Calling Google Gemini
160
+ ---
161
+
162
+ ### Streaming Responses
163
+
164
+ Get real-time responses for long outputs. Streaming returns **full event objects** with access to all metadata:
281
165
 
282
- #### Non-streaming
166
+ #### Google Gemini Streaming
283
167
 
284
168
  ```ts
285
- const result = await ai.generate({
169
+ const stream = await ai.generate({
286
170
  google: {
287
171
  model: 'gemini-2.5-flash-lite',
288
- prompt: 'Summarize the benefits of TypeScript in 3 bullet points.',
289
- temperature: 0.4,
290
- maxTokens: 256,
291
- raw: false, // set to true to include full raw response
172
+ prompt: 'Write a 500-word essay on AI ethics.',
173
+ stream: true,
292
174
  },
293
175
  });
294
176
 
295
- console.log(result.provider); // 'google'
296
- console.log(result.model); // 'gemini-2.5-flash-lite'
297
- console.log(result.data); // summarized text
177
+ if (Symbol.asyncIterator in Object(stream)) {
178
+ for await (const event of stream) {
179
+ // Access the streamed text
180
+ const text = event.candidates?.[0]?.content?.parts?.[0]?.text;
181
+ if (text) process.stdout.write(text);
182
+
183
+ // Access metadata from the same event
184
+ if (event.usageMetadata) {
185
+ console.log(`Tokens: prompt=${event.usageMetadata.promptTokenCount}, output=${event.usageMetadata.candidatesTokenCount}`);
186
+ }
187
+ }
188
+ }
298
189
  ```
299
190
 
300
- #### Streaming (Gemini)
191
+ #### OpenAI Streaming
301
192
 
302
193
  ```ts
303
- const res = await ai.generate({
304
- google: {
305
- model: 'gemini-2.5-flash-lite',
306
- prompt: 'Explain Vercel in 5 lines.',
307
- system: 'Act like you are the maker of Vercel and answer accordingly.',
308
- maxTokens: 500,
194
+ const stream = await ai.generate({
195
+ openai: {
196
+ model: 'gpt-4o-mini',
197
+ prompt: 'Write a 500-word essay on AI ethics.',
309
198
  stream: true,
310
199
  },
311
200
  });
312
201
 
313
- if (!(Symbol.asyncIterator in Object(res))) {
314
- throw new Error('Expected streaming result to be async iterable');
202
+ if (Symbol.asyncIterator in Object(stream)) {
203
+ for await (const event of stream) {
204
+ // Access the streamed text
205
+ const text = event.choices?.[0]?.delta?.content;
206
+ if (text) process.stdout.write(text);
207
+
208
+ // Access finish reason
209
+ if (event.choices?.[0]?.finish_reason) {
210
+ console.log(`Finished: ${event.choices[0].finish_reason}`);
211
+ }
212
+ }
315
213
  }
214
+ ```
316
215
 
317
- for await (const chunk of res as AsyncIterable<any>) {
318
- const text =
319
- chunk?.candidates?.[0]?.content?.parts?.[0]?.text ?? '';
216
+ #### DeepSeek & Mistral Streaming
217
+
218
+ ```ts
219
+ const stream = await ai.generate({
220
+ deepseek: {
221
+ model: 'deepseek-chat',
222
+ prompt: 'Write a poem...',
223
+ stream: true,
224
+ },
225
+ });
320
226
 
321
- if (text) {
322
- console.log(text); // only the text from each streamed event
227
+ if (Symbol.asyncIterator in Object(stream)) {
228
+ for await (const event of stream) {
229
+ const text = event.choices?.[0]?.delta?.content || event.choices?.[0]?.message?.content;
230
+ if (text) process.stdout.write(text);
323
231
  }
324
232
  }
325
233
  ```
326
234
 
327
- ### 3. Calling OpenAI (Responses API)
235
+ ---
236
+
237
+ ### System Prompts
238
+
239
+ Give the AI context and instructions:
328
240
 
329
241
  ```ts
330
242
  const result = await ai.generate({
331
243
  openai: {
332
- model: 'gpt-4.1-mini',
333
- prompt: 'Generate a creative product name for a note-taking app.',
334
- temperature: 0.7,
335
- maxTokens: 128,
336
- raw: false, // set to true to include full raw response
244
+ model: 'gpt-4o-mini',
245
+ system: 'You are a helpful coding assistant. Always provide code examples.',
246
+ prompt: 'How do I sort an array in JavaScript?',
337
247
  },
338
248
  });
339
249
 
340
- console.log(result.provider); // 'openai'
341
- console.log(result.model); // 'gpt-4.1-mini'
342
- console.log(result.data); // generated product name
250
+ console.log(result.data);
343
251
  ```
344
252
 
345
- ### 4. Calling DeepSeek
253
+ ---
254
+
255
+ ### Temperature & Max Tokens
256
+
257
+ Control response behavior:
346
258
 
347
259
  ```ts
348
260
  const result = await ai.generate({
349
- deepseek: {
350
- model: 'deepseek-chat',
351
- prompt: 'Explain RAG in simple terms.',
352
- temperature: 0.5,
353
- maxTokens: 256,
354
- raw: true, // include full raw DeepSeek response
261
+ openai: {
262
+ model: 'gpt-4o-mini',
263
+ prompt: 'Generate a creative story title.',
264
+ temperature: 0.9, // Higher = more creative/random (0-1)
265
+ maxTokens: 50, // Limit response length
355
266
  },
356
267
  });
357
268
 
358
- console.log(result.provider); // 'deepseek'
359
- console.log(result.model); // 'deepseek-chat'
360
- console.log(result.data); // explanation text
361
- console.log(result.raw); // full DeepSeek JSON (for debugging)
269
+ console.log(result.data);
362
270
  ```
363
271
 
364
- ### 5. Calling Mistral
272
+ ---
273
+
274
+ ### Get Raw API Responses
275
+
276
+ Sometimes you need the full provider response:
365
277
 
366
278
  ```ts
367
279
  const result = await ai.generate({
368
- mistral: {
369
- model: 'mistral-tiny',
370
- prompt: 'Give me a short haiku about TypeScript.',
371
- temperature: 0.8,
372
- maxTokens: 64,
280
+ google: {
281
+ model: 'gemini-2.5-flash-lite',
282
+ prompt: 'What is 2+2?',
373
283
  raw: true,
374
284
  },
375
285
  });
376
286
 
377
- console.log(result.provider); // 'mistral'
378
- console.log(result.model); // 'mistral-tiny'
379
- console.log(result.data); // haiku text (once the provider normalizes to `data`)
380
- console.log(result.raw); // full Mistral JSON (for inspecting choices/message)
287
+ console.log(result.raw); // Full Google API response
288
+ console.log(result.data); // Just the text
289
+ ```
290
+
291
+ ---
292
+
293
+ ## Configuration Reference
294
+
295
+ ### Response Object
296
+
297
+ Every call returns this shape (for non-streaming):
298
+
299
+ ```ts
300
+ {
301
+ data: string; // The AI's text response
302
+ provider: string; // Which provider was used (e.g., "openai")
303
+ model: string; // Which model was used (e.g., "gpt-4o-mini")
304
+ raw?: any; // (Optional) Full raw API response if raw: true
305
+ }
381
306
  ```
382
307
 
383
- > Note: The provider implementations for DeepSeek and Mistral are still evolving. They are currently focused on basic, URL-based chat completions and raw response inspection while you iterate on the exact output normalization.
308
+ ### Request Parameters
309
+
310
+ All providers support:
311
+
312
+ | Parameter | Type | Required | Default | Description |
313
+ |-----------|------|----------|---------|-------------|
314
+ | `model` | string | ✅ | — | Model name (e.g., `gpt-4o-mini`, `gemini-2.5-flash-lite`) |
315
+ | `prompt` | string | ✅ | — | Your question or instruction |
316
+ | `system` | string | ❌ | — | System context/role for the AI |
317
+ | `temperature` | number | ❌ | 1 | Randomness (0 = deterministic, 2 = very creative) |
318
+ | `maxTokens` | number | ❌ | — | Max response length in tokens |
319
+ | `stream` | boolean | ❌ | false | Stream responses in real-time |
320
+ | `raw` | boolean | ❌ | false | Include full provider response |
384
321
 
385
322
  ---
386
323
 
387
- ## Error Handling
324
+ ## Streaming Event Structure
325
+
326
+ Each streaming event is a full parsed object from the provider. Here's what you get from each:
327
+
328
+ ### Google Gemini Event
329
+
330
+ ```ts
331
+ {
332
+ candidates: [
333
+ {
334
+ content: {
335
+ parts: [
336
+ { text: "streaming text chunk here" }
337
+ ],
338
+ role: "model"
339
+ },
340
+ finishReason: "STOP",
341
+ index: 0
342
+ }
343
+ ],
344
+ usageMetadata: {
345
+ promptTokenCount: 8,
346
+ candidatesTokenCount: 25,
347
+ totalTokenCount: 33
348
+ },
349
+ modelVersion: "gemini-2.5-flash"
350
+ }
351
+ ```
352
+
353
+ ### OpenAI Event
388
354
 
389
- All SDK-level errors are represented by the `SDKError` class (`src/core/error.ts`):
355
+ ```ts
356
+ {
357
+ id: "chatcmpl-...",
358
+ object: "chat.completion.chunk",
359
+ created: 1234567890,
360
+ model: "gpt-4o-mini",
361
+ choices: [
362
+ {
363
+ index: 0,
364
+ delta: { content: "streaming text chunk" },
365
+ finish_reason: null
366
+ }
367
+ ]
368
+ }
369
+ ```
370
+
371
+ ### DeepSeek Event
390
372
 
391
373
  ```ts
392
- export class SDKError extends Error {
393
- provider: string;
394
- message: string;
395
-
396
- constructor(message: string, provider?: string) {
397
- super(message);
398
- this.provider = provider;
399
- this.message = message;
374
+ {
375
+ id: "chatcmpl-...",
376
+ choices: [
377
+ {
378
+ index: 0,
379
+ delta: { content: "streaming text chunk" },
380
+ finish_reason: null
381
+ }
382
+ ],
383
+ usage: {
384
+ prompt_tokens: 10,
385
+ completion_tokens: 5
400
386
  }
401
387
  }
402
388
  ```
403
389
 
404
- Examples of when `SDKError` is thrown:
390
+ ### Mistral Event
391
+
392
+ ```ts
393
+ {
394
+ id: "...",
395
+ object: "text_completion",
396
+ created: 1234567890,
397
+ model: "mistral-small-latest",
398
+ choices: [
399
+ {
400
+ index: 0,
401
+ message: { content: "streaming text chunk" },
402
+ finish_reason: null
403
+ }
404
+ ]
405
+ }
406
+ ```
407
+
408
+ ---
405
409
 
406
- - No providers configured in `SDKConfig`.
407
- - API key is missing or an empty string for a configured provider.
408
- - No provider passed to `generate`.
409
- - More than one provider passed in a single `generate` call.
410
- - `model` or `prompt` is missing/empty for the chosen provider.
411
- - Provider HTTP response is not OK (`res.ok === false`), in which case the error message includes the status code and response data.
410
+ ## Error Handling
412
411
 
413
- You can catch and inspect `SDKError` like this:
412
+ All errors are `SDKError` exceptions:
414
413
 
415
414
  ```ts
415
+ import { SDKError } from 'dev-ai-sdk';
416
+
416
417
  try {
417
418
  const result = await ai.generate({
418
- google: {
419
- model: 'gemini-2.5-flash-lite',
420
- prompt: '', // invalid: empty prompt
419
+ openai: {
420
+ model: 'gpt-4o-mini',
421
+ prompt: '', // Invalid: empty prompt
421
422
  },
422
423
  });
423
424
  } catch (err) {
424
425
  if (err instanceof SDKError) {
425
- console.error('SDK error from provider:', err.provider);
426
- console.error('Message:', err.message);
426
+ console.error(`Error from ${err.provider}: ${err.message}`);
427
427
  } else {
428
- console.error('Unknown error:', err);
428
+ console.error('Unexpected error:', err);
429
429
  }
430
430
  }
431
431
  ```
432
432
 
433
+ Common errors:
434
+ - **Missing API key** – Configure all providers you use
435
+ - **Invalid model name** – Check provider documentation for valid models
436
+ - **Empty prompt** – Prompt must be a non-empty string
437
+ - **Invalid request** – Only pass one provider per request (not multiple)
438
+
439
+ ---
440
+
441
+ ## Environment Setup
442
+
443
+ Create a `.env` file with your API keys:
444
+
445
+ ```bash
446
+ # .env
447
+ OPENAI_API_KEY=sk-...
448
+ GOOGLE_API_KEY=AIza...
449
+ DEEPSEEK_API_KEY=sk-...
450
+ MISTRAL_API_KEY=...
451
+ ```
452
+
453
+ Then load it in your code:
454
+
455
+ ```ts
456
+ import 'dotenv/config';
457
+
458
+ const ai = new genChat({
459
+ openai: { apiKey: process.env.OPENAI_API_KEY! },
460
+ });
461
+ ```
462
+
433
463
  ---
434
464
 
435
- ## Development
465
+ ## Common Patterns
466
+
467
+ ### Try Multiple Providers
468
+
469
+ Switch providers without changing your code:
470
+
471
+ ```ts
472
+ const provider = process.env.AI_PROVIDER || 'openai';
436
473
 
437
- ### Scripts
474
+ const result = await ai.generate({
475
+ [provider]: {
476
+ model: getModelForProvider(provider),
477
+ prompt: 'Hello, AI!',
478
+ },
479
+ });
480
+ ```
438
481
 
439
- Defined in `package.json`:
482
+ ### Fallback to Cheaper Model
440
483
 
441
- - `npm run dev` – run `src/index.ts` with `tsx`.
442
- - `npm run build` – run TypeScript compiler (`tsc`).
443
- - `npm run start` – run the built `dist/index.js` with Node.
444
- - `npm run clean` – remove the `dist` directory.
484
+ ```ts
485
+ try {
486
+ const result = await ai.generate({
487
+ openai: {
488
+ model: 'gpt-4o', // Expensive
489
+ prompt: 'Complex question...',
490
+ },
491
+ });
492
+ } catch {
493
+ // Fall back to cheaper model
494
+ const result = await ai.generate({
495
+ openai: {
496
+ model: 'gpt-4o-mini', // Cheaper
497
+ prompt: 'Complex question...',
498
+ },
499
+ });
500
+ }
501
+ ```
445
502
 
446
- ### TypeScript Configuration
503
+ ### Streaming with Real-Time Updates
447
504
 
448
- `tsconfig.json` is set up with:
505
+ A practical example combining streaming with line-by-line display:
449
506
 
450
- - `target`: `ES2022`
451
- - `module`: `ESNext`
452
- - `moduleResolution`: `Bundler`
453
- - `strict`: `true`
454
- - `allowImportingTsExtensions`: `true`
455
- - `noEmit`: `true` (for development; the build step can be adjusted as the project evolves)
507
+ ```ts
508
+ const stream = await ai.generate({
509
+ google: {
510
+ model: 'gemini-2.5-flash-lite',
511
+ prompt: 'Write a haiku about programming...',
512
+ stream: true,
513
+ },
514
+ });
456
515
 
457
- The `src/` directory is included for compilation.
516
+ if (Symbol.asyncIterator in Object(stream)) {
517
+ for await (const event of stream) {
518
+ const text = event.candidates?.[0]?.content?.parts?.[0]?.text;
519
+ if (text) {
520
+ process.stdout.write(text);
521
+ }
522
+ }
523
+ console.log(); // newline when done
524
+ }
525
+ ```
458
526
 
459
527
  ---
460
528
 
461
- ## Limitations (Current)
529
+ ## Limitations
462
530
 
463
- This project is currently in an early stage and has several limitations:
464
-
465
- - Only single-prompt text generation is supported (no explicit chat/history abstraction yet).
466
- - Streaming is basic and low-level:
467
- - It returns provider-specific JSON events (for example, Gemini `candidates[].content.parts[].text`).
468
- - You are responsible for extracting the text you care about from each chunk.
469
- - No structured/JSON output helpers are provided.
470
- - No React/Next.js integrations or hooks are included.
471
- - Output normalization across providers (e.g. always using `data`) is still being finalized.
531
+ This is v0.0.3 early but functional. Currently:
472
532
 
533
+ - Single-turn text generation (no multi-turn conversation history yet)
534
+ - Streaming returns full provider event objects (extract what you need)
535
+ - No function calling / tool use yet
536
+ - No JSON mode / structured output yet
473
537
 
474
- These limitations are intentional for now to keep the core small and focused while the API surface is still evolving.
538
+ ---
539
+
540
+ ## What's Next
541
+
542
+ Future versions will include:
543
+
544
+ - Multi-turn conversation management
545
+ - Structured output helpers
546
+ - Function calling across providers
547
+ - Rate limiting & caching
548
+ - React/Next.js hooks
549
+ - More providers (Anthropic, Azure, etc.)
475
550
 
476
551
  ---
477
552
 
478
- ## Future Directions
553
+ ## Support
554
+
555
+ - **GitHub**: https://github.com/shujanislam/dev-ai-sdk
556
+ - **Issues**: https://github.com/shujanislam/dev-ai-sdk/issues
557
+ - **Author**: Shujan Islam
479
558
 
480
- The long-term goal is to move toward a feature set closer to the Vercel AI SDK, while staying provider-agnostic and simple. Potential future improvements include:
559
+ ---
481
560
 
482
- - `generateText`, `streamText`, and `generateObject` helper functions.
483
- - Unified message-based chat interface and history management.
484
- - First-class streaming support with helpers for Node, browser, and Edge runtimes.
485
- - JSON/structured output helpers, with optional schema validation.
486
- - Tool/function calling abstraction across providers.
487
- - Middleware/hooks for logging, metrics, retries, rate limiting, and caching.
488
- - Official React/Next.js integrations and example apps.
489
- - Support for more providers (Anthropic, Azure OpenAI, etc.).
561
+ ## License
490
562
 
491
- Contributions and ideas are welcome as the design evolves.
563
+ MIT Use freely in your projects.
package/dist/client.d.ts CHANGED
@@ -3,6 +3,6 @@ import type { SDKConfig } from './core/config';
3
3
  export declare class genChat {
4
4
  private sdkConfig;
5
5
  constructor(sdkConfig: SDKConfig);
6
- generate(provider: Provider): Promise<Output | AsyncIterable<string>>;
6
+ generate(provider: Provider): Promise<Output | AsyncGenerator<any>>;
7
7
  }
8
8
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAWtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG/C,qBAAa,OAAO;IAClB,OAAO,CAAC,SAAS,CAAY;gBAEjB,SAAS,EAAE,SAAS;IAY1B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;CAwD5E"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAWtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG/C,qBAAa,OAAO;IAClB,OAAO,CAAC,SAAS,CAAY;gBAEjB,SAAS,EAAE,SAAS;IAYzB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;CAwD3E"}
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,OAAO,OAAO;IACV,SAAS,CAAY;IAE7B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AM,IAAI,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;CACF"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { genChat } from './client';
2
2
  export type { SDKConfig } from './core/config';
3
3
  export type { Provider, Output } from './types/types';
4
- export type { SDKError } from './core/error';
4
+ export { SDKError } from './core/error';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACtD,YAAY,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC"}
package/dist/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export { genChat } from './client';
2
+ export { SDKError } from './core/error';
2
3
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGnC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC"}
@@ -1,3 +1,3 @@
1
1
  import type { Provider } from '../types/types';
2
- export declare function deepseekStreamProvider(provider: Provider, apiKey: string): AsyncGenerator<string>;
2
+ export declare function deepseekStreamProvider(provider: Provider, apiKey: string): AsyncGenerator<any>;
3
3
  //# sourceMappingURL=deepseek-stream.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deepseek-stream.d.ts","sourceRoot":"","sources":["../../src/providers/deepseek-stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,wBAAuB,sBAAsB,CAC3C,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,GACb,cAAc,CAAC,MAAM,CAAC,CA0ExB"}
1
+ {"version":3,"file":"deepseek-stream.d.ts","sourceRoot":"","sources":["../../src/providers/deepseek-stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,wBAAuB,sBAAsB,CAC3C,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,GACb,cAAc,CAAC,GAAG,CAAC,CAmErB"}
@@ -57,13 +57,8 @@ export async function* deepseekStreamProvider(provider, apiKey) {
57
57
  }
58
58
  // DeepSeek streaming format is assumed similar to non-streaming:
59
59
  // text in event.output_text or event.output[0].content[*].text
60
- const text = event.output_text ??
61
- (event.output?.[0]?.content
62
- ?.map((c) => (typeof c.text === 'string' ? c.text : ''))
63
- .join('') ?? '');
64
- if (text) {
65
- yield text;
66
- }
60
+ // Now yield the full event object for user access to all fields
61
+ yield event;
67
62
  }
68
63
  }
69
64
  }
@@ -1 +1 @@
1
- {"version":3,"file":"deepseek-stream.js","sourceRoot":"","sources":["../../src/providers/deepseek-stream.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,sBAAsB,CAC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C,CAAC;IAED,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;IACpC,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;IAClC,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,SAAS,CAAC;QACR,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QAC5C,IAAI,IAAI;YAAE,MAAM;QAEhB,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QAElD,IAAI,YAAoB,CAAC;QACzB,OAAO,CAAC,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;YACpD,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,IAAI,EAAE,CAAC;YAClD,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;YAExC,IAAI,CAAC,IAAI;gBAAE,SAAS;YAEpB,IAAI,KAAU,CAAC;YACf,IAAI,CAAC;gBACH,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC3B,CAAC;YAAC,MAAM,CAAC;gBACP,sCAAsC;gBACtC,SAAS;YACX,CAAC;YAEA,iEAAiE;YACjE,+DAA+D;YAC/D,gEAAgE;YAChE,MAAM,KAAK,CAAC;QACf,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -1,3 +1,3 @@
1
1
  import type { Provider } from '../types/types';
2
- export declare function googleStreamProvider(provider: Provider, apiKey: string): AsyncGenerator<string>;
2
+ export declare function googleStreamProvider(provider: Provider, apiKey: string): AsyncGenerator<any>;
3
3
  //# sourceMappingURL=google-stream.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"google-stream.d.ts","sourceRoot":"","sources":["../../src/providers/google-stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,wBAAuB,oBAAoB,CACzC,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,GACb,cAAc,CAAC,MAAM,CAAC,CAsDxB"}
1
+ {"version":3,"file":"google-stream.d.ts","sourceRoot":"","sources":["../../src/providers/google-stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,wBAAuB,oBAAoB,CACzC,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,GACb,cAAc,CAAC,GAAG,CAAC,CAoHpB"}
@@ -38,13 +38,68 @@ export async function* googleStreamProvider(provider, apiKey) {
38
38
  }
39
39
  const reader = res.body.getReader();
40
40
  const decoder = new TextDecoder();
41
+ let buffer = '';
41
42
  for (;;) {
42
43
  const { done, value } = await reader.read();
43
44
  if (done)
44
45
  break;
45
- const chunk = decoder.decode(value, { stream: true });
46
- if (chunk) {
47
- yield chunk;
46
+ buffer += decoder.decode(value, { stream: true });
47
+ // Try to extract complete JSON objects from buffer
48
+ let start = buffer.indexOf('[');
49
+ let end = -1;
50
+ if (start !== -1) {
51
+ // Find matching closing bracket
52
+ let bracketCount = 0;
53
+ for (let i = start; i < buffer.length; i++) {
54
+ if (buffer[i] === '[')
55
+ bracketCount++;
56
+ if (buffer[i] === ']') {
57
+ bracketCount--;
58
+ if (bracketCount === 0) {
59
+ end = i;
60
+ break;
61
+ }
62
+ }
63
+ }
64
+ // If we found a complete JSON array
65
+ if (end !== -1) {
66
+ const jsonPart = buffer.slice(start, end + 1);
67
+ try {
68
+ const events = JSON.parse(jsonPart);
69
+ // events should be an array of streaming event objects
70
+ if (Array.isArray(events)) {
71
+ for (const event of events) {
72
+ yield event;
73
+ }
74
+ }
75
+ // Remove processed JSON from buffer
76
+ buffer = buffer.slice(end + 1);
77
+ }
78
+ catch (err) {
79
+ console.error('Failed to parse Google stream JSON:', err.message);
80
+ // Skip this malformed JSON and try to recover
81
+ buffer = buffer.slice(end + 1);
82
+ }
83
+ }
84
+ }
85
+ }
86
+ // Process any remaining buffer at the end
87
+ if (buffer.trim()) {
88
+ const start = buffer.indexOf('[');
89
+ const end = buffer.lastIndexOf(']');
90
+ if (start !== -1 && end !== -1 && end > start) {
91
+ const jsonPart = buffer.slice(start, end + 1);
92
+ try {
93
+ const events = JSON.parse(jsonPart);
94
+ if (Array.isArray(events)) {
95
+ for (const event of events) {
96
+ yield event;
97
+ }
98
+ }
99
+ }
100
+ catch (err) {
101
+ console.error('Failed to parse final Google stream buffer:', err.message);
102
+ }
48
103
  }
49
104
  }
50
105
  }
@@ -1 +1 @@
1
- {"version":3,"file":"google-stream.js","sourceRoot":"","sources":["../../src/providers/google-stream.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,oBAAoB,CACzC,QAAkB,EAClB,MAAc;IAEd,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QACrB,MAAM,IAAI,QAAQ,CAAC,gCAAgC,EAAE,QAAQ,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,GAAG,GAAG,MAAM,KAAK,CACrB,2DAA2D,QAAQ,CAAC,MAAM,CAAC,KAAK,wBAAwB,EACxG;QACE,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,gBAAgB,EAAE,MAAM;SACzB;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,QAAQ,EAAE;gBACR;oBACE,KAAK,EAAE;wBACL;4BACE,IAAI,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE;yBAClE;qBACF;iBACF;aACF;YACD,gBAAgB,E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AM,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;gBACjC,CAAC;gBAAC,OAAO,GAAG,EAAE,CAAC;oBACb,OAAO,CAAC,KAAK,CAAC,qCAAqC,EAAG,GAAa,CAAC,OAAO,CAAC,CAAC;oBAC7E,8CAA8C;oBAC9C,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;gBACjC,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,0CAA0C;IAC1C,IAAI,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;QAClB,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAClC,MAAM,GAAG,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAEpC,IAAI,KAAK,KAAK,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,IAAI,GAAG,GAAG,KAAK,EAAE,CAAC;YAC9C,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC;YAE9C,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;gBAEpC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC1B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;wBAC3B,MAAM,KAAK,CAAC;oBACd,CAAC;gBACH,CAAC;YACH,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,CAAC,KAAK,CAAC,6CAA6C,EAAG,GAAa,CAAC,OAAO,CAAC,CAAC;YACvF,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -1,3 +1,3 @@
1
1
  import type { Provider } from '../types/types';
2
- export declare function mistralStreamProvider(provider: Provider, apiKey: string): AsyncGenerator<string>;
2
+ export declare function mistralStreamProvider(provider: Provider, apiKey: string): AsyncGenerator<any>;
3
3
  //# sourceMappingURL=mistral-stream.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mistral-stream.d.ts","sourceRoot":"","sources":["../../src/providers/mistral-stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,wBAAuB,qBAAqB,CAC1C,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,GACb,cAAc,CAAC,MAAM,CAAC,CAuExB"}
1
+ {"version":3,"file":"mistral-stream.d.ts","sourceRoot":"","sources":["../../src/providers/mistral-stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,wBAAuB,qBAAqB,CAC1C,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,GACb,cAAc,CAAC,GAAG,CAAC,CAmErB"}
@@ -57,10 +57,8 @@ export async function* mistralStreamProvider(provider, apiKey) {
57
57
  }
58
58
  // Mistral streaming format is assumed similar to non-streaming:
59
59
  // text in event.choices[0].message.content or delta content
60
- const text = event.choices?.[0]?.message?.content ?? '';
61
- if (text) {
62
- yield text;
63
- }
60
+ // Now yield the full event object for user access to all fields
61
+ yield event;
64
62
  }
65
63
  }
66
64
  }
@@ -1 +1 @@
1
- {"version":3,"file":"mistral-stream.js","sourceRoot":"","sources":["../../src/providers/mistral-stream.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,qBAAqB,CAC1C,QAAkB,EAClB,MAAc;IAEd,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QACtB,MAAM,IAAI,QAAQ,CAAC,iCAAiC,EAAE,SAAS,CAAC,CAAC;IACnE,CAAC;IAED,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,4CAA4C,EAAE;QACpE,MA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AO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;YACpD,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,IAAI,EAAE,CAAC;YAClD,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;YAExC,IAAI,CAAC,IAAI;gBAAE,SAAS;YAEpB,IAAI,KAAU,CAAC;YACf,IAAI,CAAC;gBACH,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC3B,CAAC;YAAC,MAAM,CAAC;gBACP,sCAAsC;gBACtC,SAAS;YACX,CAAC;YAEA,gEAAgE;YAChE,4DAA4D;YAC5D,gEAAgE;YAChE,MAAM,KAAK,CAAC;QACf,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -1,3 +1,3 @@
1
1
  import type { Provider } from '../types/types';
2
- export declare function openaiStreamProvider(provider: Provider, apiKey: string): AsyncGenerator<string>;
2
+ export declare function openaiStreamProvider(provider: Provider, apiKey: string): AsyncGenerator<any>;
3
3
  //# sourceMappingURL=openai-stream.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"openai-stream.d.ts","sourceRoot":"","sources":["../../src/providers/openai-stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,wBAAuB,oBAAoB,CACzC,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,GACb,cAAc,CAAC,MAAM,CAAC,CAqExB"}
1
+ {"version":3,"file":"openai-stream.d.ts","sourceRoot":"","sources":["../../src/providers/openai-stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,wBAAuB,oBAAoB,CACzC,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,GACb,cAAc,CAAC,GAAG,CAAC,CA8DrB"}
@@ -52,13 +52,8 @@ export async function* openaiStreamProvider(provider, apiKey) {
52
52
  }
53
53
  // OpenAI Responses streaming format: text chunks can appear in
54
54
  // event.output[0].content[*].text or event.output_text.
55
- const text = event.output_text ??
56
- (event.output?.[0]?.content
57
- ?.map((c) => (typeof c.text === 'string' ? c.text : ''))
58
- .join('') ?? '');
59
- if (text) {
60
- yield text;
61
- }
55
+ // Now yield the full event object for user access to all fields
56
+ yield event;
62
57
  }
63
58
  }
64
59
  }
@@ -1 +1 @@
1
- {"version":3,"file":"openai-stream.js","sourceRoot":"","sources":["../../src/providers/openai-stream.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,oBAAoB,CACzC,QAAkB,EAClB,MAAc;IAEd,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QACrB,MAAM,IAAI,QAAQ,CAAC,gCAAgC,EAAE,QAAQ,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,qCAAqC,EAAE;QAC7D,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,UAAU,MAAM,EAAE;SAClC;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,KAAK;YAC5B,KAAK,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE;YAClE,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,WAAW;YACxC,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS;YAC5C,MAAM,EAAE,IAAI;SACb,CAAC;KACH,CAAC,CAAC;IAEH,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAA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AAC;YACf,IAAI,CAAC;gBACH,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC3B,CAAC;YAAC,MAAM,CAAC;gBACP,sCAAsC;gBACtC,SAAS;YACX,CAAC;YAEA,+DAA+D;YAC/D,wDAAwD;YACxD,gEAAgE;YAChE,MAAM,KAAK,CAAC;QACf,CAAC;IACH,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dev-ai-sdk",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Universal AI SDK with a single syntax for multiple LLM providers",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -45,7 +45,6 @@
45
45
  "typescript": "^5.9.3"
46
46
  },
47
47
  "dependencies": {
48
- "dotenv": "^17.2.3"
49
48
  }
50
49
  }
51
50