@trymirai/uzu 0.2.10 → 0.3.0

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 (175) hide show
  1. package/README.md +52 -6
  2. package/bridging/classificationLabel.d.mts +12 -0
  3. package/bridging/classificationLabel.d.mts.map +1 -0
  4. package/bridging/classificationLabel.d.ts +12 -0
  5. package/bridging/classificationLabel.d.ts.map +1 -0
  6. package/bridging/classificationLabel.js +26 -0
  7. package/bridging/classificationLabel.js.map +1 -0
  8. package/bridging/classificationLabel.mjs +22 -0
  9. package/bridging/classificationLabel.mjs.map +1 -0
  10. package/bridging/classificationOutput.d.mts +10 -0
  11. package/bridging/classificationOutput.d.mts.map +1 -0
  12. package/bridging/classificationOutput.d.ts +10 -0
  13. package/bridging/classificationOutput.d.ts.map +1 -0
  14. package/bridging/classificationOutput.js +16 -0
  15. package/bridging/classificationOutput.js.map +1 -0
  16. package/bridging/classificationOutput.mjs +12 -0
  17. package/bridging/classificationOutput.mjs.map +1 -0
  18. package/bridging/classificationSession.d.mts +9 -0
  19. package/bridging/classificationSession.d.mts.map +1 -0
  20. package/bridging/classificationSession.d.ts +9 -0
  21. package/bridging/classificationSession.d.ts.map +1 -0
  22. package/bridging/classificationSession.js +16 -0
  23. package/bridging/classificationSession.js.map +1 -0
  24. package/bridging/classificationSession.mjs +12 -0
  25. package/bridging/classificationSession.mjs.map +1 -0
  26. package/bridging/classificationStats.d.mts +14 -0
  27. package/bridging/classificationStats.d.mts.map +1 -0
  28. package/bridging/classificationStats.d.ts +14 -0
  29. package/bridging/classificationStats.d.ts.map +1 -0
  30. package/bridging/classificationStats.js +20 -0
  31. package/bridging/classificationStats.js.map +1 -0
  32. package/bridging/classificationStats.mjs +16 -0
  33. package/bridging/classificationStats.mjs.map +1 -0
  34. package/bridging/engine.d.mts +14 -6
  35. package/bridging/engine.d.mts.map +1 -1
  36. package/bridging/engine.d.ts +14 -6
  37. package/bridging/engine.d.ts.map +1 -1
  38. package/bridging/engine.js +53 -23
  39. package/bridging/engine.js.map +1 -1
  40. package/bridging/engine.mjs +53 -23
  41. package/bridging/engine.mjs.map +1 -1
  42. package/bridging/model.d.mts +19 -0
  43. package/bridging/model.d.mts.map +1 -0
  44. package/bridging/model.d.ts +19 -0
  45. package/bridging/model.d.ts.map +1 -0
  46. package/bridging/model.js +39 -0
  47. package/bridging/model.js.map +1 -0
  48. package/bridging/model.mjs +35 -0
  49. package/bridging/model.mjs.map +1 -0
  50. package/bridging/modelKind.d.mts +8 -0
  51. package/bridging/modelKind.d.mts.map +1 -0
  52. package/bridging/modelKind.d.ts +8 -0
  53. package/bridging/modelKind.d.ts.map +1 -0
  54. package/bridging/modelKind.js +30 -0
  55. package/bridging/modelKind.js.map +1 -0
  56. package/bridging/modelKind.mjs +25 -0
  57. package/bridging/modelKind.mjs.map +1 -0
  58. package/bridging/modelType.d.mts +3 -2
  59. package/bridging/modelType.d.mts.map +1 -1
  60. package/bridging/modelType.d.ts +3 -2
  61. package/bridging/modelType.d.ts.map +1 -1
  62. package/bridging/modelType.js +11 -6
  63. package/bridging/modelType.js.map +1 -1
  64. package/bridging/modelType.mjs +11 -6
  65. package/bridging/modelType.mjs.map +1 -1
  66. package/bridging/preset.d.mts +2 -0
  67. package/bridging/preset.d.mts.map +1 -1
  68. package/bridging/preset.d.ts +2 -0
  69. package/bridging/preset.d.ts.map +1 -1
  70. package/bridging/preset.js +12 -0
  71. package/bridging/preset.js.map +1 -1
  72. package/bridging/preset.mjs +12 -0
  73. package/bridging/preset.mjs.map +1 -1
  74. package/bridging/samplingMethod.d.mts +2 -1
  75. package/bridging/samplingMethod.d.mts.map +1 -1
  76. package/bridging/samplingMethod.d.ts +2 -1
  77. package/bridging/samplingMethod.d.ts.map +1 -1
  78. package/bridging/samplingMethod.js +3 -1
  79. package/bridging/samplingMethod.js.map +1 -1
  80. package/bridging/samplingMethod.mjs +3 -1
  81. package/bridging/samplingMethod.mjs.map +1 -1
  82. package/bridging/samplingProcessingOrder.d.mts +8 -0
  83. package/bridging/samplingProcessingOrder.d.mts.map +1 -0
  84. package/bridging/samplingProcessingOrder.d.ts +8 -0
  85. package/bridging/samplingProcessingOrder.d.ts.map +1 -0
  86. package/bridging/samplingProcessingOrder.js +30 -0
  87. package/bridging/samplingProcessingOrder.js.map +1 -0
  88. package/bridging/samplingProcessingOrder.mjs +25 -0
  89. package/bridging/samplingProcessingOrder.mjs.map +1 -0
  90. package/bridging/textToSpeechSession.d.mts +8 -0
  91. package/bridging/textToSpeechSession.d.mts.map +1 -0
  92. package/bridging/textToSpeechSession.d.ts +8 -0
  93. package/bridging/textToSpeechSession.d.ts.map +1 -0
  94. package/bridging/textToSpeechSession.js +14 -0
  95. package/bridging/textToSpeechSession.js.map +1 -0
  96. package/bridging/textToSpeechSession.mjs +10 -0
  97. package/bridging/textToSpeechSession.mjs.map +1 -0
  98. package/error.d.mts +2 -0
  99. package/error.d.mts.map +1 -1
  100. package/error.d.ts +2 -0
  101. package/error.d.ts.map +1 -1
  102. package/error.js +4 -0
  103. package/error.js.map +1 -1
  104. package/error.mjs +4 -0
  105. package/error.mjs.map +1 -1
  106. package/index.d.mts +8 -1
  107. package/index.d.mts.map +1 -1
  108. package/index.d.ts +8 -1
  109. package/index.d.ts.map +1 -1
  110. package/index.js +17 -3
  111. package/index.js.map +1 -1
  112. package/index.mjs +8 -1
  113. package/index.mjs.map +1 -1
  114. package/interactors/chatModelInteractor.d.mts +5 -5
  115. package/interactors/chatModelInteractor.d.mts.map +1 -1
  116. package/interactors/chatModelInteractor.d.ts +5 -5
  117. package/interactors/chatModelInteractor.d.ts.map +1 -1
  118. package/interactors/chatModelInteractor.js +2 -2
  119. package/interactors/chatModelInteractor.js.map +1 -1
  120. package/interactors/chatModelInteractor.mjs +2 -2
  121. package/interactors/chatModelInteractor.mjs.map +1 -1
  122. package/interactors/chatModelsInteractor.d.mts +5 -5
  123. package/interactors/chatModelsInteractor.d.mts.map +1 -1
  124. package/interactors/chatModelsInteractor.d.ts +5 -5
  125. package/interactors/chatModelsInteractor.d.ts.map +1 -1
  126. package/interactors/chatModelsInteractor.js.map +1 -1
  127. package/interactors/chatModelsInteractor.mjs.map +1 -1
  128. package/interactors/engineInteractor.d.mts +4 -4
  129. package/interactors/engineInteractor.d.ts +4 -4
  130. package/interactors/engineInteractor.js +5 -5
  131. package/interactors/engineInteractor.mjs +5 -5
  132. package/napi/uzu.d.ts +69 -15
  133. package/napi/uzu.js +16 -2
  134. package/napi/uzu.mjs +8 -1
  135. package/napi/uzu.node +0 -0
  136. package/package.json +1 -1
  137. package/src/bridging/classificationLabel.ts +43 -0
  138. package/src/bridging/classificationOutput.ts +22 -0
  139. package/src/bridging/classificationSession.ts +17 -0
  140. package/src/bridging/classificationStats.ts +45 -0
  141. package/src/bridging/engine.ts +62 -26
  142. package/src/bridging/model.ts +68 -0
  143. package/src/bridging/modelKind.ts +27 -0
  144. package/src/bridging/modelType.ts +11 -6
  145. package/src/bridging/preset.ts +14 -0
  146. package/src/bridging/samplingMethod.ts +6 -0
  147. package/src/bridging/samplingProcessingOrder.ts +31 -0
  148. package/src/bridging/textToSpeechSession.ts +15 -0
  149. package/src/error.ts +4 -0
  150. package/src/index.ts +8 -1
  151. package/src/interactors/chatModelInteractor.ts +7 -7
  152. package/src/interactors/chatModelsInteractor.ts +5 -5
  153. package/src/interactors/engineInteractor.ts +7 -7
  154. package/src/napi/uzu.d.ts +69 -15
  155. package/src/napi/uzu.js +16 -2
  156. package/src/napi/uzu.mjs +8 -1
  157. package/src/napi/uzu.node +0 -0
  158. package/src/version.ts +1 -1
  159. package/version.d.mts +1 -1
  160. package/version.d.mts.map +1 -1
  161. package/version.d.ts +1 -1
  162. package/version.d.ts.map +1 -1
  163. package/version.js +1 -1
  164. package/version.js.map +1 -1
  165. package/version.mjs +1 -1
  166. package/version.mjs.map +1 -1
  167. package/bridging/chatModel.d.mts +0 -15
  168. package/bridging/chatModel.d.mts.map +0 -1
  169. package/bridging/chatModel.d.ts +0 -15
  170. package/bridging/chatModel.d.ts.map +0 -1
  171. package/bridging/chatModel.js +0 -33
  172. package/bridging/chatModel.js.map +0 -1
  173. package/bridging/chatModel.mjs +0 -29
  174. package/bridging/chatModel.mjs.map +0 -1
  175. package/src/bridging/chatModel.ts +0 -54
