@llmops/app 0.4.2-beta.1 → 0.4.2
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.cjs +21 -2
- package/dist/index.mjs +21 -2
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -16164,11 +16164,30 @@ const app$10 = new hono.Hono().post("/", zv("param", zod_default.object({ id: zo
|
|
|
16164
16164
|
const config$1 = await db.getProviderConfigById({ id: configId });
|
|
16165
16165
|
if (config$1) providerConfigs.set(configId, { slug: config$1.slug });
|
|
16166
16166
|
}
|
|
16167
|
+
const forwardedProto = c.req.header("x-forwarded-proto");
|
|
16168
|
+
const forwardedHost = c.req.header("x-forwarded-host") || c.req.header("host");
|
|
16167
16169
|
const url$2 = new URL(c.req.url);
|
|
16168
|
-
const
|
|
16170
|
+
const protocol = forwardedProto ? `${forwardedProto}:` : url$2.protocol;
|
|
16171
|
+
const host = forwardedHost || url$2.host;
|
|
16172
|
+
const baseURL = `${protocol}//${host}`;
|
|
16169
16173
|
const basePath = c.get("llmopsConfig")?.basePath || "";
|
|
16174
|
+
const gatewayPath = basePath === "/" ? "/api/genai/v1" : `${basePath}/api/genai/v1`;
|
|
16175
|
+
const gatewayBaseURL = `${baseURL}${gatewayPath}`;
|
|
16176
|
+
__llmops_core.logger.info({
|
|
16177
|
+
msg: "Playground execute: constructing gateway URL",
|
|
16178
|
+
forwardedProto,
|
|
16179
|
+
forwardedHost,
|
|
16180
|
+
urlProtocol: url$2.protocol,
|
|
16181
|
+
urlHost: url$2.host,
|
|
16182
|
+
protocol,
|
|
16183
|
+
host,
|
|
16184
|
+
baseURL,
|
|
16185
|
+
basePath,
|
|
16186
|
+
gatewayPath,
|
|
16187
|
+
gatewayBaseURL
|
|
16188
|
+
});
|
|
16170
16189
|
const openai$1 = new openai.default({
|
|
16171
|
-
baseURL:
|
|
16190
|
+
baseURL: gatewayBaseURL,
|
|
16172
16191
|
apiKey: secret.keyValue
|
|
16173
16192
|
});
|
|
16174
16193
|
await db.updatePlaygroundRun({
|
package/dist/index.mjs
CHANGED
|
@@ -16135,11 +16135,30 @@ const app$10 = new Hono().post("/", zv("param", zod_default.object({ id: zod_def
|
|
|
16135
16135
|
const config$1 = await db.getProviderConfigById({ id: configId });
|
|
16136
16136
|
if (config$1) providerConfigs.set(configId, { slug: config$1.slug });
|
|
16137
16137
|
}
|
|
16138
|
+
const forwardedProto = c.req.header("x-forwarded-proto");
|
|
16139
|
+
const forwardedHost = c.req.header("x-forwarded-host") || c.req.header("host");
|
|
16138
16140
|
const url$1 = new URL(c.req.url);
|
|
16139
|
-
const
|
|
16141
|
+
const protocol = forwardedProto ? `${forwardedProto}:` : url$1.protocol;
|
|
16142
|
+
const host = forwardedHost || url$1.host;
|
|
16143
|
+
const baseURL = `${protocol}//${host}`;
|
|
16140
16144
|
const basePath = c.get("llmopsConfig")?.basePath || "";
|
|
16145
|
+
const gatewayPath = basePath === "/" ? "/api/genai/v1" : `${basePath}/api/genai/v1`;
|
|
16146
|
+
const gatewayBaseURL = `${baseURL}${gatewayPath}`;
|
|
16147
|
+
logger.info({
|
|
16148
|
+
msg: "Playground execute: constructing gateway URL",
|
|
16149
|
+
forwardedProto,
|
|
16150
|
+
forwardedHost,
|
|
16151
|
+
urlProtocol: url$1.protocol,
|
|
16152
|
+
urlHost: url$1.host,
|
|
16153
|
+
protocol,
|
|
16154
|
+
host,
|
|
16155
|
+
baseURL,
|
|
16156
|
+
basePath,
|
|
16157
|
+
gatewayPath,
|
|
16158
|
+
gatewayBaseURL
|
|
16159
|
+
});
|
|
16141
16160
|
const openai = new OpenAI({
|
|
16142
|
-
baseURL:
|
|
16161
|
+
baseURL: gatewayBaseURL,
|
|
16143
16162
|
apiKey: secret.keyValue
|
|
16144
16163
|
});
|
|
16145
16164
|
await db.updatePlaygroundRun({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llmops/app",
|
|
3
|
-
"version": "0.4.2
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "LLMOps application with server and client",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
"react-hook-form": "^7.68.0",
|
|
77
77
|
"recharts": "^3.6.0",
|
|
78
78
|
"uuid": "^13.0.0",
|
|
79
|
-
"@llmops/
|
|
80
|
-
"@llmops/
|
|
79
|
+
"@llmops/core": "^0.4.2",
|
|
80
|
+
"@llmops/gateway": "^0.4.2"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
83
|
"react": "^19.2.1",
|