@trymirai/uzu 0.1.39 → 0.1.40
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/README.md +5 -5
- package/bridging/chatModel.d.mts +15 -0
- package/bridging/chatModel.d.mts.map +1 -0
- package/bridging/chatModel.d.ts +15 -0
- package/bridging/chatModel.d.ts.map +1 -0
- package/bridging/chatModel.js +33 -0
- package/bridging/chatModel.js.map +1 -0
- package/bridging/chatModel.mjs +29 -0
- package/bridging/chatModel.mjs.map +1 -0
- package/bridging/chatSession.d.mts +10 -0
- package/bridging/chatSession.d.mts.map +1 -0
- package/bridging/chatSession.d.ts +10 -0
- package/bridging/chatSession.d.ts.map +1 -0
- package/bridging/{session.js → chatSession.js} +7 -7
- package/bridging/chatSession.js.map +1 -0
- package/bridging/{session.mjs → chatSession.mjs} +5 -5
- package/bridging/chatSession.mjs.map +1 -0
- package/bridging/engine.d.mts +10 -10
- package/bridging/engine.d.mts.map +1 -1
- package/bridging/engine.d.ts +10 -10
- package/bridging/engine.d.ts.map +1 -1
- package/bridging/engine.js +42 -44
- package/bridging/engine.js.map +1 -1
- package/bridging/engine.mjs +43 -45
- package/bridging/engine.mjs.map +1 -1
- package/bridging/modelType.d.mts +2 -1
- package/bridging/modelType.d.mts.map +1 -1
- package/bridging/modelType.d.ts +2 -1
- package/bridging/modelType.d.ts.map +1 -1
- package/bridging/modelType.js +14 -2
- package/bridging/modelType.js.map +1 -1
- package/bridging/modelType.mjs +12 -1
- package/bridging/modelType.mjs.map +1 -1
- package/error.d.mts +1 -1
- package/error.d.mts.map +1 -1
- package/error.d.ts +1 -1
- package/error.d.ts.map +1 -1
- package/error.js +2 -2
- package/error.js.map +1 -1
- package/error.mjs +2 -2
- package/error.mjs.map +1 -1
- package/index.d.mts +5 -5
- package/index.d.mts.map +1 -1
- package/index.d.ts +5 -5
- package/index.d.ts.map +1 -1
- package/index.js +11 -12
- package/index.js.map +1 -1
- package/index.mjs +5 -5
- package/index.mjs.map +1 -1
- package/interactors/{modelInteractor.d.mts → chatModelInteractor.d.mts} +15 -15
- package/interactors/chatModelInteractor.d.mts.map +1 -0
- package/interactors/{modelInteractor.d.ts → chatModelInteractor.d.ts} +15 -15
- package/interactors/chatModelInteractor.d.ts.map +1 -0
- package/interactors/{modelInteractor.js → chatModelInteractor.js} +13 -13
- package/interactors/chatModelInteractor.js.map +1 -0
- package/interactors/{modelInteractor.mjs → chatModelInteractor.mjs} +11 -11
- package/interactors/chatModelInteractor.mjs.map +1 -0
- package/interactors/chatModelsInteractor.d.mts +12 -0
- package/interactors/chatModelsInteractor.d.mts.map +1 -0
- package/interactors/chatModelsInteractor.d.ts +12 -0
- package/interactors/chatModelsInteractor.d.ts.map +1 -0
- package/interactors/{modelsInteractor.js → chatModelsInteractor.js} +6 -6
- package/interactors/chatModelsInteractor.js.map +1 -0
- package/interactors/{modelsInteractor.mjs → chatModelsInteractor.mjs} +4 -4
- package/interactors/chatModelsInteractor.mjs.map +1 -0
- package/interactors/chatSessionInteractor.d.mts +24 -0
- package/interactors/chatSessionInteractor.d.mts.map +1 -0
- package/interactors/chatSessionInteractor.d.ts +24 -0
- package/interactors/chatSessionInteractor.d.ts.map +1 -0
- package/interactors/{sessionInteractor.js → chatSessionInteractor.js} +8 -8
- package/interactors/chatSessionInteractor.js.map +1 -0
- package/interactors/{sessionInteractor.mjs → chatSessionInteractor.mjs} +6 -6
- package/interactors/chatSessionInteractor.mjs.map +1 -0
- package/interactors/downloadInteractor.d.mts +3 -3
- package/interactors/downloadInteractor.d.mts.map +1 -1
- package/interactors/downloadInteractor.d.ts +3 -3
- package/interactors/downloadInteractor.d.ts.map +1 -1
- package/interactors/downloadInteractor.js.map +1 -1
- package/interactors/downloadInteractor.mjs.map +1 -1
- package/interactors/engineInteractor.d.mts +5 -8
- package/interactors/engineInteractor.d.mts.map +1 -1
- package/interactors/engineInteractor.d.ts +5 -8
- package/interactors/engineInteractor.d.ts.map +1 -1
- package/interactors/engineInteractor.js +8 -12
- package/interactors/engineInteractor.js.map +1 -1
- package/interactors/engineInteractor.mjs +8 -12
- package/interactors/engineInteractor.mjs.map +1 -1
- package/napi/uzu.d.ts +18 -32
- package/napi/uzu.js +4 -6
- package/napi/uzu.mjs +2 -3
- package/napi/uzu.node +0 -0
- package/package.json +1 -1
- package/src/bridging/chatModel.ts +54 -0
- package/src/bridging/{session.ts → chatSession.ts} +6 -6
- package/src/bridging/engine.ts +47 -47
- package/src/bridging/modelType.ts +13 -1
- package/src/error.ts +2 -2
- package/src/index.ts +5 -5
- package/src/interactors/{modelInteractor.ts → chatModelInteractor.ts} +22 -22
- package/src/interactors/{modelsInteractor.ts → chatModelsInteractor.ts} +8 -8
- package/src/interactors/{sessionInteractor.ts → chatSessionInteractor.ts} +19 -15
- package/src/interactors/downloadInteractor.ts +3 -3
- package/src/interactors/engineInteractor.ts +9 -20
- package/src/napi/uzu.d.ts +18 -32
- package/src/napi/uzu.js +4 -6
- package/src/napi/uzu.mjs +2 -3
- package/src/napi/uzu.node +0 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/bridging/model.d.mts +0 -18
- package/bridging/model.d.mts.map +0 -1
- package/bridging/model.d.ts +0 -18
- package/bridging/model.d.ts.map +0 -1
- package/bridging/model.js +0 -27
- package/bridging/model.js.map +0 -1
- package/bridging/model.mjs +0 -23
- package/bridging/model.mjs.map +0 -1
- package/bridging/session.d.mts +0 -10
- package/bridging/session.d.mts.map +0 -1
- package/bridging/session.d.ts +0 -10
- package/bridging/session.d.ts.map +0 -1
- package/bridging/session.js.map +0 -1
- package/bridging/session.mjs.map +0 -1
- package/interactors/modelInteractor.d.mts.map +0 -1
- package/interactors/modelInteractor.d.ts.map +0 -1
- package/interactors/modelInteractor.js.map +0 -1
- package/interactors/modelInteractor.mjs.map +0 -1
- package/interactors/modelsInteractor.d.mts +0 -12
- package/interactors/modelsInteractor.d.mts.map +0 -1
- package/interactors/modelsInteractor.d.ts +0 -12
- package/interactors/modelsInteractor.d.ts.map +0 -1
- package/interactors/modelsInteractor.js.map +0 -1
- package/interactors/modelsInteractor.mjs.map +0 -1
- package/interactors/sessionInteractor.d.mts +0 -24
- package/interactors/sessionInteractor.d.mts.map +0 -1
- package/interactors/sessionInteractor.d.ts +0 -24
- package/interactors/sessionInteractor.d.ts.map +0 -1
- package/interactors/sessionInteractor.js.map +0 -1
- package/interactors/sessionInteractor.mjs.map +0 -1
- package/src/bridging/model.ts +0 -58
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DownloadPhase } from "../bridging/downloadState.mjs";
|
|
2
2
|
import { ModelType } from "../bridging/modelType.mjs";
|
|
3
3
|
import { RunConfig } from "../bridging/runConfig.mjs";
|
|
4
|
+
import { ChatSessionInteractor } from "./chatSessionInteractor.mjs";
|
|
4
5
|
import { DownloadInteractor } from "./downloadInteractor.mjs";
|
|
5
|
-
|
|
6
|
-
export class ModelInteractor {
|
|
6
|
+
export class ChatModelInteractor {
|
|
7
7
|
constructor(modelsInteractor, model, config) {
|
|
8
8
|
this.modelsInteractor = modelsInteractor;
|
|
9
9
|
this.entity = model;
|
|
@@ -17,7 +17,7 @@ export class ModelInteractor {
|
|
|
17
17
|
const handlePromise = (async () => {
|
|
18
18
|
const model = await this.finalize();
|
|
19
19
|
const engine = await this.modelsInteractor.engineInteractor.finalize();
|
|
20
|
-
const handle = engine.downloadHandle(model);
|
|
20
|
+
const handle = engine.downloadHandle(model.repoId);
|
|
21
21
|
return handle;
|
|
22
22
|
})();
|
|
23
23
|
return new DownloadInteractor(this, handlePromise);
|
|
@@ -39,24 +39,24 @@ export class ModelInteractor {
|
|
|
39
39
|
}
|
|
40
40
|
return this.finalize();
|
|
41
41
|
})();
|
|
42
|
-
return new
|
|
42
|
+
return new ChatModelInteractor(this.modelsInteractor, modelPromise, this.config);
|
|
43
43
|
}
|
|
44
44
|
/* Config */
|
|
45
45
|
preset(preset) {
|
|
46
46
|
const config = this.config.withPreset(preset);
|
|
47
|
-
return new
|
|
47
|
+
return new ChatModelInteractor(this.modelsInteractor, this.entity, config);
|
|
48
48
|
}
|
|
49
49
|
prefillStepSize(prefillStepSize) {
|
|
50
50
|
const config = this.config.withPrefillStepSize(prefillStepSize);
|
|
51
|
-
return new
|
|
51
|
+
return new ChatModelInteractor(this.modelsInteractor, this.entity, config);
|
|
52
52
|
}
|
|
53
53
|
contextLength(contextLength) {
|
|
54
54
|
const config = this.config.withContextLength(contextLength);
|
|
55
|
-
return new
|
|
55
|
+
return new ChatModelInteractor(this.modelsInteractor, this.entity, config);
|
|
56
56
|
}
|
|
57
57
|
samplingSeed(samplingSeed) {
|
|
58
58
|
const config = this.config.withSamplingSeed(samplingSeed);
|
|
59
|
-
return new
|
|
59
|
+
return new ChatModelInteractor(this.modelsInteractor, this.entity, config);
|
|
60
60
|
}
|
|
61
61
|
/* Session */
|
|
62
62
|
session() {
|
|
@@ -66,10 +66,10 @@ export class ModelInteractor {
|
|
|
66
66
|
if (model.type === ModelType.Local) {
|
|
67
67
|
model = await this.download().finalize();
|
|
68
68
|
}
|
|
69
|
-
const session = engine.
|
|
69
|
+
const session = engine.chatSession(model, this.config);
|
|
70
70
|
return session;
|
|
71
71
|
})();
|
|
72
|
-
return new
|
|
72
|
+
return new ChatSessionInteractor(this, sessionPromise, RunConfig.default());
|
|
73
73
|
}
|
|
74
74
|
async reply(text, progress = () => true) {
|
|
75
75
|
return await this.session().reply(text, progress);
|
|
@@ -78,4 +78,4 @@ export class ModelInteractor {
|
|
|
78
78
|
return await this.session().replyToMessages(messages, progress);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
//# sourceMappingURL=
|
|
81
|
+
//# sourceMappingURL=chatModelInteractor.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatModelInteractor.mjs","sourceRoot":"","sources":["../src/interactors/chatModelInteractor.ts"],"names":[],"mappings":"OAIO,EAAE,aAAa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AAc,GAAG,CAAC,KAAK,IAAI,EAAE;YAC/B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC;YAEvE,IAAI,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClC,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,KAAK,EAAE,CAAC;gBACjC,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC;YAC7C,CAAC;YAED,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YACvD,OAAO,OAAO,CAAC;QACnB,CAAC,CAAC,EAAE,CAAC;QACL,OAAO,IAAI,qBAAqB,CAAC,IAAI,EAAE,cAAc,EAAE,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,IAAY,EAAE,WAA+C,GAAG,EAAE,CAAC,IAAI;QAC/E,OAAO,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,eAAe,CACjB,QAAmB,EACnB,WAA+C,GAAG,EAAE,CAAC,IAAI;QAEzD,OAAO,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACpE,CAAC;CACJ"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ChatModel } from "../bridging/chatModel.mjs";
|
|
2
|
+
import { ChatModelInteractor } from "./chatModelInteractor.mjs";
|
|
3
|
+
import { EngineInteractor } from "./engineInteractor.mjs";
|
|
4
|
+
import { Interactor, InteractorEntity } from "./interactor.mjs";
|
|
5
|
+
export declare class ChatModelsInteractor implements Interactor<ChatModel[]> {
|
|
6
|
+
readonly engineInteractor: EngineInteractor;
|
|
7
|
+
readonly entity: InteractorEntity<ChatModel[]>;
|
|
8
|
+
constructor(engineInteractor: EngineInteractor, models: InteractorEntity<ChatModel[]>);
|
|
9
|
+
finalize(): Promise<ChatModel[]>;
|
|
10
|
+
get(repoId: string): ChatModelInteractor;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=chatModelsInteractor.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatModelsInteractor.d.mts","sourceRoot":"","sources":["../src/interactors/chatModelsInteractor.ts"],"names":[],"mappings":"OAAO,EAAE,SAAS,EAAE;OAGb,EAAE,mBAAmB,EAAE;OACvB,EAAE,gBAAgB,EAAE;OACpB,EAAE,UAAU,EAAE,gBAAgB,EAAE;AAEvC,qBAAa,oBAAqB,YAAW,UAAU,CAAC,SAAS,EAAE,CAAC;IAChE,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAC;gBAEnC,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,gBAAgB,CAAC,SAAS,EAAE,CAAC;IAK/E,QAAQ,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;IAItC,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,mBAAmB;CAQ3C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ChatModel } from "../bridging/chatModel.js";
|
|
2
|
+
import { ChatModelInteractor } from "./chatModelInteractor.js";
|
|
3
|
+
import { EngineInteractor } from "./engineInteractor.js";
|
|
4
|
+
import { Interactor, InteractorEntity } from "./interactor.js";
|
|
5
|
+
export declare class ChatModelsInteractor implements Interactor<ChatModel[]> {
|
|
6
|
+
readonly engineInteractor: EngineInteractor;
|
|
7
|
+
readonly entity: InteractorEntity<ChatModel[]>;
|
|
8
|
+
constructor(engineInteractor: EngineInteractor, models: InteractorEntity<ChatModel[]>);
|
|
9
|
+
finalize(): Promise<ChatModel[]>;
|
|
10
|
+
get(repoId: string): ChatModelInteractor;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=chatModelsInteractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatModelsInteractor.d.ts","sourceRoot":"","sources":["../src/interactors/chatModelsInteractor.ts"],"names":[],"mappings":"OAAO,EAAE,SAAS,EAAE;OAGb,EAAE,mBAAmB,EAAE;OACvB,EAAE,gBAAgB,EAAE;OACpB,EAAE,UAAU,EAAE,gBAAgB,EAAE;AAEvC,qBAAa,oBAAqB,YAAW,UAAU,CAAC,SAAS,EAAE,CAAC;IAChE,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAC;gBAEnC,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,gBAAgB,CAAC,SAAS,EAAE,CAAC;IAK/E,QAAQ,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;IAItC,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,mBAAmB;CAQ3C"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ChatModelsInteractor = void 0;
|
|
4
4
|
const config_1 = require("../bridging/config.js");
|
|
5
5
|
const error_1 = require("../error.js");
|
|
6
|
-
const
|
|
7
|
-
class
|
|
6
|
+
const chatModelInteractor_1 = require("./chatModelInteractor.js");
|
|
7
|
+
class ChatModelsInteractor {
|
|
8
8
|
constructor(engineInteractor, models) {
|
|
9
9
|
this.engineInteractor = engineInteractor;
|
|
10
10
|
this.entity = models;
|
|
@@ -18,8 +18,8 @@ class ModelsInteractor {
|
|
|
18
18
|
const model = models.find((model) => model.repoId === repoId);
|
|
19
19
|
return (0, error_1.unwrapOrThrow)(model, error_1.EngineErrorCode.ModelNotFound);
|
|
20
20
|
})();
|
|
21
|
-
return new
|
|
21
|
+
return new chatModelInteractor_1.ChatModelInteractor(this, modelPromise, config_1.Config.default());
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
exports.
|
|
25
|
-
//# sourceMappingURL=
|
|
24
|
+
exports.ChatModelsInteractor = ChatModelsInteractor;
|
|
25
|
+
//# sourceMappingURL=chatModelsInteractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatModelsInteractor.js","sourceRoot":"","sources":["../src/interactors/chatModelsInteractor.ts"],"names":[],"mappings":";;;AACA,kDAA4C;AAC5C,uCAA0D;AAC1D,kEAA4D;AAI5D,MAAa,oBAAoB;IAI7B,YAAY,gBAAkC,EAAE,MAAqC;QACjF,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,QAAQ;QACV,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC;IAC7B,CAAC;IAED,GAAG,CAAC,MAAc;QACd,MAAM,YAAY,GAAG,CAAC,KAAK,IAAI,EAAE;YAC7B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;YACrC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;YAC9D,OAAO,IAAA,qBAAa,EAAC,KAAK,EAAE,uBAAe,CAAC,aAAa,CAAC,CAAC;QAC/D,CAAC,CAAC,EAAE,CAAC;QACL,OAAO,IAAI,yCAAmB,CAAC,IAAI,EAAE,YAAY,EAAE,eAAM,CAAC,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;CACJ;AArBD,oDAqBC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Config } from "../bridging/config.mjs";
|
|
2
2
|
import { EngineErrorCode, unwrapOrThrow } from "../error.mjs";
|
|
3
|
-
import {
|
|
4
|
-
export class
|
|
3
|
+
import { ChatModelInteractor } from "./chatModelInteractor.mjs";
|
|
4
|
+
export class ChatModelsInteractor {
|
|
5
5
|
constructor(engineInteractor, models) {
|
|
6
6
|
this.engineInteractor = engineInteractor;
|
|
7
7
|
this.entity = models;
|
|
@@ -15,7 +15,7 @@ export class ModelsInteractor {
|
|
|
15
15
|
const model = models.find((model) => model.repoId === repoId);
|
|
16
16
|
return unwrapOrThrow(model, EngineErrorCode.ModelNotFound);
|
|
17
17
|
})();
|
|
18
|
-
return new
|
|
18
|
+
return new ChatModelInteractor(this, modelPromise, Config.default());
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
//# sourceMappingURL=
|
|
21
|
+
//# sourceMappingURL=chatModelsInteractor.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatModelsInteractor.mjs","sourceRoot":"","sources":["../src/interactors/chatModelsInteractor.ts"],"names":[],"mappings":"OACO,EAAE,MAAM,EAAE;OACV,EAAE,eAAe,EAAE,aAAa,EAAE;OAClC,EAAE,mBAAmB,EAAE;AAI9B,MAAM,OAAO,oBAAoB;IAI7B,YAAY,gBAAkC,EAAE,MAAqC;QACjF,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,QAAQ;QACV,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC;IAC7B,CAAC;IAED,GAAG,CAAC,MAAc;QACd,MAAM,YAAY,GAAG,CAAC,KAAK,IAAI,EAAE;YAC7B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;YACrC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;YAC9D,OAAO,aAAa,CAAC,KAAK,EAAE,eAAe,CAAC,aAAa,CAAC,CAAC;QAC/D,CAAC,CAAC,EAAE,CAAC;QACL,OAAO,IAAI,mBAAmB,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;CACJ"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ChatSession } from "../bridging/chatSession.mjs";
|
|
2
|
+
import { Input } from "../bridging/input.mjs";
|
|
3
|
+
import { Message } from "../bridging/message.mjs";
|
|
4
|
+
import { Output } from "../bridging/output.mjs";
|
|
5
|
+
import { RunConfig } from "../bridging/runConfig.mjs";
|
|
6
|
+
import { SamplingMethod } from "../bridging/samplingMethod.mjs";
|
|
7
|
+
import { SamplingPolicy } from "../bridging/samplingPolicy.mjs";
|
|
8
|
+
import { ChatModelInteractor } from "./chatModelInteractor.mjs";
|
|
9
|
+
import { Interactor, InteractorEntity } from "./interactor.mjs";
|
|
10
|
+
export declare class ChatSessionInteractor implements Interactor<ChatSession> {
|
|
11
|
+
readonly modelInteractor: ChatModelInteractor;
|
|
12
|
+
readonly entity: InteractorEntity<ChatSession>;
|
|
13
|
+
readonly config: RunConfig;
|
|
14
|
+
constructor(modelInteractor: ChatModelInteractor, session: InteractorEntity<ChatSession>, config: RunConfig);
|
|
15
|
+
finalize(): Promise<ChatSession>;
|
|
16
|
+
tokensLimit(tokensLimit: number): ChatSessionInteractor;
|
|
17
|
+
enableThinking(enableThinking: boolean): ChatSessionInteractor;
|
|
18
|
+
samplingPolicy(samplingPolicy: SamplingPolicy): ChatSessionInteractor;
|
|
19
|
+
samplingMethod(samplingMethod: SamplingMethod): ChatSessionInteractor;
|
|
20
|
+
run(input: Input, progress?: (partialOutput: Output) => boolean): Promise<Output>;
|
|
21
|
+
reply(text: string, progress?: (partialOutput: Output) => boolean): Promise<Output>;
|
|
22
|
+
replyToMessages(messages: Message[], progress?: (partialOutput: Output) => boolean): Promise<Output>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=chatSessionInteractor.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatSessionInteractor.d.mts","sourceRoot":"","sources":["../src/interactors/chatSessionInteractor.ts"],"names":[],"mappings":"OAAO,EAAE,WAAW,EAAE;OACf,EAAE,KAAK,EAAE;OACT,EAAE,OAAO,EAAE;OACX,EAAE,MAAM,EAAE;OACV,EAAE,SAAS,EAAE;OACb,EAAE,cAAc,EAAE;OAClB,EAAE,cAAc,EAAE;OAClB,EAAE,mBAAmB,EAAE;OACvB,EAAE,UAAU,EAAE,gBAAgB,EAAE;AAEvC,qBAAa,qBAAsB,YAAW,UAAU,CAAC,WAAW,CAAC;IACjE,QAAQ,CAAC,eAAe,EAAE,mBAAmB,CAAC;IAC9C,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;IAC/C,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;gBAGvB,eAAe,EAAE,mBAAmB,EACpC,OAAO,EAAE,gBAAgB,CAAC,WAAW,CAAC,EACtC,MAAM,EAAE,SAAS;IAOf,QAAQ,IAAI,OAAO,CAAC,WAAW,CAAC;IAMtC,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,qBAAqB;IAKvD,cAAc,CAAC,cAAc,EAAE,OAAO,GAAG,qBAAqB;IAK9D,cAAc,CAAC,cAAc,EAAE,cAAc,GAAG,qBAAqB;IAKrE,cAAc,CAAC,cAAc,EAAE,cAAc,GAAG,qBAAqB;IAO/D,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,GAAE,CAAC,aAAa,EAAE,MAAM,KAAK,OAAoB,GAAG,OAAO,CAAC,MAAM,CAAC;IAU7F,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,CAAC,aAAa,EAAE,MAAM,KAAK,OAAoB,GAAG,OAAO,CAAC,MAAM,CAAC;IAI/F,eAAe,CACjB,QAAQ,EAAE,OAAO,EAAE,EACnB,QAAQ,GAAE,CAAC,aAAa,EAAE,MAAM,KAAK,OAAoB,GAC1D,OAAO,CAAC,MAAM,CAAC;CAGrB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ChatSession } from "../bridging/chatSession.js";
|
|
2
|
+
import { Input } from "../bridging/input.js";
|
|
3
|
+
import { Message } from "../bridging/message.js";
|
|
4
|
+
import { Output } from "../bridging/output.js";
|
|
5
|
+
import { RunConfig } from "../bridging/runConfig.js";
|
|
6
|
+
import { SamplingMethod } from "../bridging/samplingMethod.js";
|
|
7
|
+
import { SamplingPolicy } from "../bridging/samplingPolicy.js";
|
|
8
|
+
import { ChatModelInteractor } from "./chatModelInteractor.js";
|
|
9
|
+
import { Interactor, InteractorEntity } from "./interactor.js";
|
|
10
|
+
export declare class ChatSessionInteractor implements Interactor<ChatSession> {
|
|
11
|
+
readonly modelInteractor: ChatModelInteractor;
|
|
12
|
+
readonly entity: InteractorEntity<ChatSession>;
|
|
13
|
+
readonly config: RunConfig;
|
|
14
|
+
constructor(modelInteractor: ChatModelInteractor, session: InteractorEntity<ChatSession>, config: RunConfig);
|
|
15
|
+
finalize(): Promise<ChatSession>;
|
|
16
|
+
tokensLimit(tokensLimit: number): ChatSessionInteractor;
|
|
17
|
+
enableThinking(enableThinking: boolean): ChatSessionInteractor;
|
|
18
|
+
samplingPolicy(samplingPolicy: SamplingPolicy): ChatSessionInteractor;
|
|
19
|
+
samplingMethod(samplingMethod: SamplingMethod): ChatSessionInteractor;
|
|
20
|
+
run(input: Input, progress?: (partialOutput: Output) => boolean): Promise<Output>;
|
|
21
|
+
reply(text: string, progress?: (partialOutput: Output) => boolean): Promise<Output>;
|
|
22
|
+
replyToMessages(messages: Message[], progress?: (partialOutput: Output) => boolean): Promise<Output>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=chatSessionInteractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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,CAAC;CAGrB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ChatSessionInteractor = void 0;
|
|
4
4
|
const input_1 = require("../bridging/input.js");
|
|
5
5
|
const samplingPolicy_1 = require("../bridging/samplingPolicy.js");
|
|
6
|
-
class
|
|
6
|
+
class ChatSessionInteractor {
|
|
7
7
|
constructor(modelInteractor, session, config) {
|
|
8
8
|
this.modelInteractor = modelInteractor;
|
|
9
9
|
this.entity = session;
|
|
@@ -15,19 +15,19 @@ class SessionInteractor {
|
|
|
15
15
|
/* Config */
|
|
16
16
|
tokensLimit(tokensLimit) {
|
|
17
17
|
const config = this.config.withTokensLimit(tokensLimit);
|
|
18
|
-
return new
|
|
18
|
+
return new ChatSessionInteractor(this.modelInteractor, this.entity, config);
|
|
19
19
|
}
|
|
20
20
|
enableThinking(enableThinking) {
|
|
21
21
|
const config = this.config.withEnableThinking(enableThinking);
|
|
22
|
-
return new
|
|
22
|
+
return new ChatSessionInteractor(this.modelInteractor, this.entity, config);
|
|
23
23
|
}
|
|
24
24
|
samplingPolicy(samplingPolicy) {
|
|
25
25
|
const config = this.config.withSamplingPolicy(samplingPolicy);
|
|
26
|
-
return new
|
|
26
|
+
return new ChatSessionInteractor(this.modelInteractor, this.entity, config);
|
|
27
27
|
}
|
|
28
28
|
samplingMethod(samplingMethod) {
|
|
29
29
|
const config = this.config.withSamplingPolicy(samplingPolicy_1.SamplingPolicy.custom(samplingMethod));
|
|
30
|
-
return new
|
|
30
|
+
return new ChatSessionInteractor(this.modelInteractor, this.entity, config);
|
|
31
31
|
}
|
|
32
32
|
/* Run */
|
|
33
33
|
async run(input, progress = () => true) {
|
|
@@ -46,5 +46,5 @@ class SessionInteractor {
|
|
|
46
46
|
return await this.run(input_1.Input.messages(messages), progress);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
exports.
|
|
50
|
-
//# sourceMappingURL=
|
|
49
|
+
exports.ChatSessionInteractor = ChatSessionInteractor;
|
|
50
|
+
//# sourceMappingURL=chatSessionInteractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatSessionInteractor.js","sourceRoot":"","sources":["../src/interactors/chatSessionInteractor.ts"],"names":[],"mappings":";;;AACA,gDAA0C;AAK1C,kEAA4D;AAI5D,MAAa,qBAAqB;IAK9B,YACI,eAAoC,EACpC,OAAsC,EACtC,MAAiB;QAEjB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC;QACtB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,QAAQ;QACV,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC;IAC7B,CAAC;IAED,YAAY;IAEZ,WAAW,CAAC,WAAmB;QAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;QACxD,OAAO,IAAI,qBAAqB,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChF,CAAC;IAED,cAAc,CAAC,cAAuB;QAClC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC;QAC9D,OAAO,IAAI,qBAAqB,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChF,CAAC;IAED,cAAc,CAAC,cAA8B;QACzC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC;QAC9D,OAAO,IAAI,qBAAqB,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChF,CAAC;IAED,cAAc,CAAC,cAA8B;QACzC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,+BAAc,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC;QACrF,OAAO,IAAI,qBAAqB,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChF,CAAC;IAED,SAAS;IAET,KAAK,CAAC,GAAG,CAAC,KAAY,EAAE,WAA+C,GAAG,EAAE,CAAC,IAAI;QAC7E,MAAM,aAAa,GAAG,CAAC,KAAK,IAAI,EAAE;YAC9B,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;YACtC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;YACzD,OAAO,MAAM,CAAC;QAClB,CAAC,CAAC,EAAE,CAAC;QACL,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC;QACnC,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,IAAY,EAAE,WAA+C,GAAG,EAAE,CAAC,IAAI;QAC/E,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,aAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,eAAe,CACjB,QAAmB,EACnB,WAA+C,GAAG,EAAE,CAAC,IAAI;QAEzD,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,aAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC;IAC9D,CAAC;CACJ;AA/DD,sDA+DC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Input } from "../bridging/input.mjs";
|
|
2
2
|
import { SamplingPolicy } from "../bridging/samplingPolicy.mjs";
|
|
3
|
-
export class
|
|
3
|
+
export class ChatSessionInteractor {
|
|
4
4
|
constructor(modelInteractor, session, config) {
|
|
5
5
|
this.modelInteractor = modelInteractor;
|
|
6
6
|
this.entity = session;
|
|
@@ -12,19 +12,19 @@ export class SessionInteractor {
|
|
|
12
12
|
/* Config */
|
|
13
13
|
tokensLimit(tokensLimit) {
|
|
14
14
|
const config = this.config.withTokensLimit(tokensLimit);
|
|
15
|
-
return new
|
|
15
|
+
return new ChatSessionInteractor(this.modelInteractor, this.entity, config);
|
|
16
16
|
}
|
|
17
17
|
enableThinking(enableThinking) {
|
|
18
18
|
const config = this.config.withEnableThinking(enableThinking);
|
|
19
|
-
return new
|
|
19
|
+
return new ChatSessionInteractor(this.modelInteractor, this.entity, config);
|
|
20
20
|
}
|
|
21
21
|
samplingPolicy(samplingPolicy) {
|
|
22
22
|
const config = this.config.withSamplingPolicy(samplingPolicy);
|
|
23
|
-
return new
|
|
23
|
+
return new ChatSessionInteractor(this.modelInteractor, this.entity, config);
|
|
24
24
|
}
|
|
25
25
|
samplingMethod(samplingMethod) {
|
|
26
26
|
const config = this.config.withSamplingPolicy(SamplingPolicy.custom(samplingMethod));
|
|
27
|
-
return new
|
|
27
|
+
return new ChatSessionInteractor(this.modelInteractor, this.entity, config);
|
|
28
28
|
}
|
|
29
29
|
/* Run */
|
|
30
30
|
async run(input, progress = () => true) {
|
|
@@ -43,4 +43,4 @@ export class SessionInteractor {
|
|
|
43
43
|
return await this.run(Input.messages(messages), progress);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
//# sourceMappingURL=
|
|
46
|
+
//# sourceMappingURL=chatSessionInteractor.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatSessionInteractor.mjs","sourceRoot":"","sources":["../src/interactors/chatSessionInteractor.ts"],"names":[],"mappings":"OACO,EAAE,KAAK,EAAE;OAKT,EAAE,cAAc,EAAE;AAIzB,MAAM,OAAO,qBAAqB;IAK9B,YACI,eAAoC,EACpC,OAAsC,EACtC,MAAiB;QAEjB,IAAI,CAAC,eAAe,GAAG,eAAe,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OAAO,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;YACtC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;YACzD,OAAO,MAAM,CAAC;QAClB,CAAC,CAAC,EAAE,CAAC;QACL,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC;QACnC,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,IAAY,EAAE,WAA+C,GAAG,EAAE,CAAC,IAAI;QAC/E,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,eAAe,CACjB,QAAmB,EACnB,WAA+C,GAAG,EAAE,CAAC,IAAI;QAEzD,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC;IAC9D,CAAC;CACJ"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DownloadHandle } from "../bridging/downloadHandle.mjs";
|
|
2
2
|
import { DownloadProgressUpdate } from "../bridging/downloadProgressUpdate.mjs";
|
|
3
|
+
import { ChatModelInteractor } from "./chatModelInteractor.mjs";
|
|
3
4
|
import { Interactor, InteractorEntity } from "./interactor.mjs";
|
|
4
|
-
import { ModelInteractor } from "./modelInteractor.mjs";
|
|
5
5
|
export declare class DownloadInteractor implements Interactor<DownloadHandle> {
|
|
6
|
-
readonly modelInteractor:
|
|
6
|
+
readonly modelInteractor: ChatModelInteractor;
|
|
7
7
|
readonly entity: InteractorEntity<DownloadHandle>;
|
|
8
|
-
constructor(modelInteractor:
|
|
8
|
+
constructor(modelInteractor: ChatModelInteractor, handle: InteractorEntity<DownloadHandle>);
|
|
9
9
|
finalize(): Promise<DownloadHandle>;
|
|
10
10
|
resume(): DownloadInteractor;
|
|
11
11
|
pause(): DownloadInteractor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"downloadInteractor.d.mts","sourceRoot":"","sources":["../src/interactors/downloadInteractor.ts"],"names":[],"mappings":"OAAO,EAAE,cAAc,EAAE;OAClB,EAAE,sBAAsB,EAAE;OAC1B,EAAE,
|
|
1
|
+
{"version":3,"file":"downloadInteractor.d.mts","sourceRoot":"","sources":["../src/interactors/downloadInteractor.ts"],"names":[],"mappings":"OAAO,EAAE,cAAc,EAAE;OAClB,EAAE,sBAAsB,EAAE;OAC1B,EAAE,mBAAmB,EAAE;OACvB,EAAE,UAAU,EAAE,gBAAgB,EAAE;AAEvC,qBAAa,kBAAmB,YAAW,UAAU,CAAC,cAAc,CAAC;IACjE,QAAQ,CAAC,eAAe,EAAE,mBAAmB,CAAC;IAC9C,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC;gBAEtC,eAAe,EAAE,mBAAmB,EAAE,MAAM,EAAE,gBAAgB,CAAC,cAAc,CAAC;IAKpF,QAAQ,IAAI,OAAO,CAAC,cAAc,CAAC;IAIzC,MAAM;IAIN,KAAK;IAIL,MAAM;IAIN,gBAAgB,CAAC,QAAQ,EAAE,CAAC,cAAc,EAAE,sBAAsB,KAAK,IAAI;IAQ3E,OAAO,CAAC,eAAe;CAQ1B"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DownloadHandle } from "../bridging/downloadHandle.js";
|
|
2
2
|
import { DownloadProgressUpdate } from "../bridging/downloadProgressUpdate.js";
|
|
3
|
+
import { ChatModelInteractor } from "./chatModelInteractor.js";
|
|
3
4
|
import { Interactor, InteractorEntity } from "./interactor.js";
|
|
4
|
-
import { ModelInteractor } from "./modelInteractor.js";
|
|
5
5
|
export declare class DownloadInteractor implements Interactor<DownloadHandle> {
|
|
6
|
-
readonly modelInteractor:
|
|
6
|
+
readonly modelInteractor: ChatModelInteractor;
|
|
7
7
|
readonly entity: InteractorEntity<DownloadHandle>;
|
|
8
|
-
constructor(modelInteractor:
|
|
8
|
+
constructor(modelInteractor: ChatModelInteractor, handle: InteractorEntity<DownloadHandle>);
|
|
9
9
|
finalize(): Promise<DownloadHandle>;
|
|
10
10
|
resume(): DownloadInteractor;
|
|
11
11
|
pause(): DownloadInteractor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"downloadInteractor.d.ts","sourceRoot":"","sources":["../src/interactors/downloadInteractor.ts"],"names":[],"mappings":"OAAO,EAAE,cAAc,EAAE;OAClB,EAAE,sBAAsB,EAAE;OAC1B,EAAE,
|
|
1
|
+
{"version":3,"file":"downloadInteractor.d.ts","sourceRoot":"","sources":["../src/interactors/downloadInteractor.ts"],"names":[],"mappings":"OAAO,EAAE,cAAc,EAAE;OAClB,EAAE,sBAAsB,EAAE;OAC1B,EAAE,mBAAmB,EAAE;OACvB,EAAE,UAAU,EAAE,gBAAgB,EAAE;AAEvC,qBAAa,kBAAmB,YAAW,UAAU,CAAC,cAAc,CAAC;IACjE,QAAQ,CAAC,eAAe,EAAE,mBAAmB,CAAC;IAC9C,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC;gBAEtC,eAAe,EAAE,mBAAmB,EAAE,MAAM,EAAE,gBAAgB,CAAC,cAAc,CAAC;IAKpF,QAAQ,IAAI,OAAO,CAAC,cAAc,CAAC;IAIzC,MAAM;IAIN,KAAK;IAIL,MAAM;IAIN,gBAAgB,CAAC,QAAQ,EAAE,CAAC,cAAc,EAAE,sBAAsB,KAAK,IAAI;IAQ3E,OAAO,CAAC,eAAe;CAQ1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"downloadInteractor.js","sourceRoot":"","sources":["../src/interactors/downloadInteractor.ts"],"names":[],"mappings":";;;AAKA,MAAa,kBAAkB;IAI3B,YAAY,
|
|
1
|
+
{"version":3,"file":"downloadInteractor.js","sourceRoot":"","sources":["../src/interactors/downloadInte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AAC;CACJ;AAzCD,gDAyCC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"downloadInteractor.mjs","sourceRoot":"","sources":["../src/interactors/downloadInteractor.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,kBAAkB;IAI3B,YAAY,
|
|
1
|
+
{"version":3,"file":"downloadInteractor.mjs","sourceRoot":"","sources":["../src/interactors/downloadInteractor.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,kBAAkB;IAI3B,YAAY,eAAoC,EAAE,MAAwC;QACtF,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,QAAQ;QACV,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC;IAC7B,CAAC;IAED,MAAM;QACF,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,KAAK;QACD,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;IACxE,CAAC;IAED,MAAM;QACF,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IACzE,CAAC;IAED,gBAAgB,CAAC,QAA0D;QACvE,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YACzC,IAAI,KAAK,EAAE,MAAM,MAAM,IAAI,MAAM,CAAC,cAAc,EAAE,EAAE,CAAC;gBACjD,QAAQ,CAAC,MAAM,CAAC,CAAC;YACrB,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAEO,eAAe,CAAC,QAAmD;QACvE,MAAM,aAAa,GAAG,CAAC,KAAK,IAAI,EAAE;YAC9B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;YACrC,MAAM,QAAQ,CAAC,MAAM,CAAC,CAAC;YACvB,OAAO,MAAM,CAAC;QAClB,CAAC,CAAC,EAAE,CAAC;QACL,OAAO,IAAI,kBAAkB,CAAC,IAAI,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;IACvE,CAAC;CACJ"}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { Engine } from "../bridging/engine.mjs";
|
|
2
|
-
import { ModelKind } from "../bridging/model.mjs";
|
|
3
2
|
import { ModelType } from "../bridging/modelType.mjs";
|
|
3
|
+
import { ChatModelInteractor } from "./chatModelInteractor.mjs";
|
|
4
|
+
import { ChatModelsInteractor } from "./chatModelsInteractor.mjs";
|
|
4
5
|
import { Interactor, InteractorEntity } from "./interactor.mjs";
|
|
5
|
-
import { ModelInteractor } from "./modelInteractor.mjs";
|
|
6
|
-
import { ModelsInteractor } from "./modelsInteractor.mjs";
|
|
7
6
|
export declare class EngineInteractor implements Interactor<Engine> {
|
|
8
7
|
readonly entity: InteractorEntity<Engine>;
|
|
9
8
|
readonly modelTypeFilter: ModelType[] | null;
|
|
10
|
-
|
|
11
|
-
constructor(engine: InteractorEntity<Engine>, modelTypeFilter?: ModelType[] | null, modelKindFilter?: ModelKind[] | null);
|
|
9
|
+
constructor(engine: InteractorEntity<Engine>, modelTypeFilter?: ModelType[] | null);
|
|
12
10
|
finalize(): Promise<Engine>;
|
|
13
11
|
filterTypes(types: ModelType[] | null): EngineInteractor;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
model(repoId: string): ModelInteractor;
|
|
12
|
+
chatModels(): ChatModelsInteractor;
|
|
13
|
+
chatModel(repoId: string): ChatModelInteractor;
|
|
17
14
|
}
|
|
18
15
|
//# sourceMappingURL=engineInteractor.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engineInteractor.d.mts","sourceRoot":"","sources":["../src/interactors/engineInteractor.ts"],"names":[],"mappings":"OAAO,EAAE,MAAM,EAAE;OACV,EAAE,SAAS,EAAE;OACb,EAAE,
|
|
1
|
+
{"version":3,"file":"engineInteractor.d.mts","sourceRoot":"","sources":["../src/interactors/engineInteractor.ts"],"names":[],"mappings":"OAAO,EAAE,MAAM,EAAE;OACV,EAAE,SAAS,EAAE;OACb,EAAE,mBAAmB,EAAE;OACvB,EAAE,oBAAoB,EAAE;OACxB,EAAE,UAAU,EAAE,gBAAgB,EAAE;AAEvC,qBAAa,gBAAiB,YAAW,UAAU,CAAC,MAAM,CAAC;IACvD,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC1C,QAAQ,CAAC,eAAe,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;gBAEjC,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAAE,eAAe,GAAE,SAAS,EAAE,GAAG,IAAW;IAKlF,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;IAMjC,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,GAAG,gBAAgB;IAIxD,UAAU,IAAI,oBAAoB;IAQlC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,mBAAmB;CAIjD"}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { Engine } from "../bridging/engine.js";
|
|
2
|
-
import { ModelKind } from "../bridging/model.js";
|
|
3
2
|
import { ModelType } from "../bridging/modelType.js";
|
|
3
|
+
import { ChatModelInteractor } from "./chatModelInteractor.js";
|
|
4
|
+
import { ChatModelsInteractor } from "./chatModelsInteractor.js";
|
|
4
5
|
import { Interactor, InteractorEntity } from "./interactor.js";
|
|
5
|
-
import { ModelInteractor } from "./modelInteractor.js";
|
|
6
|
-
import { ModelsInteractor } from "./modelsInteractor.js";
|
|
7
6
|
export declare class EngineInteractor implements Interactor<Engine> {
|
|
8
7
|
readonly entity: InteractorEntity<Engine>;
|
|
9
8
|
readonly modelTypeFilter: ModelType[] | null;
|
|
10
|
-
|
|
11
|
-
constructor(engine: InteractorEntity<Engine>, modelTypeFilter?: ModelType[] | null, modelKindFilter?: ModelKind[] | null);
|
|
9
|
+
constructor(engine: InteractorEntity<Engine>, modelTypeFilter?: ModelType[] | null);
|
|
12
10
|
finalize(): Promise<Engine>;
|
|
13
11
|
filterTypes(types: ModelType[] | null): EngineInteractor;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
model(repoId: string): ModelInteractor;
|
|
12
|
+
chatModels(): ChatModelsInteractor;
|
|
13
|
+
chatModel(repoId: string): ChatModelInteractor;
|
|
17
14
|
}
|
|
18
15
|
//# sourceMappingURL=engineInteractor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engineInteractor.d.ts","sourceRoot":"","sources":["../src/interactors/engineInteractor.ts"],"names":[],"mappings":"OAAO,EAAE,MAAM,EAAE;OACV,EAAE,SAAS,EAAE;OACb,EAAE,
|
|
1
|
+
{"version":3,"file":"engineInteractor.d.ts","sourceRoot":"","sources":["../src/interactors/engineInteractor.ts"],"names":[],"mappings":"OAAO,EAAE,MAAM,EAAE;OACV,EAAE,SAAS,EAAE;OACb,EAAE,mBAAmB,EAAE;OACvB,EAAE,oBAAoB,EAAE;OACxB,EAAE,UAAU,EAAE,gBAAgB,EAAE;AAEvC,qBAAa,gBAAiB,YAAW,UAAU,CAAC,MAAM,CAAC;IACvD,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC1C,QAAQ,CAAC,eAAe,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;gBAEjC,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAAE,eAAe,GAAE,SAAS,EAAE,GAAG,IAAW;IAKlF,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;IAMjC,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,GAAG,gBAAgB;IAIxD,UAAU,IAAI,oBAAoB;IAQlC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,mBAAmB;CAIjD"}
|
|
@@ -1,32 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EngineInteractor = void 0;
|
|
4
|
-
const
|
|
4
|
+
const chatModelsInteractor_1 = require("./chatModelsInteractor.js");
|
|
5
5
|
class EngineInteractor {
|
|
6
|
-
constructor(engine, modelTypeFilter = null
|
|
6
|
+
constructor(engine, modelTypeFilter = null) {
|
|
7
7
|
this.entity = engine;
|
|
8
8
|
this.modelTypeFilter = modelTypeFilter;
|
|
9
|
-
this.modelKindFilter = modelKindFilter;
|
|
10
9
|
}
|
|
11
10
|
async finalize() {
|
|
12
11
|
return await this.entity;
|
|
13
12
|
}
|
|
14
13
|
/* Models */
|
|
15
14
|
filterTypes(types) {
|
|
16
|
-
return new EngineInteractor(this.entity, types
|
|
15
|
+
return new EngineInteractor(this.entity, types);
|
|
17
16
|
}
|
|
18
|
-
|
|
19
|
-
return new EngineInteractor(this.entity, this.modelTypeFilter, kinds);
|
|
20
|
-
}
|
|
21
|
-
models() {
|
|
17
|
+
chatModels() {
|
|
22
18
|
const modelsPromise = (async () => {
|
|
23
19
|
const engine = await this.finalize();
|
|
24
|
-
return await engine.
|
|
20
|
+
return await engine.chatModels(this.modelTypeFilter);
|
|
25
21
|
})();
|
|
26
|
-
return new
|
|
22
|
+
return new chatModelsInteractor_1.ChatModelsInteractor(this, modelsPromise);
|
|
27
23
|
}
|
|
28
|
-
|
|
29
|
-
const models = this.
|
|
24
|
+
chatModel(repoId) {
|
|
25
|
+
const models = this.chatModels();
|
|
30
26
|
return models.get(repoId);
|
|
31
27
|
}
|
|
32
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engineInteractor.js","sourceRoot":"","sources":["../src/interactors/engineInteractor.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"engineInteractor.js","sourceRoot":"","sources":["../src/interactors/engineInteractor.ts"],"names":[],"mappings":";;;AAGA,oEAA8D;AAG9D,MAAa,gBAAgB;IAIzB,YAAY,MAAgC,EAAE,kBAAsC,IAAI;QACpF,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IAC3C,CAAC;IAED,KAAK,CAAC,QAAQ;QACV,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC;IAC7B,CAAC;IAED,YAAY;IAEZ,WAAW,CAAC,KAAyB;QACjC,OAAO,IAAI,gBAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACpD,CAAC;IAED,UAAU;QACN,MAAM,aAAa,GAAG,CAAC,KAAK,IAAI,EAAE;YAC9B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;YACrC,OAAO,MAAM,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACzD,CAAC,CAAC,EAAE,CAAC;QACL,OAAO,IAAI,2CAAoB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IACzD,CAAC;IAED,SAAS,CAAC,MAAc;QACpB,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QACjC,OAAO,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;CACJ;AA/BD,4CA+BC"}
|
|
@@ -1,29 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChatModelsInteractor } from "./chatModelsInteractor.mjs";
|
|
2
2
|
export class EngineInteractor {
|
|
3
|
-
constructor(engine, modelTypeFilter = null
|
|
3
|
+
constructor(engine, modelTypeFilter = null) {
|
|
4
4
|
this.entity = engine;
|
|
5
5
|
this.modelTypeFilter = modelTypeFilter;
|
|
6
|
-
this.modelKindFilter = modelKindFilter;
|
|
7
6
|
}
|
|
8
7
|
async finalize() {
|
|
9
8
|
return await this.entity;
|
|
10
9
|
}
|
|
11
10
|
/* Models */
|
|
12
11
|
filterTypes(types) {
|
|
13
|
-
return new EngineInteractor(this.entity, types
|
|
12
|
+
return new EngineInteractor(this.entity, types);
|
|
14
13
|
}
|
|
15
|
-
|
|
16
|
-
return new EngineInteractor(this.entity, this.modelTypeFilter, kinds);
|
|
17
|
-
}
|
|
18
|
-
models() {
|
|
14
|
+
chatModels() {
|
|
19
15
|
const modelsPromise = (async () => {
|
|
20
16
|
const engine = await this.finalize();
|
|
21
|
-
return await engine.
|
|
17
|
+
return await engine.chatModels(this.modelTypeFilter);
|
|
22
18
|
})();
|
|
23
|
-
return new
|
|
19
|
+
return new ChatModelsInteractor(this, modelsPromise);
|
|
24
20
|
}
|
|
25
|
-
|
|
26
|
-
const models = this.
|
|
21
|
+
chatModel(repoId) {
|
|
22
|
+
const models = this.chatModels();
|
|
27
23
|
return models.get(repoId);
|
|
28
24
|
}
|
|
29
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engineInteractor.mjs","sourceRoot":"","sources":["../src/interactors/engineInteractor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"engineInteractor.mjs","sourceRoot":"","sources":["../src/interactors/engineInteractor.ts"],"names":[],"mappings":"OAGO,EAAE,oBAAoB,EAAE;AAG/B,MAAM,OAAO,gBAAgB;IAIzB,YAAY,MAAgC,EAAE,kBAAsC,IAAI;QACpF,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IAC3C,CAAC;IAED,KAAK,CAAC,QAAQ;QACV,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC;IAC7B,CAAC;IAED,YAAY;IAEZ,WAAW,CAAC,KAAyB;QACjC,OAAO,IAAI,gBAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACpD,CAAC;IAED,UAAU;QACN,MAAM,aAAa,GAAG,CAAC,KAAK,IAAI,EAAE;YAC9B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;YACrC,OAAO,MAAM,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACzD,CAAC,CAAC,EAAE,CAAC;QACL,OAAO,IAAI,oBAAoB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IACzD,CAAC;IAED,SAAS,CAAC,MAAc;QACpB,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QACjC,OAAO,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;CACJ"}
|