@xsai/model 0.1.0-beta.5 → 0.1.0-beta.6
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 +12 -8
- package/package.json +7 -10
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
// src/utils/list-models.ts
|
|
2
|
+
import { requestHeaders, requestURL, responseJSON } from "@xsai/shared";
|
|
3
|
+
var listModels = async (options) => (options.fetch ?? globalThis.fetch)(requestURL("models", options.baseURL), {
|
|
4
4
|
headers: requestHeaders({
|
|
5
5
|
"Content-Type": "application/json",
|
|
6
6
|
...options.headers
|
|
@@ -8,12 +8,16 @@ const listModels = async (options) => (options.fetch ?? globalThis.fetch)(reques
|
|
|
8
8
|
signal: options.abortSignal
|
|
9
9
|
}).then(responseJSON).then(({ data }) => data);
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
// src/utils/retrieve-model.ts
|
|
12
|
+
import { requestHeaders as requestHeaders2, requestURL as requestURL2, responseJSON as responseJSON2 } from "@xsai/shared";
|
|
13
|
+
var retrieveModel = async (options) => (options.fetch ?? globalThis.fetch)(requestURL2(`models/${options.model}`, options.baseURL), {
|
|
14
|
+
headers: requestHeaders2({
|
|
13
15
|
"Content-Type": "application/json",
|
|
14
16
|
...options.headers
|
|
15
17
|
}, options.apiKey),
|
|
16
18
|
signal: options.abortSignal
|
|
17
|
-
}).then(
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
}).then(responseJSON2);
|
|
20
|
+
export {
|
|
21
|
+
listModels,
|
|
22
|
+
retrieveModel
|
|
23
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsai/model",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.0-beta.
|
|
4
|
+
"version": "0.1.0-beta.6",
|
|
5
5
|
"description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.",
|
|
6
6
|
"author": "Moeru AI",
|
|
7
7
|
"license": "MIT",
|
|
@@ -22,23 +22,20 @@
|
|
|
22
22
|
".": {
|
|
23
23
|
"types": "./dist/index.d.ts",
|
|
24
24
|
"default": "./dist/index.js"
|
|
25
|
-
}
|
|
25
|
+
},
|
|
26
|
+
"./package.json": "./package.json"
|
|
26
27
|
},
|
|
27
|
-
"main": "./dist/index.js",
|
|
28
|
-
"types": "./dist/index.d.ts",
|
|
29
28
|
"files": [
|
|
30
29
|
"dist"
|
|
31
30
|
],
|
|
32
31
|
"dependencies": {
|
|
33
32
|
"@xsai/shared": ""
|
|
34
33
|
},
|
|
35
|
-
"devDependencies": {
|
|
36
|
-
"@xsai/providers": ""
|
|
37
|
-
},
|
|
38
34
|
"scripts": {
|
|
39
|
-
"build": "
|
|
40
|
-
"build:watch": "pkgroll --watch",
|
|
35
|
+
"build": "tsup",
|
|
41
36
|
"test": "vitest run",
|
|
42
37
|
"test:watch": "vitest"
|
|
43
|
-
}
|
|
38
|
+
},
|
|
39
|
+
"main": "./dist/index.js",
|
|
40
|
+
"types": "./dist/index.d.ts"
|
|
44
41
|
}
|