@oh-my-pi/pi-ai 14.5.6 → 14.5.8

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-ai",
4
- "version": "14.5.6",
4
+ "version": "14.5.8",
5
5
  "description": "Unified LLM API with automatic model discovery and provider configuration",
6
6
  "homepage": "https://github.com/can1357/oh-my-pi",
7
7
  "author": "Can Boluk",
@@ -46,8 +46,8 @@
46
46
  "@aws-sdk/credential-provider-node": "^3.972.36",
47
47
  "@bufbuild/protobuf": "^2.12.0",
48
48
  "@google/genai": "^1.50.1",
49
- "@oh-my-pi/pi-natives": "14.5.6",
50
- "@oh-my-pi/pi-utils": "14.5.6",
49
+ "@oh-my-pi/pi-natives": "14.5.8",
50
+ "@oh-my-pi/pi-utils": "14.5.8",
51
51
  "@sinclair/typebox": "^0.34.49",
52
52
  "@smithy/node-http-handler": "^4.6.1",
53
53
  "ajv": "^8.20.0",
package/src/stream.ts CHANGED
@@ -196,8 +196,13 @@ export function stream<TApi extends Api>(
196
196
 
197
197
  const api: Api = model.api;
198
198
  switch (api) {
199
- case "anthropic-messages":
200
- return streamAnthropic(model as Model<"anthropic-messages">, context, providerOptions);
199
+ case "anthropic-messages": {
200
+ const anthropicOptions = providerOptions as AnthropicOptions;
201
+ return streamAnthropic(model as Model<"anthropic-messages">, context, {
202
+ ...anthropicOptions,
203
+ isOAuth: anthropicOptions.isOAuth ?? model.isOAuth,
204
+ });
205
+ }
201
206
 
202
207
  case "openai-completions":
203
208
  return streamOpenAICompletions(model as Model<"openai-completions">, context, providerOptions as any);
package/src/types.ts CHANGED
@@ -587,4 +587,11 @@ export interface Model<TApi extends Api = any> {
587
587
  * - `"function"` or undefined: JSON function-tool with `{input: string}` (spec §1.2).
588
588
  */
589
589
  applyPatchToolType?: "freeform" | "function";
590
+ /**
591
+ * Force OAuth-style request shaping for providers whose API key prefix doesn't
592
+ * match an OAuth token (e.g. routing Anthropic traffic through a proxy that
593
+ * expects Claude Code framing). When true, the streaming layer sets
594
+ * `options.isOAuth = true` for the underlying provider call.
595
+ */
596
+ isOAuth?: boolean;
590
597
  }