package/src/napi/uzu.js CHANGED
@@ -22,23 +22,30 @@ try {
22
22
  // Re-export all runtime exports
23
23
  const {
24
24
  ChatSession,
25
+ ClassificationSession,
25
26
  Engine,
26
27
  ModelDownloadHandle,
27
28
  ProgressStream,
28
29
  ProgressUpdate,
30
+ TextToSpeechSession,
29
31
  DataType,
30
32
  FinishReason,
31
33
  ModelDownloadPhase,
34
+ ModelKind,
32
35
  ModelType,
33
36
  Role,
37
+ SamplingProcessingOrder,
34
38
  version,
35
39
  BenchmarksDevice,
36
40
  BenchmarksResult,
37
41
  BenchmarksTask,
38
- ChatModel,
39
42
  ClassificationFeature,
43
+ ClassificationLabel,
44
+ ClassificationOutput,
45
+ ClassificationStats,
40
46
  Config,
41
47
  Message,
48
+ Model,
42
49
  ModelDownloadState,
43
50
  Output,
44
51
  ParsedText,
@@ -65,23 +72,30 @@ const {
65
72
 
66
73
  module.exports = {
67
74
  ChatSession,
75
+ ClassificationSession,
68
76
  Engine,
69
77
  ModelDownloadHandle,
70
78
  ProgressStream,
71
79
  ProgressUpdate,
80
+ TextToSpeechSession,
72
81
  DataType,
73
82
  FinishReason,
74
83
  ModelDownloadPhase,
84
+ ModelKind,
75
85
  ModelType,
76
86
  Role,
87
+ SamplingProcessingOrder,
77
88
  version,
78
89
  BenchmarksDevice,
79
90
  BenchmarksResult,
80
91
  BenchmarksTask,
81
- ChatModel,
82
92
  ClassificationFeature,
93
+ ClassificationLabel,
94
+ ClassificationOutput,
95
+ ClassificationStats,
83
96
  Config,
84
97
  Message,
98
+ Model,
85
99
  ModelDownloadState,
86
100
  Output,
87
101
  ParsedText,
package/src/napi/uzu.mjs CHANGED
@@ -22,23 +22,30 @@ try {
22
22
  // Re-export all runtime exports as named exports
23
23
  export const {
24
24
  ChatSession,
25
+ ClassificationSession,
25
26
  Engine,
26
27
  ModelDownloadHandle,
27
28
  ProgressStream,
28
29
  ProgressUpdate,
30
+ TextToSpeechSession,
29
31
  DataType,
30
32
  FinishReason,
31
33
  ModelDownloadPhase,
34
+ ModelKind,
32
35
  ModelType,
33
36
  Role,
37
+ SamplingProcessingOrder,
34
38
  version,
35
39
  BenchmarksDevice,
36
40
  BenchmarksResult,
37
41
  BenchmarksTask,
38
- ChatModel,
39
42
  ClassificationFeature,
43
+ ClassificationLabel,
44
+ ClassificationOutput,
45
+ ClassificationStats,
40
46
  Config,
41
47
  Message,
48
+ Model,
42
49
  ModelDownloadState,
43
50
  Output,
44
51
  ParsedText,
package/src/napi/uzu.node CHANGED
Binary file
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.2.10';
1
+ export const VERSION = '0.3.0';
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.2.10";
1
+ export declare const VERSION = "0.3.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.mts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
1
+ {"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.2.10";
1
+ export declare const VERSION = "0.3.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.2.10';
4
+ exports.VERSION = '0.3.0';
5
5
  //# sourceMappingURL=version.js.map
package/version.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,QAAQ,CAAC"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC"}
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.2.10';
1
+ export const VERSION = '0.3.0';
2
2
  //# sourceMappingURL=version.mjs.map
package/version.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC"}
1
+ {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC"}
@@ -1,15 +0,0 @@
1
- import { ChatModel as NapiChatModel } from "../napi/uzu.mjs";
2
- import { ModelType } from "./modelType.mjs";
3
- export declare class ChatModel {
4
- readonly repoId: string;
5
- readonly type: ModelType;
6
- readonly name: string;
7
- readonly vendor: string;
8
- readonly quantization: string | null;
9
- readonly outputParserRegex: string | null;
10
- get isThinking(): boolean;
11
- private constructor();
12
- static fromNapiChatModel(napiChatModel: NapiChatModel): ChatModel;
13
- toNapi(): NapiChatModel;
14
- }
15
- //# sourceMappingURL=chatModel.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chatModel.d.mts","sourceRoot":"","sources":["../src/bridging/chatModel.ts"],"names":[],"mappings":"OAAO,EAAE,SAAS,IAAI,aAAa,EAAE;OAC9B,EAAE,SAAS,EAAwD;AAE1E,qBAAa,SAAS;IAClB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1C,IAAI,UAAU,IAAI,OAAO,CAExB;IAED,OAAO;IAgBP,MAAM,CAAC,iBAAiB,CAAC,aAAa,EAAE,aAAa,GAAG,SAAS;IAWjE,MAAM,IAAI,aAAa;CAW1B"}
@@ -1,15 +0,0 @@
1
- import { ChatModel as NapiChatModel } from "../napi/uzu.js";
2
- import { ModelType } from "./modelType.js";
3
- export declare class ChatModel {
4
- readonly repoId: string;
5
- readonly type: ModelType;
6
- readonly name: string;
7
- readonly vendor: string;
8
- readonly quantization: string | null;
9
- readonly outputParserRegex: string | null;
10
- get isThinking(): boolean;
11
- private constructor();
12
- static fromNapiChatModel(napiChatModel: NapiChatModel): ChatModel;
13
- toNapi(): NapiChatModel;
14
- }
15
- //# sourceMappingURL=chatModel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chatModel.d.ts","sourceRoot":"","sources":["../src/bridging/chatModel.ts"],"names":[],"mappings":"OAAO,EAAE,SAAS,IAAI,aAAa,EAAE;OAC9B,EAAE,SAAS,EAAwD;AAE1E,qBAAa,SAAS;IAClB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1C,IAAI,UAAU,IAAI,OAAO,CAExB;IAED,OAAO;IAgBP,MAAM,CAAC,iBAAiB,CAAC,aAAa,EAAE,aAAa,GAAG,SAAS;IAWjE,MAAM,IAAI,aAAa;CAW1B"}
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ChatModel = void 0;
4
- const modelType_1 = require("./modelType.js");
5
- class ChatModel {
6
- get isThinking() {
7
- return this.outputParserRegex !== null;
8
- }
9
- constructor(repoId, type, name, vendor, quantization, outputParserRegex) {
10
- this.repoId = repoId;
11
- this.type = type;
12
- this.name = name;
13
- this.vendor = vendor;
14
- this.quantization = quantization;
15
- this.outputParserRegex = outputParserRegex;
16
- }
17
- static fromNapiChatModel(napiChatModel) {
18
- return new ChatModel(napiChatModel.repoId, (0, modelType_1.modelTypeFromNapiModelType)(napiChatModel.type), napiChatModel.name, napiChatModel.vendor, napiChatModel.quantization ?? null, napiChatModel.outputParserRegex ?? null);
19
- }
20
- toNapi() {
21
- const napiChatModel = {
22
- repoId: this.repoId,
23
- type: (0, modelType_1.modelTypeToNapiModelType)(this.type),
24
- name: this.name,
25
- vendor: this.vendor,
26
- ...(this.quantization !== null && { quantization: this.quantization }),
27
- ...(this.outputParserRegex !== null && { outputParserRegex: this.outputParserRegex }),
28
- };
29
- return napiChatModel;
30
- }
31
- }
32
- exports.ChatModel = ChatModel;
33
- //# sourceMappingURL=chatModel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chatModel.js","sourceRoot":"","sources":["../src/bridging/chatModel.ts"],"names":[],"mappings":";;;AACA,8CAA8F;AAE9F,MAAa,SAAS;IAQlB,IAAI,UAAU;QACV,OAAO,IAAI,CAAC,iBAAiB,KAAK,IAAI,CAAC;IAC3C,CAAC;IAED,YACI,MAAc,EACd,IAAe,EACf,IAAY,EACZ,MAAc,EACd,YAA2B,EAC3B,iBAAgC;QAEhC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC/C,CAAC;IAED,MAAM,CAAC,iBAAiB,CAAC,aAA4B;QACjD,OAAO,IAAI,SAAS,CAChB,aAAa,CAAC,MAAM,EACpB,IAAA,sCAA0B,EAAC,aAAa,CAAC,IAAI,CAAC,EAC9C,aAAa,CAAC,IAAI,EAClB,aAAa,CAAC,MAAM,EACpB,aAAa,CAAC,YAAY,IAAI,IAAI,EAClC,aAAa,CAAC,iBAAiB,IAAI,IAAI,CAC1C,CAAC;IACN,CAAC;IAED,MAAM;QACF,MAAM,aAAa,GAAkB;YACjC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAA,oCAAwB,EAAC,IAAI,CAAC,IAAI,CAAC;YACzC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,GAAG,CAAC,IAAI,CAAC,YAAY,KAAK,IAAI,IAAI,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC;YACtE,GAAG,CAAC,IAAI,CAAC,iBAAiB,KAAK,IAAI,IAAI,EAAE,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EAAE,CAAC;SACxF,CAAC;QACF,OAAO,aAAa,CAAC;IACzB,CAAC;CACJ;AAlDD,8BAkDC"}
@@ -1,29 +0,0 @@
1
- import { modelTypeFromNapiModelType, modelTypeToNapiModelType } from "./modelType.mjs";
2
- export class ChatModel {
3
- get isThinking() {
4
- return this.outputParserRegex !== null;
5
- }
6
- constructor(repoId, type, name, vendor, quantization, outputParserRegex) {
7
- this.repoId = repoId;
8
- this.type = type;
9
- this.name = name;
10
- this.vendor = vendor;
11
- this.quantization = quantization;
12
- this.outputParserRegex = outputParserRegex;
13
- }
14
- static fromNapiChatModel(napiChatModel) {
15
- return new ChatModel(napiChatModel.repoId, modelTypeFromNapiModelType(napiChatModel.type), napiChatModel.name, napiChatModel.vendor, napiChatModel.quantization ?? null, napiChatModel.outputParserRegex ?? null);
16
- }
17
- toNapi() {
18
- const napiChatModel = {
19
- repoId: this.repoId,
20
- type: modelTypeToNapiModelType(this.type),
21
- name: this.name,
22
- vendor: this.vendor,
23
- ...(this.quantization !== null && { quantization: this.quantization }),
24
- ...(this.outputParserRegex !== null && { outputParserRegex: this.outputParserRegex }),
25
- };
26
- return napiChatModel;
27
- }
28
- }
29
- //# sourceMappingURL=chatModel.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chatModel.mjs","sourceRoot":"","sources":["../src/bridging/chatModel.ts"],"names":[],"mappings":"OACO,EAAa,0BAA0B,EAAE,wBAAwB,EAAE;AAE1E,MAAM,OAAO,SAAS;IAQlB,IAAI,UAAU;QACV,OAAO,IAAI,CAAC,iBAAiB,KAAK,IAAI,CAAC;IAC3C,CAAC;IAED,YACI,MAAc,EACd,IAAe,EACf,IAAY,EACZ,MAAc,EACd,YAA2B,EAC3B,iBAAgC;QAEhC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC/C,CAAC;IAED,MAAM,CAAC,iBAAiB,CAAC,aAA4B;QACjD,OAAO,IAAI,SAAS,CAChB,aAAa,CAAC,MAAM,EACpB,0BAA0B,CAAC,aAAa,CAAC,IAAI,CAAC,EAC9C,aAAa,CAAC,IAAI,EAClB,aAAa,CAAC,MAAM,EACpB,aAAa,CAAC,YAAY,IAAI,IAAI,EAClC,aAAa,CAAC,iBAAiB,IAAI,IAAI,CAC1C,CAAC;IACN,CAAC;IAED,MAAM;QACF,MAAM,aAAa,GAAkB;YACjC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC;YACzC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,GAAG,CAAC,IAAI,CAAC,YAAY,KAAK,IAAI,IAAI,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC;YACtE,GAAG,CAAC,IAAI,CAAC,iBAAiB,KAAK,IAAI,IAAI,EAAE,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EAAE,CAAC;SACxF,CAAC;QACF,OAAO,aAAa,CAAC;IACzB,CAAC;CACJ"}
@@ -1,54 +0,0 @@
1
- import { ChatModel as NapiChatModel } from '../napi/uzu';
2
- import { ModelType, modelTypeFromNapiModelType, modelTypeToNapiModelType } from './modelType';
3
-
4
- export class ChatModel {
5
- readonly repoId: string;
6
- readonly type: ModelType;
7
- readonly name: string;
8
- readonly vendor: string;
9
- readonly quantization: string | null;
10
- readonly outputParserRegex: string | null;
11
-
12
- get isThinking(): boolean {
13
- return this.outputParserRegex !== null;
14
- }
15
-
16
- private constructor(
17
- repoId: string,
18
- type: ModelType,
19
- name: string,
20
- vendor: string,
21
- quantization: string | null,
22
- outputParserRegex: string | null,
23
- ) {
24
- this.repoId = repoId;
25
- this.type = type;
26
- this.name = name;
27
- this.vendor = vendor;
28
- this.quantization = quantization;
29
- this.outputParserRegex = outputParserRegex;
30
- }
31
-
32
- static fromNapiChatModel(napiChatModel: NapiChatModel): ChatModel {
33
- return new ChatModel(
34
- napiChatModel.repoId,
35
- modelTypeFromNapiModelType(napiChatModel.type),
36
- napiChatModel.name,
37
- napiChatModel.vendor,
38
- napiChatModel.quantization ?? null,
39
- napiChatModel.outputParserRegex ?? null,
40
- );
41
- }
42
-
43
- toNapi(): NapiChatModel {
44
- const napiChatModel: NapiChatModel = {
45
- repoId: this.repoId,
46
- type: modelTypeToNapiModelType(this.type),
47
- name: this.name,
48
- vendor: this.vendor,
49
- ...(this.quantization !== null && { quantization: this.quantization }),
50
- ...(this.outputParserRegex !== null && { outputParserRegex: this.outputParserRegex }),
51
- };
52
- return napiChatModel;
53
- }
54
- }