@oh-my-pi/pi-ai 3.14.0 → 3.15.0

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
@@ -121,7 +121,6 @@ for (const call of toolCalls) {
121
121
  toolCallId: call.id,
122
122
  toolName: call.name,
123
123
  content: [{ type: "text", text: result }],
124
- isError: false,
125
124
  timestamp: Date.now(),
126
125
  });
127
126
  }
@@ -209,7 +208,6 @@ for (const block of response.content) {
209
208
  toolCallId: block.id,
210
209
  toolName: block.name,
211
210
  content: [{ type: "text", text: JSON.stringify(result) }],
212
- isError: false,
213
211
  timestamp: Date.now(),
214
212
  });
215
213
  }
@@ -225,7 +223,6 @@ context.messages.push({
225
223
  { type: "text", text: "Generated chart showing temperature trends" },
226
224
  { type: "image", data: imageBuffer.toString("base64"), mimeType: "image/png" },
227
225
  ],
228
- isError: false,
229
226
  timestamp: Date.now(),
230
227
  });
231
228
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oh-my-pi/pi-ai",
3
- "version": "3.14.0",
3
+ "version": "3.15.0",
4
4
  "description": "Unified LLM API with automatic model discovery and provider configuration",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -1387,7 +1387,7 @@ export const MODELS = {
1387
1387
  cacheWrite: 0,
1388
1388
  },
1389
1389
  contextWindow: 131072,
1390
- maxTokens: 8192,
1390
+ maxTokens: 131072,
1391
1391
  } satisfies Model<"openai-completions">,
