cheshirecat-typescript-client 1.3.15 → 1.3.18
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/builders/why.d.ts +0 -5
- package/dist/builders/why.js +0 -12
- package/dist/builders/why.js.map +1 -1
- package/dist/models/dtos.d.ts +2 -9
- package/dist/models/dtos.js +5 -30
- package/dist/models/dtos.js.map +1 -1
- package/dist/types.d.ts +0 -3
- package/package.json +1 -1
package/dist/builders/why.d.ts
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import { BaseBuilder } from "./types";
|
|
2
2
|
import { Memory, Why } from "../types";
|
|
3
|
-
import { AgentOutput } from "../models/dtos";
|
|
4
3
|
export declare class WhyBuilder implements BaseBuilder {
|
|
5
4
|
private input?;
|
|
6
5
|
private intermediateSteps?;
|
|
7
6
|
private memory;
|
|
8
|
-
private modelInteractions?;
|
|
9
|
-
private agentOutput?;
|
|
10
7
|
static create(): WhyBuilder;
|
|
11
8
|
setInput(input?: string): WhyBuilder;
|
|
12
9
|
setIntermediateSteps(intermediateSteps?: Record<string, any>[]): WhyBuilder;
|
|
13
10
|
setMemory(memory: Memory): WhyBuilder;
|
|
14
|
-
setModelInteractions(modelInteractions?: Record<string, any>[]): WhyBuilder;
|
|
15
|
-
setAgentOutput(agentOutput?: AgentOutput): WhyBuilder;
|
|
16
11
|
build(): Why;
|
|
17
12
|
}
|
package/dist/builders/why.js
CHANGED
|
@@ -5,8 +5,6 @@ class WhyBuilder {
|
|
|
5
5
|
input;
|
|
6
6
|
intermediateSteps = [];
|
|
7
7
|
memory;
|
|
8
|
-
modelInteractions = [];
|
|
9
|
-
agentOutput;
|
|
10
8
|
static create() {
|
|
11
9
|
return new WhyBuilder();
|
|
12
10
|
}
|
|
@@ -22,21 +20,11 @@ class WhyBuilder {
|
|
|
22
20
|
this.memory = memory;
|
|
23
21
|
return this;
|
|
24
22
|
}
|
|
25
|
-
setModelInteractions(modelInteractions) {
|
|
26
|
-
this.modelInteractions = modelInteractions ?? [];
|
|
27
|
-
return this;
|
|
28
|
-
}
|
|
29
|
-
setAgentOutput(agentOutput) {
|
|
30
|
-
this.agentOutput = agentOutput;
|
|
31
|
-
return this;
|
|
32
|
-
}
|
|
33
23
|
build() {
|
|
34
24
|
return {
|
|
35
25
|
input: this.input,
|
|
36
26
|
intermediateSteps: this.intermediateSteps,
|
|
37
27
|
memory: this.memory,
|
|
38
|
-
modelInteractions: this.modelInteractions,
|
|
39
|
-
agentOutput: this.agentOutput
|
|
40
28
|
};
|
|
41
29
|
}
|
|
42
30
|
}
|
package/dist/builders/why.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"why.js","sourceRoot":"","sources":["../../src/builders/why.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"why.js","sourceRoot":"","sources":["../../src/builders/why.ts"],"names":[],"mappings":";;;AAGA,MAAa,UAAU;IACX,KAAK,CAAU;IACf,iBAAiB,GAA2B,EAAE,CAAC;IAC/C,MAAM,CAAU;IAEjB,MAAM,CAAC,MAAM;QAChB,OAAO,IAAI,UAAU,EAAE,CAAC;IAC5B,CAAC;IAEM,QAAQ,CAAC,KAAc;QAC1B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,oBAAoB,CAAC,iBAAyC;QACjE,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,IAAI,EAAE,CAAC;QACjD,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,SAAS,CAAC,MAAc;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,KAAK;QACR,OAAO;YACH,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;YACzC,MAAM,EAAE,IAAI,CAAC,MAAM;SACtB,CAAC;IACN,CAAC;CACJ;AA/BD,gCA+BC"}
|
package/dist/models/dtos.d.ts
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import { BaseDTO } from "./base";
|
|
2
|
-
export declare class AgentOutput extends BaseDTO {
|
|
3
|
-
output?: string | null;
|
|
4
|
-
intermediateSteps: Record<string, any>[];
|
|
5
|
-
returnDirect: boolean;
|
|
6
|
-
withLlmError: boolean;
|
|
7
|
-
toArray(): Record<string, any>;
|
|
8
|
-
}
|
|
9
2
|
export declare class Memory extends BaseDTO {
|
|
10
3
|
declarative: Record<string, any>[];
|
|
11
4
|
procedural: Record<string, any>[];
|
|
@@ -25,7 +18,8 @@ export declare class MessageBase extends BaseDTO {
|
|
|
25
18
|
}
|
|
26
19
|
export declare class Message extends MessageBase {
|
|
27
20
|
metadata?: Record<string, any> | undefined;
|
|
28
|
-
|
|
21
|
+
stream: boolean;
|
|
22
|
+
constructor(text: string, image?: string, metadata?: Record<string, any> | undefined, stream?: boolean);
|
|
29
23
|
toArray(): Record<string, any>;
|
|
30
24
|
}
|
|
31
25
|
export declare class SettingInput extends BaseDTO {
|
|
@@ -39,7 +33,6 @@ export declare class Why extends BaseDTO {
|
|
|
39
33
|
input?: string;
|
|
40
34
|
intermediateSteps: Record<string, any>[];
|
|
41
35
|
memory: Memory;
|
|
42
|
-
modelInteractions: Record<string, any>[];
|
|
43
36
|
toArray(): Record<string, any>;
|
|
44
37
|
}
|
|
45
38
|
export declare class Permission {
|
package/dist/models/dtos.js
CHANGED
|
@@ -9,31 +9,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Permission = exports.Why = exports.SettingInput = exports.Message = exports.MessageBase = exports.MemoryPoint = exports.Memory =
|
|
12
|
+
exports.Permission = exports.Why = exports.SettingInput = exports.Message = exports.MessageBase = exports.MemoryPoint = exports.Memory = void 0;
|
|
13
13
|
const base_1 = require("./base");
|
|
14
14
|
const decorators_1 = require("../decorators");
|
|
15
|
-
class AgentOutput extends base_1.BaseDTO {
|
|
16
|
-
output = null;
|
|
17
|
-
intermediateSteps = [];
|
|
18
|
-
returnDirect = false;
|
|
19
|
-
withLlmError = false;
|
|
20
|
-
toArray() {
|
|
21
|
-
return this.toJSON();
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.AgentOutput = AgentOutput;
|
|
25
|
-
__decorate([
|
|
26
|
-
(0, decorators_1.SerializedName)("intermediate_steps"),
|
|
27
|
-
__metadata("design:type", Array)
|
|
28
|
-
], AgentOutput.prototype, "intermediateSteps", void 0);
|
|
29
|
-
__decorate([
|
|
30
|
-
(0, decorators_1.SerializedName)("return_direct"),
|
|
31
|
-
__metadata("design:type", Boolean)
|
|
32
|
-
], AgentOutput.prototype, "returnDirect", void 0);
|
|
33
|
-
__decorate([
|
|
34
|
-
(0, decorators_1.SerializedName)("with_llm_error"),
|
|
35
|
-
__metadata("design:type", Boolean)
|
|
36
|
-
], AgentOutput.prototype, "withLlmError", void 0);
|
|
37
15
|
class Memory extends base_1.BaseDTO {
|
|
38
16
|
declarative = [];
|
|
39
17
|
procedural = [];
|
|
@@ -76,14 +54,17 @@ class MessageBase extends base_1.BaseDTO {
|
|
|
76
54
|
exports.MessageBase = MessageBase;
|
|
77
55
|
class Message extends MessageBase {
|
|
78
56
|
metadata;
|
|
79
|
-
|
|
57
|
+
stream;
|
|
58
|
+
constructor(text, image, metadata, stream = false) {
|
|
80
59
|
super();
|
|
81
60
|
this.metadata = metadata;
|
|
61
|
+
this.stream = stream;
|
|
82
62
|
this.text = text;
|
|
83
63
|
this.image = image || null;
|
|
84
64
|
}
|
|
85
65
|
toArray() {
|
|
86
66
|
const result = super.toArray();
|
|
67
|
+
result["stream"] = this.stream;
|
|
87
68
|
if (this.metadata) {
|
|
88
69
|
result["metadata"] = this.metadata;
|
|
89
70
|
}
|
|
@@ -110,13 +91,11 @@ class Why extends base_1.BaseDTO {
|
|
|
110
91
|
input;
|
|
111
92
|
intermediateSteps = [];
|
|
112
93
|
memory;
|
|
113
|
-
modelInteractions = [];
|
|
114
94
|
toArray() {
|
|
115
95
|
return {
|
|
116
96
|
input: this.input,
|
|
117
97
|
intermediate_steps: this.intermediateSteps,
|
|
118
98
|
memory: this.memory.toArray(),
|
|
119
|
-
model_interactions: this.modelInteractions,
|
|
120
99
|
};
|
|
121
100
|
}
|
|
122
101
|
}
|
|
@@ -125,10 +104,6 @@ __decorate([
|
|
|
125
104
|
(0, decorators_1.SerializedName)("intermediate_steps"),
|
|
126
105
|
__metadata("design:type", Array)
|
|
127
106
|
], Why.prototype, "intermediateSteps", void 0);
|
|
128
|
-
__decorate([
|
|
129
|
-
(0, decorators_1.SerializedName)("model_interactions"),
|
|
130
|
-
__metadata("design:type", Array)
|
|
131
|
-
], Why.prototype, "modelInteractions", void 0);
|
|
132
107
|
class Permission {
|
|
133
108
|
id;
|
|
134
109
|
name;
|
package/dist/models/dtos.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dtos.js","sourceRoot":"","sources":["../../src/models/dtos.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iCAA+B;AAC/B,8CAA6C;AAE7C,MAAa,
|
|
1
|
+
{"version":3,"file":"dtos.js","sourceRoot":"","sources":["../../src/models/dtos.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iCAA+B;AAC/B,8CAA6C;AAE7C,MAAa,MAAO,SAAQ,cAAO;IACxB,WAAW,GAA0B,EAAE,CAAC;IACxC,UAAU,GAA0B,EAAE,CAAC;IAEvC,OAAO;QACV,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;IACzB,CAAC;CACJ;AAPD,wBAOC;AAED,MAAa,WAAY,SAAQ,cAAO;IAEzB;IACA;IAFX,YACW,OAAe,EACf,QAA6B;QAEpC,KAAK,EAAE,CAAC;QAHD,YAAO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AsBC;AAED,MAAa,YAAa,SAAQ,cAAO;IAE1B;IACA;IACA;IAHX,YACW,IAAY,EACZ,QAA6B,EAAE,EAC/B,QAAiB;QAExB,KAAK,EAAE,CAAC;QAJD,SAAI,GAAJ,IAAI,CAAQ;QACZ,UAAK,GAAL,KAAK,CAA0B;QAC/B,aAAQ,GAAR,QAAQ,CAAS;IAG5B,CAAC;IAEM,OAAO;QACV,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;IACzB,CAAC;CACJ;AAZD,oCAYC;AAED,MAAa,GAAI,SAAQ,cAAO;IACrB,KAAK,CAAU;IAGf,iBAAiB,GAA0B,EAAE,CAAC;IAE9C,MAAM,CAAS;IAEf,OAAO;QACV,OAAO;YACH,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,kBAAkB,EAAE,IAAI,CAAC,iBAAiB;YAC1C,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;SAChC,CAAC;IACN,CAAC;CACJ;AAfD,kBAeC;AAXU;IADN,IAAA,2BAAc,EAAC,oBAAoB,CAAC;;8CACgB;AAazD,MAAa,UAAU;IACnB,EAAE,CAAS;IACX,IAAI,CAAM;CACb;AAHD,gCAGC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { AgentOutput } from "./models/dtos";
|
|
2
1
|
export interface Memory {
|
|
3
2
|
declarative: Record<string, any>[];
|
|
4
3
|
procedural: Record<string, any>[];
|
|
@@ -16,7 +15,5 @@ export interface Why {
|
|
|
16
15
|
input?: string | null;
|
|
17
16
|
intermediateSteps?: Record<string, any>[];
|
|
18
17
|
memory: Memory;
|
|
19
|
-
modelInteractions?: Record<string, any>[];
|
|
20
|
-
agentOutput?: AgentOutput;
|
|
21
18
|
}
|
|
22
19
|
export type Role = "user" | "assistant";
|