@intuned/browser-dev 0.1.14-dev.0 → 0.1.14-dev.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/dist/intunedServices/ApiGateway/aiApiGateway.js +2 -3
- package/dist/intunedServices/ApiGateway/providers/Anthropic.js +1 -1
- package/dist/intunedServices/ApiGateway/providers/Gemini.js +1 -1
- package/dist/intunedServices/ApiGateway/providers/OpenAI.js +1 -1
- package/dist/intunedServices/ApiGateway/tests/testApiGateway.spec.js +1 -1
- package/package.json +1 -1
|
@@ -10,7 +10,6 @@ var _OpenAI = require("./providers/OpenAI");
|
|
|
10
10
|
var _Gemini = require("./providers/Gemini");
|
|
11
11
|
var _dotenv = require("dotenv");
|
|
12
12
|
var _loadRuntime = require("../../common/loadRuntime");
|
|
13
|
-
var _jwtTokenManager = require("../../common/jwtTokenManager");
|
|
14
13
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
15
14
|
(0, _dotenv.config)();
|
|
16
15
|
class APIGateway {
|
|
@@ -47,7 +46,7 @@ class APIGateway {
|
|
|
47
46
|
apiKey
|
|
48
47
|
} = runtime.getAiGatewayConfig();
|
|
49
48
|
if (apiKey) {
|
|
50
|
-
|
|
49
|
+
this.gatewayAuthToken = apiKey;
|
|
51
50
|
}
|
|
52
51
|
} catch {}
|
|
53
52
|
this.isInitialized = true;
|
|
@@ -119,7 +118,7 @@ class APIGateway {
|
|
|
119
118
|
const baseUrl = this.buildGatewayUrl();
|
|
120
119
|
return {
|
|
121
120
|
model: this.model,
|
|
122
|
-
apiKey:
|
|
121
|
+
apiKey: this.gatewayAuthToken,
|
|
123
122
|
extraHeaders,
|
|
124
123
|
baseUrl
|
|
125
124
|
};
|
|
@@ -17,7 +17,7 @@ const createAnthropicInstance = input => {
|
|
|
17
17
|
});
|
|
18
18
|
} else {
|
|
19
19
|
return (0, _anthropic.createAnthropic)({
|
|
20
|
-
apiKey: "--THI_VALUE_WILL_BE_REPLACED_BY_INTUNED_BE--",
|
|
20
|
+
apiKey: apiKey || "--THI_VALUE_WILL_BE_REPLACED_BY_INTUNED_BE--",
|
|
21
21
|
baseURL: baseUrl,
|
|
22
22
|
fetch: _jwtTokenManager.backendFunctionsTokenManager.fetchWithToken.bind(_jwtTokenManager.backendFunctionsTokenManager)
|
|
23
23
|
});
|
|
@@ -19,7 +19,7 @@ const createGoogleInstance = input => {
|
|
|
19
19
|
});
|
|
20
20
|
} else {
|
|
21
21
|
return (0, _google.createGoogleGenerativeAI)({
|
|
22
|
-
apiKey: "--THI_VALUE_WILL_BE_REPLACED_BY_INTUNED_BE--",
|
|
22
|
+
apiKey: apiKey || "--THI_VALUE_WILL_BE_REPLACED_BY_INTUNED_BE--",
|
|
23
23
|
headers,
|
|
24
24
|
baseURL: baseUrl,
|
|
25
25
|
fetch: _jwtTokenManager.backendFunctionsTokenManager.fetchWithToken.bind(_jwtTokenManager.backendFunctionsTokenManager)
|
|
@@ -19,7 +19,7 @@ const createOpenAIInstance = input => {
|
|
|
19
19
|
});
|
|
20
20
|
} else {
|
|
21
21
|
return (0, _openai.createOpenAI)({
|
|
22
|
-
apiKey: "--THI_VALUE_WILL_BE_REPLACED_BY_INTUNED_BE--",
|
|
22
|
+
apiKey: apiKey || "--THI_VALUE_WILL_BE_REPLACED_BY_INTUNED_BE--",
|
|
23
23
|
headers,
|
|
24
24
|
baseURL: baseUrl,
|
|
25
25
|
fetch: _jwtTokenManager.backendFunctionsTokenManager.fetchWithToken.bind(_jwtTokenManager.backendFunctionsTokenManager)
|
|
@@ -233,7 +233,7 @@ const mockLoadRuntime = _vitest.vi.mocked(_loadRuntime.loadRuntime);
|
|
|
233
233
|
});
|
|
234
234
|
const result = await gateway.createProviderInstance();
|
|
235
235
|
(0, _extendedTest.expect)(mockCreateAnthropicInstance).toHaveBeenCalledWith({
|
|
236
|
-
apiKey:
|
|
236
|
+
apiKey: undefined,
|
|
237
237
|
headers: undefined,
|
|
238
238
|
model: "claude-3-sonnet",
|
|
239
239
|
baseUrl: "https://functions.example.com/api/workspace123/functions/integration456/intuned-ai-gateway"
|