@oh-my-pi/pi-ai 3.14.0 → 3.15.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.
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.1",
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",
@@ -3622,6 +3605,23 @@ export const MODELS = {
3622
3605
  contextWindow: 128000,
3623
3606
  maxTokens: 16384,
3624
3607
  } satisfies Model<"openai-completions">,
3608
+ "kwaipilot/kat-coder-pro": {
3609
+ id: "kwaipilot/kat-coder-pro",
3610
+ name: "Kwaipilot: KAT-Coder-Pro V1",
3611
+ api: "openai-completions",
3612
+ provider: "openrouter",
3613
+ baseUrl: "https://openrouter.ai/api/v1",
3614
+ reasoning: false,
3615
+ input: ["text"],
3616
+ cost: {
3617
+ input: 0.207,
3618
+ output: 0.828,
3619
+ cacheRead: 0.0414,
3620
+ cacheWrite: 0,
3621
+ },
3622
+ contextWindow: 256000,
3623
+ maxTokens: 128000,
3624
+ } satisfies Model<"openai-completions">,
3625
3625
  "kwaipilot/kat-coder-pro:free": {
3626
3626
  id: "kwaipilot/kat-coder-pro:free",
3627
3627
  name: "Kwaipilot: KAT-Coder-Pro V1 (free)",
@@ -4447,13 +4447,13 @@ export const MODELS = {
4447
4447
  reasoning: false,
4448
4448
  input: ["text"],
4449
4449
  cost: {
4450
- input: 0.456,
4451
- output: 1.8399999999999999,
4450
+ input: 0.5,
4451
+ output: 2.4,
4452
4452
  cacheRead: 0,
4453
4453
  cacheWrite: 0,
4454
4454
  },
4455
4455
  contextWindow: 131072,
4456
- maxTokens: 131072,
4456
+ maxTokens: 4096,
4457
4457
  } satisfies Model<"openai-completions">,
4458
4458
  "moonshotai/kimi-k2-0905": {
4459
4459
  id: "moonshotai/kimi-k2-0905",
@@ -4498,13 +4498,13 @@ export const MODELS = {
4498
4498
  reasoning: true,
4499
4499
  input: ["text"],
4500
4500
  cost: {
4501
- input: 0.39999999999999997,
4502
- output: 1.75,
4501
+ input: 0.32,
4502
+ output: 0.48,
4503
4503
  cacheRead: 0,
4504
4504
  cacheWrite: 0,
4505
4505
  },
4506
4506
  contextWindow: 262144,
4507
- maxTokens: 65535,
4507
+ maxTokens: 4096,
4508
4508
  } satisfies Model<"openai-completions">,
4509
4509
  "nex-agi/deepseek-v3.1-nex-n1:free": {
4510
4510
  id: "nex-agi/deepseek-v3.1-nex-n1:free",
@@ -4540,23 +4540,6 @@ export const MODELS = {
4540
4540
  contextWindow: 32768,
4541
4541
  maxTokens: 32768,
4542
4542
  } 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
4543
  "nousresearch/hermes-4-70b": {
4561
4544
  id: "nousresearch/hermes-4-70b",
4562
4545
  name: "Nous: Hermes 4 70B",
@@ -5371,7 +5354,7 @@ export const MODELS = {
5371
5354
  cacheWrite: 0,
5372
5355
  },
5373
5356
  contextWindow: 131072,
5374
- maxTokens: 131072,
5357
+ maxTokens: 4096,
5375
5358
  } satisfies Model<"openai-completions">,
5376
5359
  "openai/gpt-oss-safeguard-20b": {
5377
5360
  id: "openai/gpt-oss-safeguard-20b",
@@ -6028,8 +6011,8 @@ export const MODELS = {
6028
6011
  reasoning: false,
6029
6012
  input: ["text", "image"],
6030
6013
  cost: {
6031
- input: 0.19999999999999998,
6032
- output: 1.2,
6014
+ input: 0.12,
6015
+ output: 0.56,
6033
6016
  cacheRead: 0,
6034
6017
  cacheWrite: 0,
6035
6018
  },
@@ -6045,8 +6028,8 @@ export const MODELS = {
6045
6028
  reasoning: true,
6046
6029
  input: ["text", "image"],
6047
6030
  cost: {
6048
- input: 0.3,
6049
- output: 1.2,
6031
+ input: 0.44999999999999996,
6032
+ output: 3.5,
6050
6033
  cacheRead: 0,
6051
6034
  cacheWrite: 0,
6052
6035
  },
@@ -6274,23 +6257,6 @@ export const MODELS = {
6274
6257
  contextWindow: 163840,
6275
6258
  maxTokens: 65536,
6276
6259
  } 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
6260
  "x-ai/grok-3": {
6295
6261
  id: "x-ai/grok-3",
6296
6262
  name: "xAI: Grok 3",
@@ -6487,13 +6453,13 @@ export const MODELS = {
6487
6453
  reasoning: true,
6488
6454
  input: ["text"],
6489
6455
  cost: {
6490
- input: 0.13,
6491
- output: 0.85,
6456
+ input: 0.049999999999999996,
6457
+ output: 0.22,
6492
6458
  cacheRead: 0,
6493
6459
  cacheWrite: 0,
6494
6460
  },
6495
6461
  contextWindow: 131072,
6496
- maxTokens: 98304,
6462
+ maxTokens: 131072,
6497
6463
  } satisfies Model<"openai-completions">,
6498
6464
  "z-ai/glm-4.5-air:free": {
6499
6465
  id: "z-ai/glm-4.5-air:free",
@@ -6510,7 +6476,7 @@ export const MODELS = {
6510
6476
  cacheWrite: 0,
6511
6477
  },
6512
6478
  contextWindow: 131072,
6513
- maxTokens: 131072,
6479
+ maxTokens: 96000,
6514
6480
  } satisfies Model<"openai-completions">,
6515
6481
  "z-ai/glm-4.5v": {
6516
6482
  id: "z-ai/glm-4.5v",
@@ -6589,13 +6555,13 @@ export const MODELS = {
6589
6555
  reasoning: true,
6590
6556
  input: ["text"],
6591
6557
  cost: {
6592
- input: 0.39999999999999997,
6593
- output: 1.5,
6558
+ input: 0.16,
6559
+ output: 0.7999999999999999,
6594
6560
  cacheRead: 0,
6595
6561
  cacheWrite: 0,
6596
6562
  },
6597
6563
  contextWindow: 202752,
6598
- maxTokens: 65535,
6564
+ maxTokens: 4096,
6599
6565
  } satisfies Model<"openai-completions">,
6600
6566
  },
6601
6567
  "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