@providerprotocol/ai 0.0.29 → 0.0.31
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/dist/anthropic/index.d.ts +11 -0
- package/dist/anthropic/index.js +7 -7
- package/dist/anthropic/index.js.map +1 -1
- package/dist/{chunk-Z6DKC37J.js → chunk-3C7O2RNO.js} +2 -2
- package/dist/{chunk-55X3W2MN.js → chunk-3D6XGGVG.js} +9 -2
- package/dist/{chunk-55X3W2MN.js.map → chunk-3D6XGGVG.js.map} +1 -1
- package/dist/{chunk-QNJO7DSD.js → chunk-4J6OFUKX.js} +10 -1
- package/dist/chunk-4J6OFUKX.js.map +1 -0
- package/dist/{chunk-SBCATNHA.js → chunk-KUPF5KHT.js} +2 -2
- package/dist/{embedding-DtyOFIsS.d.ts → embedding-k7g-BcSY.d.ts} +14 -1
- package/dist/google/index.d.ts +4 -0
- package/dist/google/index.js +14 -10
- package/dist/google/index.js.map +1 -1
- package/dist/http/index.d.ts +7 -2
- package/dist/http/index.js +9 -5
- package/dist/index.d.ts +3 -3
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/dist/ollama/index.js +24 -18
- package/dist/ollama/index.js.map +1 -1
- package/dist/openai/index.js +8 -11
- package/dist/openai/index.js.map +1 -1
- package/dist/openrouter/index.d.ts +1 -1
- package/dist/openrouter/index.js +6 -4
- package/dist/openrouter/index.js.map +1 -1
- package/dist/proxy/index.d.ts +1 -1
- package/dist/proxy/index.js +2 -2
- package/dist/{retry-DXLQnTuU.d.ts → retry-CyAwm_KZ.d.ts} +15 -1
- package/dist/xai/index.d.ts +15 -35
- package/dist/xai/index.js +11 -14
- package/dist/xai/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-QNJO7DSD.js.map +0 -1
- /package/dist/{chunk-Z6DKC37J.js.map → chunk-3C7O2RNO.js.map} +0 -0
- /package/dist/{chunk-SBCATNHA.js.map → chunk-KUPF5KHT.js.map} +0 -0
|
@@ -201,7 +201,7 @@ interface OpenRouterResponsesParams {
|
|
|
201
201
|
* Reasoning configuration
|
|
202
202
|
*/
|
|
203
203
|
reasoning?: {
|
|
204
|
-
effort?: 'low' | 'medium' | 'high';
|
|
204
|
+
effort?: 'low' | 'medium' | 'high' | 'xhigh' | 'minimal' | 'none';
|
|
205
205
|
};
|
|
206
206
|
/**
|
|
207
207
|
* Output modalities for multimodal generation.
|
package/dist/openrouter/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseJsonResponse
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-3C7O2RNO.js";
|
|
4
4
|
import {
|
|
5
5
|
StreamEventType
|
|
6
6
|
} from "../chunk-73IIE3QT.js";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "../chunk-TOJCZMVU.js";
|
|
18
18
|
import {
|
|
19
19
|
resolveApiKey
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-3D6XGGVG.js";
|
|
21
21
|
import {
|
|
22
22
|
ErrorCode,
|
|
23
23
|
ModalityType,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
doStreamFetch,
|
|
27
27
|
normalizeHttpError,
|
|
28
28
|
toError
|
|
29
|
-
} from "../chunk-
|
|
29
|
+
} from "../chunk-4J6OFUKX.js";
|
|
30
30
|
|
|
31
31
|
// src/providers/openrouter/transform.completions.ts
|
|
32
32
|
function transformRequest(request, modelId) {
|
|
@@ -1608,6 +1608,7 @@ function createResponsesLLMHandler() {
|
|
|
1608
1608
|
const baseUrl = request.config.baseUrl ?? OPENROUTER_RESPONSES_API_URL;
|
|
1609
1609
|
const body = transformRequest2(request, modelId);
|
|
1610
1610
|
body.stream = true;
|
|
1611
|
+
body.stream_options = { include_usage: true };
|
|
1611
1612
|
const headers = {
|
|
1612
1613
|
"Content-Type": "application/json",
|
|
1613
1614
|
Authorization: `Bearer ${apiKey}`,
|
|
@@ -1790,7 +1791,8 @@ function createEmbeddingHandler() {
|
|
|
1790
1791
|
index: d.index
|
|
1791
1792
|
})),
|
|
1792
1793
|
usage: { totalTokens: data.usage.total_tokens },
|
|
1793
|
-
|
|
1794
|
+
// Response metadata namespaced under provider (Spec 15.4)
|
|
1795
|
+
metadata: data.usage.cost !== void 0 ? { openrouter: { cost: data.usage.cost } } : void 0
|
|
1794
1796
|
};
|
|
1795
1797
|
}
|
|
1796
1798
|
};
|