@xsai/model 0.1.3 → 0.2.0-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.
Files changed (2) hide show
  1. package/dist/index.js +8 -12
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
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), {
1
+ import { requestURL, requestHeaders, responseJSON } from '@xsai/shared';
2
+
3
+ const 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,16 +8,12 @@ var listModels = async (options) => (options.fetch ?? globalThis.fetch)(requestU
8
8
  signal: options.abortSignal
9
9
  }).then(responseJSON).then(({ data }) => data);
10
10
 
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({
11
+ const retrieveModel = async (options) => (options.fetch ?? globalThis.fetch)(requestURL(`models/${options.model}`, options.baseURL), {
12
+ headers: requestHeaders({
15
13
  "Content-Type": "application/json",
16
14
  ...options.headers
17
15
  }, options.apiKey),
18
16
  signal: options.abortSignal
19
- }).then(responseJSON2);
20
- export {
21
- listModels,
22
- retrieveModel
23
- };
17
+ }).then(responseJSON);
18
+
19
+ export { listModels, retrieveModel };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xsai/model",
3
3
  "type": "module",
4
- "version": "0.1.3",
4
+ "version": "0.2.0-beta.2",
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",
@@ -32,7 +32,7 @@
32
32
  "@xsai/shared": ""
33
33
  },
34
34
  "scripts": {
35
- "build": "tsup",
35
+ "build": "pkgroll",
36
36
  "test": "vitest run",
37
37
  "test:watch": "vitest"
38
38
  },