@rulvar/openai 1.246.0 → 1.248.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/dist/index.js +16 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -890,9 +890,25 @@ function resolveOpenAiClient(options) {
|
|
|
890
890
|
function openai(options = {}) {
|
|
891
891
|
const client = resolveOpenAiClient(options);
|
|
892
892
|
const ids = new OpenAiIdMap(createCanonicalIdMinter());
|
|
893
|
+
const declaredBaseUrl = options.baseURL ?? options.sdkOptions?.baseURL;
|
|
894
|
+
const baseUrlOrigin = declaredBaseUrl === void 0 || declaredBaseUrl === null ? void 0 : (() => {
|
|
895
|
+
try {
|
|
896
|
+
return new URL(declaredBaseUrl).origin;
|
|
897
|
+
} catch {
|
|
898
|
+
return declaredBaseUrl.slice(0, 128);
|
|
899
|
+
}
|
|
900
|
+
})();
|
|
901
|
+
const regulatedPosture = {
|
|
902
|
+
regulatedPosture: 1,
|
|
903
|
+
kind: "model-adapter",
|
|
904
|
+
name: "openai",
|
|
905
|
+
transport: options.client !== void 0 ? "preconstructed-client" : baseUrlOrigin !== void 0 ? "custom-base-url" : "official",
|
|
906
|
+
...options.client === void 0 && baseUrlOrigin !== void 0 ? { baseUrlOrigin } : {}
|
|
907
|
+
};
|
|
893
908
|
return {
|
|
894
909
|
id: "openai",
|
|
895
910
|
provider: "openai",
|
|
911
|
+
describeRegulatedPosture: () => regulatedPosture,
|
|
896
912
|
usageSemantics: "openai-cache-subsets-v2",
|
|
897
913
|
caps(model) {
|
|
898
914
|
return openAiModelInfo(model).caps;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rulvar/openai",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.248.0",
|
|
4
4
|
"description": "Rulvar first-class provider adapter for the OpenAI Responses API, plus the openaiCompatible factory.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"openai": "^6.49.0",
|
|
26
|
-
"@rulvar/core": "1.
|
|
26
|
+
"@rulvar/core": "1.248.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "^22.20.1",
|
|
30
30
|
"tsdown": "^0.22.14",
|
|
31
31
|
"typescript": "~6.0.3",
|
|
32
|
-
"@rulvar/testing": "1.
|
|
32
|
+
"@rulvar/testing": "1.248.0"
|
|
33
33
|
},
|
|
34
34
|
"repository": {
|
|
35
35
|
"type": "git",
|