@llmops/sdk 0.5.0 → 0.5.1-beta.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/express.d.cts +2 -2
- package/dist/express.d.mts +2 -2
- package/dist/hono.d.cts +1 -1
- package/dist/hono.d.mts +1 -1
- package/dist/{index-BUNt7GzB.d.mts → index-7fTYtVGt.d.cts} +1 -1
- package/dist/{index-BbeQtPGT.d.cts → index-CPjAvkra.d.mts} +1 -1
- package/dist/{index-B2A4WBGq.d.cts → index-Cl7DD75E.d.cts} +6 -0
- package/dist/{index-DFnEar4S.d.mts → index-Qv1H7vX_.d.mts} +6 -0
- package/dist/index.cjs +15 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +15 -2
- package/dist/nextjs.d.cts +1 -1
- package/dist/nextjs.d.mts +1 -1
- package/package.json +3 -3
package/dist/express.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import { t as createLLMOpsMiddleware } from "./index-
|
|
1
|
+
import "./index-Cl7DD75E.cjs";
|
|
2
|
+
import { t as createLLMOpsMiddleware } from "./index-7fTYtVGt.cjs";
|
|
3
3
|
export { createLLMOpsMiddleware };
|
package/dist/express.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import { t as createLLMOpsMiddleware } from "./index-
|
|
1
|
+
import "./index-Qv1H7vX_.mjs";
|
|
2
|
+
import { t as createLLMOpsMiddleware } from "./index-CPjAvkra.mjs";
|
|
3
3
|
export { createLLMOpsMiddleware };
|
package/dist/hono.d.cts
CHANGED
package/dist/hono.d.mts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { LLMOpsConfig } from "@llmops/core";
|
|
2
2
|
|
|
3
3
|
//#region src/client/index.d.ts
|
|
4
|
+
type ProviderConfig = {
|
|
5
|
+
baseURL: string;
|
|
6
|
+
apiKey: string;
|
|
7
|
+
fetch: typeof globalThis.fetch;
|
|
8
|
+
};
|
|
4
9
|
type LLMOpsClient = {
|
|
5
10
|
handler: (request: Request) => Promise<Response>;
|
|
6
11
|
config: LLMOpsConfig;
|
|
12
|
+
provider: () => ProviderConfig;
|
|
7
13
|
};
|
|
8
14
|
declare const createLLMOps: (config: LLMOpsConfig) => LLMOpsClient;
|
|
9
15
|
//#endregion
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { LLMOpsConfig } from "@llmops/core";
|
|
2
2
|
|
|
3
3
|
//#region src/client/index.d.ts
|
|
4
|
+
type ProviderConfig = {
|
|
5
|
+
baseURL: string;
|
|
6
|
+
apiKey: string;
|
|
7
|
+
fetch: typeof globalThis.fetch;
|
|
8
|
+
};
|
|
4
9
|
type LLMOpsClient = {
|
|
5
10
|
handler: (request: Request) => Promise<Response>;
|
|
6
11
|
config: LLMOpsConfig;
|
|
12
|
+
provider: () => ProviderConfig;
|
|
7
13
|
};
|
|
8
14
|
declare const createLLMOps: (config: LLMOpsConfig) => LLMOpsClient;
|
|
9
15
|
//#endregion
|
package/dist/index.cjs
CHANGED
|
@@ -17,9 +17,22 @@ var AuthFeatureNotAvailableError = class extends Error {
|
|
|
17
17
|
//#region src/client/index.ts
|
|
18
18
|
const createLLMOps = (config) => {
|
|
19
19
|
const { app } = (0, __llmops_app.createApp)(config);
|
|
20
|
+
const handler = async (req) => app.fetch(req, void 0, void 0);
|
|
21
|
+
const basePath = config.basePath;
|
|
22
|
+
const internalFetch = (input, init) => {
|
|
23
|
+
const request = new Request(input, init);
|
|
24
|
+
const url = new URL(request.url);
|
|
25
|
+
if (basePath && basePath !== "/" && url.pathname.startsWith(basePath)) url.pathname = url.pathname.slice(basePath.length) || "/";
|
|
26
|
+
return handler(new Request(url.toString(), request));
|
|
27
|
+
};
|
|
20
28
|
return {
|
|
21
|
-
handler
|
|
22
|
-
config: Object.freeze(config)
|
|
29
|
+
handler,
|
|
30
|
+
config: Object.freeze(config),
|
|
31
|
+
provider: () => ({
|
|
32
|
+
baseURL: `http://localhost${basePath}/api/genai/v1`,
|
|
33
|
+
apiKey: "llmops",
|
|
34
|
+
fetch: internalFetch
|
|
35
|
+
})
|
|
23
36
|
};
|
|
24
37
|
};
|
|
25
38
|
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as createLLMOps, t as LLMOpsClient } from "./index-
|
|
2
|
-
import { t as createLLMOpsMiddleware } from "./index-
|
|
1
|
+
import { n as createLLMOps, t as LLMOpsClient } from "./index-Cl7DD75E.cjs";
|
|
2
|
+
import { t as createLLMOpsMiddleware } from "./index-7fTYtVGt.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/lib/auth/client.d.ts
|
|
5
5
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as createLLMOps, t as LLMOpsClient } from "./index-
|
|
2
|
-
import { t as createLLMOpsMiddleware } from "./index-
|
|
1
|
+
import { n as createLLMOps, t as LLMOpsClient } from "./index-Qv1H7vX_.mjs";
|
|
2
|
+
import { t as createLLMOpsMiddleware } from "./index-CPjAvkra.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/lib/auth/client.d.ts
|
|
5
5
|
|
package/dist/index.mjs
CHANGED
|
@@ -17,9 +17,22 @@ var AuthFeatureNotAvailableError = class extends Error {
|
|
|
17
17
|
//#region src/client/index.ts
|
|
18
18
|
const createLLMOps = (config) => {
|
|
19
19
|
const { app } = createApp(config);
|
|
20
|
+
const handler = async (req) => app.fetch(req, void 0, void 0);
|
|
21
|
+
const basePath = config.basePath;
|
|
22
|
+
const internalFetch = (input, init) => {
|
|
23
|
+
const request = new Request(input, init);
|
|
24
|
+
const url = new URL(request.url);
|
|
25
|
+
if (basePath && basePath !== "/" && url.pathname.startsWith(basePath)) url.pathname = url.pathname.slice(basePath.length) || "/";
|
|
26
|
+
return handler(new Request(url.toString(), request));
|
|
27
|
+
};
|
|
20
28
|
return {
|
|
21
|
-
handler
|
|
22
|
-
config: Object.freeze(config)
|
|
29
|
+
handler,
|
|
30
|
+
config: Object.freeze(config),
|
|
31
|
+
provider: () => ({
|
|
32
|
+
baseURL: `http://localhost${basePath}/api/genai/v1`,
|
|
33
|
+
apiKey: "llmops",
|
|
34
|
+
fetch: internalFetch
|
|
35
|
+
})
|
|
23
36
|
};
|
|
24
37
|
};
|
|
25
38
|
|
package/dist/nextjs.d.cts
CHANGED
package/dist/nextjs.d.mts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llmops/sdk",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1-beta.2",
|
|
4
4
|
"description": "An LLMOps toolkit for TypeScript applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"access": "public"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@llmops/app": "^0.5.
|
|
78
|
-
"@llmops/core": "^0.5.
|
|
77
|
+
"@llmops/app": "^0.5.1-beta.2",
|
|
78
|
+
"@llmops/core": "^0.5.1-beta.2"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@types/express": "^5.0.6",
|