1392
1392
  "llama-3.3-70b-versatile": {
1393
1393
  id: "llama-3.3-70b-versatile",
@@ -1535,12 +1535,12 @@ export const MODELS = {
1535
1535
  input: ["text"],
1536
1536
  cost: {
1537
1537
  input: 0.15,
1538
- output: 0.75,
1538
+ output: 0.6,
1539
1539
  cacheRead: 0,
1540
1540
  cacheWrite: 0,
1541
1541
  },
1542
1542
  contextWindow: 131072,
1543
- maxTokens: 32768,
1543
+ maxTokens: 65536,
1544
1544
  } satisfies Model<"openai-completions">,
1545
1545
  "openai/gpt-oss-20b": {
1546
1546
  id: "openai/gpt-oss-20b",
@@ -1551,13 +1551,13 @@ export const MODELS = {
1551
1551
  reasoning: true,
1552
1552
  input: ["text"],
1553
1553
  cost: {
1554
- input: 0.1,
1555
- output: 0.5,
1554
+ input: 0.075,
1555
+ output: 0.3,
1556
1556
  cacheRead: 0,
1557
1557
  cacheWrite: 0,
1558
1558
  },
1559
1559
  contextWindow: 131072,
1560
- maxTokens: 32768,
1560
+ maxTokens: 65536,
1561
1561
  } satisfies Model<"openai-completions">,
1562
1562
  "qwen-qwq-32b": {
1563
1563
  id: "qwen-qwq-32b",
@@ -2636,23 +2636,6 @@ export const MODELS = {
2636
2636
  contextWindow: 131072,
2637
2637
  maxTokens: 131072,
2638
2638
  } satisfies Model<"openai-completions">,
2639
- "alibaba/tongyi-deepresearch-30b-a3b:free": {
2640
- id: "alibaba/tongyi-deepresearch-30b-a3b:free",
2641
- name: "Tongyi DeepResearch 30B A3B (free)",
2642
- api: "openai-completions",
2643
- provider: "openrouter",
2644
- baseUrl: "https://openrouter.ai/api/v1",
2645
- reasoning: true,
2646
- input: ["text"],
2647
- cost: {
2648
- input: 0,
2649
- output: 0,
2650
- cacheRead: 0,
2651
- cacheWrite: 0,
2652
- },
2653
- contextWindow: 131072,
2654
- maxTokens: 131072,
2655
- } satisfies Model<"openai-completions">,
2656
2639
  "allenai/olmo-3-7b-instruct": {
2657
2640
  id: "allenai/olmo-3-7b-instruct",
2658
2641
  name: "AllenAI: Olmo 3 7B Instruct",
@@ -3206,13 +3189,13 @@ export const MODELS = {
3206
3189
  reasoning: true,
3207
3190
  input: ["text"],
3208
3191
  cost: {
3209
- input: 0.19999999999999998,
3210
- output: 0.88,
3211
- cacheRead: 0.106,
3192
+ input: 0.19,
3193
+ output: 0.87,
3194
+ cacheRead: 0,
3212
3195
  cacheWrite: 0,
3213
3196
  },
3214
3197
  contextWindow: 163840,
3215
- maxTokens: 4096,
3198
+ maxTokens: 65536,
3216
3199
  } satisfies Model<"openai-completions">,
3217
3200
  "deepseek/deepseek-chat-v3.1": {
3218
3201
  id: "deepseek/deepseek-chat-v3.1",
@@ -3240,13 +3223,13 @@ export const MODELS = {
3240
3223
  reasoning: true,
3241
3224
  input: ["text"],
3242
3225
  cost: {
3243
- input: 0.3,
3244
- output: 1.2,
3226
+ input: 0.7,
3227
+ output: 2.4,
3245
3228
  cacheRead: 0,
3246
3229
  cacheWrite: 0,
3247
3230
  },
3248
3231
  contextWindow: 163840,
3249
- maxTokens: 4096,
3232
+ maxTokens: 163840,
3250
3233
  } satisfies Model<"openai-completions">,
3251
3234
  "deepseek/deepseek-r1-0528": {
3252
3235
  id: "deepseek/deepseek-r1-0528",
@@ -4447,13 +4430,13 @@ export const MODELS = {
4447
4430
  reasoning: false,
4448
4431
  input: ["text"],
4449
4432
  cost: {
4450
- input: 0.456,
4451
- output: 1.8399999999999999,
4433
+ input: 0.5,
4434
+ output: 2.4,
4452
4435
  cacheRead: 0,
4453
4436
  cacheWrite: 0,
4454
4437
  },
4455
4438
  contextWindow: 131072,
4456
- maxTokens: 131072,
4439
+ maxTokens: 4096,
4457
4440
  } satisfies Model<"openai-completions">,
4458
4441
  "moonshotai/kimi-k2-0905": {
4459
4442
  id: "moonshotai/kimi-k2-0905",
@@ -4498,13 +4481,13 @@ export const MODELS = {
4498
4481
  reasoning: true,
4499
4482
  input: ["text"],
4500
4483
  cost: {
4501
- input: 0.39999999999999997,
4502
- output: 1.75,
4484
+ input: 0.32,
4485
+ output: 0.48,
4503
4486
  cacheRead: 0,
4504
4487
  cacheWrite: 0,
4505
4488
  },
4506
4489
  contextWindow: 262144,
4507
- maxTokens: 65535,
4490
+ maxTokens: 4096,
4508
4491
  } satisfies Model<"openai-completions">,
4509
4492
  "nex-agi/deepseek-v3.1-nex-n1:free": {
4510
4493
  id: "nex-agi/deepseek-v3.1-nex-n1:free",
@@ -4540,23 +4523,6 @@ export const MODELS = {
4540
4523
  contextWindow: 32768,
4541
4524
  maxTokens: 32768,
4542
4525
  } satisfies Model<"openai-completions">,
4543
- "nousresearch/hermes-4-405b": {
4544
- id: "nousresearch/hermes-4-405b",
4545
- name: "Nous: Hermes 4 405B",
4546
- api: "openai-completions",
4547
- provider: "openrouter",
4548
- baseUrl: "https://openrouter.ai/api/v1",
4549
- reasoning: true,
4550
- input: ["text"],
4551
- cost: {
4552
- input: 0.3,
4553
- output: 1.2,
4554
- cacheRead: 0,
4555
- cacheWrite: 0,
4556
- },
4557
- contextWindow: 131072,
4558
- maxTokens: 131072,
4559
- } satisfies Model<"openai-completions">,
4560
4526
  "nousresearch/hermes-4-70b": {
4561
4527
  id: "nousresearch/hermes-4-70b",
4562
4528
  name: "Nous: Hermes 4 70B",
@@ -5371,7 +5337,7 @@ export const MODELS = {
5371
5337
  cacheWrite: 0,
5372
5338
  },
5373
5339
  contextWindow: 131072,
5374
- maxTokens: 131072,
5340
+ maxTokens: 4096,
5375
5341
  } satisfies Model<"openai-completions">,
5376
5342
  "openai/gpt-oss-safeguard-20b": {
5377
5343
  id: "openai/gpt-oss-safeguard-20b",
@@ -6028,8 +5994,8 @@ export const MODELS = {
6028
5994
  reasoning: false,
6029
5995
  input: ["text", "image"],
6030
5996
  cost: {
6031
- input: 0.19999999999999998,
6032
- output: 1.2,
5997
+ input: 0.12,
5998
+ output: 0.56,
6033
5999
  cacheRead: 0,
6034
6000
  cacheWrite: 0,
6035
6001
  },
@@ -6045,8 +6011,8 @@ export const MODELS = {
6045
6011
  reasoning: true,
6046
6012
  input: ["text", "image"],
6047
6013
  cost: {
6048
- input: 0.3,
6049
- output: 1.2,
6014
+ input: 0.44999999999999996,
6015
+ output: 3.5,
6050
6016
  cacheRead: 0,
6051
6017
  cacheWrite: 0,
6052
6018
  },
@@ -6274,23 +6240,6 @@ export const MODELS = {
6274
6240
  contextWindow: 163840,
6275
6241
  maxTokens: 65536,
6276
6242
  } satisfies Model<"openai-completions">,
6277
- "tngtech/tng-r1t-chimera:free": {
6278
- id: "tngtech/tng-r1t-chimera:free",
6279
- name: "TNG: R1T Chimera (free)",
6280
- api: "openai-completions",
6281
- provider: "openrouter",
6282
- baseUrl: "https://openrouter.ai/api/v1",
6283
- reasoning: true,
6284
- input: ["text"],
6285
- cost: {
6286
- input: 0,
6287
- output: 0,
6288
- cacheRead: 0,
6289
- cacheWrite: 0,
6290
- },
6291
- contextWindow: 163840,
6292
- maxTokens: 163840,
6293
- } satisfies Model<"openai-completions">,
6294
6243
  "x-ai/grok-3": {
6295
6244
  id: "x-ai/grok-3",
6296
6245
  name: "xAI: Grok 3",
@@ -6487,13 +6436,13 @@ export const MODELS = {
6487
6436
  reasoning: true,
6488
6437
  input: ["text"],
6489
6438
  cost: {
6490
- input: 0.13,
6491
- output: 0.85,
6439
+ input: 0.049999999999999996,
6440
+ output: 0.22,
6492
6441
  cacheRead: 0,
6493
6442
  cacheWrite: 0,
6494
6443
  },
6495
6444
  contextWindow: 131072,
6496
- maxTokens: 98304,
6445
+ maxTokens: 131072,
6497
6446
  } satisfies Model<"openai-completions">,
6498
6447
  "z-ai/glm-4.5-air:free": {
6499
6448
  id: "z-ai/glm-4.5-air:free",
@@ -6510,7 +6459,7 @@ export const MODELS = {
6510
6459
  cacheWrite: 0,
6511
6460
  },
6512
6461
  contextWindow: 131072,
6513
- maxTokens: 131072,
6462
+ maxTokens: 96000,
6514
6463
  } satisfies Model<"openai-completions">,
6515
6464
  "z-ai/glm-4.5v": {
6516
6465
  id: "z-ai/glm-4.5v",
@@ -6589,13 +6538,13 @@ export const MODELS = {
6589
6538
  reasoning: true,
6590
6539
  input: ["text"],
6591
6540
  cost: {
6592
- input: 0.39999999999999997,
6593
- output: 1.5,
6541
+ input: 0.16,
6542
+ output: 0.7999999999999999,
6594
6543
  cacheRead: 0,
6595
6544
  cacheWrite: 0,
6596
6545
  },
6597
6546
  contextWindow: 202752,
6598
- maxTokens: 65535,
6547
+ maxTokens: 4096,
6599
6548
  } satisfies Model<"openai-completions">,
6600
6549
  },
6601
6550
  "xai": {
package/src/types.ts CHANGED
@@ -138,7 +138,7 @@ export interface ToolResultMessage<TDetails = any> {
138
138
  toolName: string;
139
139
  content: (TextContent | ImageContent)[]; // Supports text and images
140
140
  details?: TDetails;
141
- isError: boolean;
141
+ isError?: boolean;
142
142
  timestamp: number; // Unix timestamp in milliseconds
143
143
  }
144
144