@opentiny/genui-sdk-server 0.0.1-alpha.1 → 1.0.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.
package/dist/cli.js CHANGED
@@ -1,53 +1,53 @@
1
1
  #!/usr/bin/env node
2
- import l from "dotenv";
3
- import C from "node:path";
4
- import { Command as h } from "commander";
5
- import { s as w } from "./start-server-D22jR-7Y.js";
6
- function a(r, x) {
7
- r = r - 120;
8
- const e = y();
9
- let t = e[r];
10
- if (a.HAhcaU === void 0) {
11
- var s = function(o) {
12
- const m = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=";
2
+ import v from "dotenv";
3
+ import b from "node:path";
4
+ import { Command as B } from "commander";
5
+ import { s as C } from "./start-server-4eW5WScr.js";
6
+ const e = c;
7
+ (function(o, x) {
8
+ const n = c, t = o();
9
+ for (; ; )
10
+ try {
11
+ if (-parseInt(n(309)) / 1 + -parseInt(n(336)) / 2 * (parseInt(n(331)) / 3) + -parseInt(n(320)) / 4 * (parseInt(n(330)) / 5) + parseInt(n(306)) / 6 + parseInt(n(321)) / 7 + -parseInt(n(332)) / 8 + parseInt(n(334)) / 9 === x) break;
12
+ t.push(t.shift());
13
+ } catch {
14
+ t.push(t.shift());
15
+ }
16
+ })(y, 745865);
17
+ function c(o, x) {
18
+ o = o - 296;
19
+ const n = y();
20
+ let t = n[o];
21
+ if (c.JNIAud === void 0) {
22
+ var a = function(s) {
23
+ const l = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=";
13
24
  let f = "", u = "";
14
- for (let c = 0, p, i, I = 0; i = o.charAt(I++); ~i && (p = c % 4 ? p * 64 + i : i, c++ % 4) ? f += String.fromCharCode(255 & p >> (-2 * c & 6)) : 0)
15
- i = m.indexOf(i);
16
- for (let c = 0, p = f.length; c < p; c++)
17
- u += "%" + ("00" + f.charCodeAt(c).toString(16)).slice(-2);
25
+ for (let r = 0, p, i, U = 0; i = s.charAt(U++); ~i && (p = r % 4 ? p * 64 + i : i, r++ % 4) ? f += String.fromCharCode(255 & p >> (-2 * r & 6)) : 0)
26
+ i = l.indexOf(i);
27
+ for (let r = 0, p = f.length; r < p; r++)
28
+ u += "%" + ("00" + f.charCodeAt(r).toString(16)).slice(-2);
18
29
  return decodeURIComponent(u);
19
30
  };
20
- a.dVqwdv = s, a.dLjErh = {}, a.HAhcaU = !0;
31
+ c.Oycahb = a, c.gOjGNF = {}, c.JNIAud = !0;
21
32
  }
22
- const d = e[0], _ = r + d, v = a.dLjErh[_];
23
- return v ? t = v : (t = a.dVqwdv(t), a.dLjErh[_] = t), t;
33
+ const m = n[0], _ = o + m, d = c.gOjGNF[_];
34
+ return d ? t = d : (t = c.Oycahb(t), c.gOjGNF[_] = t), t;
24
35
  }
25
- const n = a;
26
36
  function y() {
27
- const r = ["nta2ntm1tfbMD1fK", "Bwf4qxr0zw1WDa", "yMfZzvvsta", "mJu4ndiXmLDZtgvurG", "vvjm", "u3rHCNqGysbJAa", "AwXLidXWyxrOpG", "Aw9UieHuvfaGCW", "B3b0Aw9U", "ntC0C0DyzK1v", "nJq0nNHfufPYta", "ieDLBLvj", "y29UzMLN", "ue9sva", "qKftrv9vuKW", "5PYn5yQH5zcV5yQO56UV5y+J77Yi6BUy6k6Kia", "5lIl55Qeic5LBNBVViK", "lMvUDG", "5Akd5y+y6yEpifbpuLtVViK", "z2vUDwKTC2rRlq", "mZLqqvjJAxi", "zw52", "CMvZB2X2zq", "C2vYDMvY", "546V5Akd5y+y6yEp5PYQ6ywn572U77YA6k+35zYO", "Cgf0Aa", "zxHPDa", "5P+L55Yl5zg95lUK5BIU5yQP5l+H5OgV", "mJy5ntK3oxfIzfPszG", "zgvZy3jPChrPBW", "ntrHzvLTt1e", "mty5nJeXzNjOC21J", "5B6e77Yi6BUy6k6K6k+75y+w5B2t5yMn55UU5B2v", "ic5LBNyG5OIw57o757UF546V", "mtj2uKnwr1O", "CgfYC2u", "mtbwExDiA0C", "mJCWnJrYAK9cEeO", "y3DK", "ywn0Aw9U", "zxjYB3i", "Cg9YDa", "nNjTqwfKva", "yxqGy29TCgXLDa", "mZeWmo+8JoAiLUIaHEs9V+EuQoEoRW", "otGZme5PCMPMvW"];
37
+ const o = ["phbVCNq+", "B3b0Aw9U", "lwGSic0TAgvSCa", "qvbjx0Tfwq", "zgvZy3jPChrPBW", "mJm5ntbfquzpq2m", "mtjxz1vUB3e", "mJC1mtiWmfHxBfnMtW", "6iEQ5A6A5lMj546V5Akd5y+y6yEp5PAh5lU26lEV", "mtmZmZyYmZzouxfWDKW", "yxjNDG", "mZa0mtq4yLLIwKjz", "C2vYDMvY", "ue9sva", "5PYn5yQH5zcV5yQO56UV5y+J77Yi6BUy6k6Kia", "zw52", "ieDLBLvj", "5P+L55Yl5zg95lUK5BIU5yQP5l+H5OgV", "Aw9UieHuvfaGCW", "Bwf4qxr0zw1WDa", "mZeWmo+8JoAiLUIaHEs9V+EuQoEoRW", "5Akd5lIT6k6+572Uiefqsv9l", "y29UzMLN", "y3DK", "zxjYB3i", "odyYndq2mg1HDKzpqq", "CMvZB2X2zq", "zxHPDa", "nZCXndi4CKTZwKHJ", "5Akd5y+y6yEpifbpuLtVViK", "AgvSCe9WDgLVBG", "Cgf0Aa", "ywn0Aw9U", "lwuSic0Tzw52rG", "zxj2AwnLigzVCG", "yxbPs2v5", "ic5LBNyG5OIw57o757UF546V", "5B6e77Yi6BUy6k6K6k+75y+w5B2t5yMn55UU5B2v", "lMvUDG", "nZyWAeHxv052", "mZiYmJyYnvrJvfnuza", "5lIl55Qeic5LBNBVViK", "CgfYC2u", "Cg9YDa"];
28
38
  return y = function() {
29
- return r;
39
+ return o;
30
40
  }, y();
31
41
  }
32
- (function(r, x) {
33
- const e = a, t = r();
34
- for (; ; )
35
- try {
36
- if (parseInt(e(140)) / 1 * (parseInt(e(120)) / 2) + parseInt(e(161)) / 3 * (parseInt(e(164)) / 4) + parseInt(e(130)) / 5 * (parseInt(e(126)) / 6) + parseInt(e(139)) / 7 * (parseInt(e(121)) / 8) + parseInt(e(160)) / 9 * (-parseInt(e(129)) / 10) + parseInt(e(158)) / 11 + parseInt(e(133)) / 12 * (-parseInt(e(150)) / 13) === x) break;
37
- t.push(t.shift());
38
- } catch {
39
- t.push(t.shift());
40
- }
41
- })(y, 173692);
42
- const b = new h();
43
- b.name(n(149) + n(153))[n(159) + "n"](n(135) + n(127) + n(137) + "ervice for" + n(141))[n(138)]("-e, --envF" + n(136), "自定义环境变量文件路" + n(162) + n(146))[n(138)]("-p --port <port>", n(145) + n(128) + n(148)).helpOption("-h, --help", n(157))[n(123)]((r) => {
44
- const x = n, { envFile: e, port: t } = r;
45
- if (e) {
46
- const m = C[x(152)](process.cwd(), e), f = {};
47
- f[x(155)] = m, l[x(142)](f);
48
- } else l[x(142)]({ path: C.resolve(process[x(122)](), x(147)) });
49
- const s = process.env[x(144)], d = process[x(151)].API_KEY;
50
- !s && (console[x(124)](x(154) + x(163) + "境中设置 BASE_" + x(134)), process[x(156)](1)), !d && (console[x(124)]("环境变量未配置:请在 .env 或系统环境中设置 API_KEY"), process[x(156)](1));
51
- const _ = process[x(151)][x(143)] ? Number(process[x(151)][x(143)]) : void 0, v = (t ? Number(t) : void 0) ?? _ ?? 3100, o = {};
52
- o[x(125)] = v, o[x(132)] = s, o.apiKey = d, o[x(131) + "s"] = 10, w(o);
53
- }), b[n(165)](process.argv);
42
+ const A = new B();
43
+ A.name("genui-sdk-" + e(337))[e(329) + "n"]("Start a chat complet" + e(299) + e(315) + e(297))[e(326)](e(314) + "ile <path>", e(333) + e(318) + e(322)).option("-p --port " + e(325), e(339) + e(301) + e(310))[e(311)](e(327), e(298))[e(313)]((o) => {
44
+ const x = e, { envFile: n, port: t } = o;
45
+ if (n) {
46
+ const l = b.resolve(process[x(304)](), n), f = {};
47
+ f[x(312)] = l, v[x(303)](f);
48
+ } else v[x(303)]({ path: b[x(307)](process[x(304)](), x(319)) });
49
+ const a = process[x(296)].BASE_URL, m = process[x(296)][x(328)];
50
+ !a && (console[x(305)]("环境变量未配置:请在 .env 或系统环境中设置 BASE_URL"), process[x(308)](1)), !m && (console[x(305)]("环境变量未配置:请在" + x(317) + x(302) + "EY"), process[x(308)](1));
51
+ const _ = process[x(296)][x(338)] ? Number(process.env[x(338)]) : void 0, d = (t ? Number(t) : void 0) ?? _ ?? 3100, s = {};
52
+ s[x(324)] = d, s.baseURL = a, s[x(316)] = m, s[x(300) + "s"] = 10, C(s);
53
+ }), A[e(323)](process[e(335)]);
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
- import { ChatCompletionCreateParamsBase } from '@opentiny/genui-sdk-chat-completions';
1
+ import { ChatCompletionCreateParamsBase } from 'openai/resources/chat/completions';
2
2
  import { Express as Express_2 } from 'express';
3
3
  import { IncomingMessage } from 'node:http';
4
- import { IRequestOptions } from '@opentiny/genui-sdk-chat-completions';
5
4
  import { ServerResponse } from 'node:http';
6
5
 
7
6
  export declare function createChatCompletionHandler(config: IChatCompletionHandlerConfig): {
@@ -28,6 +27,11 @@ export declare interface IEquipChatCompletionsOptions {
28
27
  baseURL: string;
29
28
  }
30
29
 
30
+ declare interface IRequestOptions {
31
+ signal?: AbortSignal | undefined | null;
32
+ [key: string]: unknown;
33
+ }
34
+
31
35
  export declare interface IStartServerOptions extends Omit<IEquipChatCompletionsOptions, 'route'> {
32
36
  port?: number;
33
37
  maxAttempts?: number;
package/dist/index.js CHANGED
@@ -1,39 +1,39 @@
1
- import { G as l, c as y, e as b, s as q } from "./start-server-D22jR-7Y.js";
2
- function t(n, v) {
3
- n = n - 155;
4
- var r = x(), e = r[n];
5
- if (t.RFmYbT === void 0) {
6
- var s = function(u) {
7
- for (var C = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=", o = "", I = "", f = 0, i, a, Z = 0; a = u.charAt(Z++); ~a && (i = f % 4 ? i * 64 + a : a, f++ % 4) ? o += String.fromCharCode(255 & i >> (-2 * f & 6)) : 0)
8
- a = C.indexOf(a);
9
- for (var m = 0, d = o.length; m < d; m++)
10
- I += "%" + ("00" + o.charCodeAt(m).toString(16)).slice(-2);
1
+ import { G as l, c as J, e as K, s as b } from "./start-server-4eW5WScr.js";
2
+ function e(n, m) {
3
+ n = n - 348;
4
+ var r = a(), t = r[n];
5
+ if (e.AnyRDg === void 0) {
6
+ var s = function(h) {
7
+ for (var C = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=", f = "", I = "", o = 0, i, x, w = 0; x = h.charAt(w++); ~x && (i = o % 4 ? i * 64 + x : x, o++ % 4) ? f += String.fromCharCode(255 & i >> (-2 * o & 6)) : 0)
8
+ x = C.indexOf(x);
9
+ for (var v = 0, y = f.length; v < y; v++)
10
+ I += "%" + ("00" + f.charCodeAt(v).toString(16)).slice(-2);
11
11
  return decodeURIComponent(I);
12
12
  };
13
- t.OfmcyW = s, t.HsOvEo = {}, t.RFmYbT = !0;
13
+ e.RPhGuK = s, e.QXkwIN = {}, e.AnyRDg = !0;
14
14
  }
15
- var c = r[0], p = n + c, h = t.HsOvEo[p];
16
- return h ? e = h : (e = t.OfmcyW(e), t.HsOvEo[p] = e), e;
15
+ var d = r[0], p = n + d, u = e.QXkwIN[p];
16
+ return u ? t = u : (t = e.RPhGuK(t), e.QXkwIN[p] = t), t;
17
17
  }
18
- function x() {
19
- var n = ["mtCXmZK1oefKANvhsW", "nxLeD1LzrG", "mZjOB1jfqKu", "nZi4nJmWswHhr1j2", "ndmZnePire9bzq", "mZC5ota4owjJwvLOrW", "m1vbthnwsq", "nteZnMvMyNzWyq", "mte4mtm0neHYwwT6va", "nJeYodq3ohnZDLPwrG", "mJbOtvzZB28", "mZi0nZyXy0jrDKPL"];
20
- return x = function() {
18
+ function a() {
19
+ var n = ["otGZmZiYmNjmsvHcsa", "oti3vvv3wLLg", "mJeXnJC1nJbsBfz6u3y", "odeWtfPvyM9J", "nwzQvwLcuq", "mZz1vw9vt2S", "mJm3nZy0mwjICKjgCG", "mtC1ndG1nK5KCNzRDa", "mZq3mZyXmKXMthbJEG", "mJq3mtyWneDksK9YtW"];
20
+ return a = function() {
21
21
  return n;
22
- }, x();
22
+ }, a();
23
23
  }
24
- (function(n, v) {
25
- for (var r = t, e = n(); ; )
24
+ (function(n, m) {
25
+ for (var r = e, t = n(); ; )
26
26
  try {
27
- var s = parseInt(r(155)) / 1 + -parseInt(r(156)) / 2 + -parseInt(r(162)) / 3 * (-parseInt(r(164)) / 4) + -parseInt(r(157)) / 5 * (-parseInt(r(165)) / 6) + -parseInt(r(159)) / 7 * (-parseInt(r(158)) / 8) + -parseInt(r(161)) / 9 * (parseInt(r(166)) / 10) + parseInt(r(160)) / 11 * (parseInt(r(163)) / 12);
28
- if (s === v) break;
29
- e.push(e.shift());
27
+ var s = parseInt(r(354)) / 1 * (-parseInt(r(356)) / 2) + parseInt(r(349)) / 3 + -parseInt(r(351)) / 4 + -parseInt(r(357)) / 5 * (parseInt(r(352)) / 6) + -parseInt(r(353)) / 7 + parseInt(r(350)) / 8 * (parseInt(r(348)) / 9) + parseInt(r(355)) / 10;
28
+ if (s === m) break;
29
+ t.push(t.shift());
30
30
  } catch {
31
- e.push(e.shift());
31
+ t.push(t.shift());
32
32
  }
33
- })(x, 525281);
33
+ })(a, 726213);
34
34
  export {
35
35
  l as GenUIChatAPIError,
36
- y as createChatCompletionHandler,
37
- b as equipChatCompletions,
38
- q as startServer
36
+ J as createChatCompletionHandler,
37
+ K as equipChatCompletions,
38
+ b as startServer
39
39
  };