samuel-integrations-sdk 0.0.2 → 0.0.3
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/generated-api.d.ts +98 -25
- package/dist/generated-api.d.ts.map +1 -1
- package/dist/generated-api.js +31 -10
- package/dist/generated-api.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/generated-api.d.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Role of the message sender
|
|
3
3
|
*/
|
|
4
|
-
export type
|
|
5
|
-
export declare const
|
|
4
|
+
export type GenerateTextBodyMessagesItemRole = typeof GenerateTextBodyMessagesItemRole[keyof typeof GenerateTextBodyMessagesItemRole];
|
|
5
|
+
export declare const GenerateTextBodyMessagesItemRole: {
|
|
6
6
|
readonly user: "user";
|
|
7
7
|
readonly assistant: "assistant";
|
|
8
8
|
readonly system: "system";
|
|
9
9
|
};
|
|
10
|
-
export type
|
|
10
|
+
export type GenerateTextBodyMessagesItem = {
|
|
11
11
|
/** Role of the message sender */
|
|
12
|
-
role:
|
|
12
|
+
role: GenerateTextBodyMessagesItemRole;
|
|
13
13
|
/** Content of the message */
|
|
14
14
|
content: string;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* LLM provider to use
|
|
18
18
|
*/
|
|
19
|
-
export type
|
|
20
|
-
export declare const
|
|
21
|
-
readonly
|
|
22
|
-
readonly
|
|
23
|
-
readonly
|
|
19
|
+
export type GenerateTextBodyProvider = typeof GenerateTextBodyProvider[keyof typeof GenerateTextBodyProvider];
|
|
20
|
+
export declare const GenerateTextBodyProvider: {
|
|
21
|
+
readonly Anthropic: "Anthropic";
|
|
22
|
+
readonly OpenAI: "OpenAI";
|
|
23
|
+
readonly Gemini: "Gemini";
|
|
24
24
|
};
|
|
25
|
-
export type
|
|
25
|
+
export type GenerateTextBodyOptions = {
|
|
26
26
|
/**
|
|
27
27
|
* Sampling temperature (0-2)
|
|
28
28
|
* @minimum 0
|
|
@@ -42,35 +42,108 @@ export type GenerateBodyOptions = {
|
|
|
42
42
|
*/
|
|
43
43
|
topP?: number;
|
|
44
44
|
};
|
|
45
|
-
export type
|
|
45
|
+
export type GenerateTextBody = {
|
|
46
46
|
/**
|
|
47
47
|
* Array of chat messages
|
|
48
48
|
* @minItems 1
|
|
49
49
|
*/
|
|
50
|
-
messages:
|
|
50
|
+
messages: GenerateTextBodyMessagesItem[];
|
|
51
51
|
/** LLM provider to use */
|
|
52
|
-
provider:
|
|
52
|
+
provider: GenerateTextBodyProvider;
|
|
53
53
|
/** Specific model to use (defaults to provider default) */
|
|
54
54
|
model?: string;
|
|
55
|
-
options?:
|
|
55
|
+
options?: GenerateTextBodyOptions;
|
|
56
56
|
/** Custom API key (uses environment variable if not provided) */
|
|
57
57
|
apiKey?: string;
|
|
58
58
|
};
|
|
59
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Structured output if schema provided
|
|
61
|
+
* @nullable
|
|
62
|
+
*/
|
|
63
|
+
export type GenerateText200Output = unknown | null;
|
|
64
|
+
/**
|
|
65
|
+
* Token usage information
|
|
66
|
+
*/
|
|
67
|
+
export type GenerateText200Usage = {
|
|
68
|
+
promptTokens: number;
|
|
69
|
+
completionTokens: number;
|
|
70
|
+
totalTokens: number;
|
|
71
|
+
};
|
|
72
|
+
export type GenerateText200 = {
|
|
60
73
|
/** Generated text content */
|
|
74
|
+
text: string;
|
|
75
|
+
/**
|
|
76
|
+
* Structured output if schema provided
|
|
77
|
+
* @nullable
|
|
78
|
+
*/
|
|
79
|
+
output?: GenerateText200Output;
|
|
80
|
+
/** Token usage information */
|
|
81
|
+
usage: GenerateText200Usage;
|
|
82
|
+
/** Reason for completion */
|
|
83
|
+
finishReason: string;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Role of the message sender
|
|
87
|
+
*/
|
|
88
|
+
export type CreateStreamBodyMessagesItemRole = typeof CreateStreamBodyMessagesItemRole[keyof typeof CreateStreamBodyMessagesItemRole];
|
|
89
|
+
export declare const CreateStreamBodyMessagesItemRole: {
|
|
90
|
+
readonly user: "user";
|
|
91
|
+
readonly assistant: "assistant";
|
|
92
|
+
readonly system: "system";
|
|
93
|
+
};
|
|
94
|
+
export type CreateStreamBodyMessagesItem = {
|
|
95
|
+
/** Role of the message sender */
|
|
96
|
+
role: CreateStreamBodyMessagesItemRole;
|
|
97
|
+
/** Content of the message */
|
|
61
98
|
content: string;
|
|
62
|
-
/** Provider used */
|
|
63
|
-
provider: string;
|
|
64
|
-
/** Model used */
|
|
65
|
-
model: string;
|
|
66
99
|
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
100
|
+
/**
|
|
101
|
+
* LLM provider to use
|
|
102
|
+
*/
|
|
103
|
+
export type CreateStreamBodyProvider = typeof CreateStreamBodyProvider[keyof typeof CreateStreamBodyProvider];
|
|
104
|
+
export declare const CreateStreamBodyProvider: {
|
|
105
|
+
readonly Anthropic: "Anthropic";
|
|
106
|
+
readonly OpenAI: "OpenAI";
|
|
107
|
+
readonly Gemini: "Gemini";
|
|
108
|
+
};
|
|
109
|
+
export type CreateStreamBodyOptions = {
|
|
110
|
+
/**
|
|
111
|
+
* Sampling temperature (0-2)
|
|
112
|
+
* @minimum 0
|
|
113
|
+
* @maximum 2
|
|
114
|
+
*/
|
|
115
|
+
temperature?: number;
|
|
116
|
+
/**
|
|
117
|
+
* Maximum tokens to generate
|
|
118
|
+
* @minimum 0
|
|
119
|
+
* @exclusiveMinimum
|
|
120
|
+
*/
|
|
121
|
+
maxTokens?: number;
|
|
122
|
+
/**
|
|
123
|
+
* Top-p sampling parameter
|
|
124
|
+
* @minimum 0
|
|
125
|
+
* @maximum 1
|
|
126
|
+
*/
|
|
127
|
+
topP?: number;
|
|
128
|
+
};
|
|
129
|
+
export type CreateStreamBody = {
|
|
130
|
+
/**
|
|
131
|
+
* Array of chat messages
|
|
132
|
+
* @minItems 1
|
|
133
|
+
*/
|
|
134
|
+
messages: CreateStreamBodyMessagesItem[];
|
|
135
|
+
/** LLM provider to use */
|
|
136
|
+
provider: CreateStreamBodyProvider;
|
|
137
|
+
/** Specific model to use (defaults to provider default) */
|
|
138
|
+
model?: string;
|
|
139
|
+
options?: CreateStreamBodyOptions;
|
|
140
|
+
/** Custom API key (uses environment variable if not provided) */
|
|
141
|
+
apiKey?: string;
|
|
71
142
|
};
|
|
72
143
|
export declare const getIntegrationsAPI: () => {
|
|
73
|
-
|
|
144
|
+
generateText: (generateTextBody: GenerateTextBody) => Promise<GenerateText200>;
|
|
145
|
+
createStream: (createStreamBody: CreateStreamBody) => Promise<string>;
|
|
74
146
|
};
|
|
75
|
-
export type
|
|
147
|
+
export type GenerateTextResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getIntegrationsAPI>['generateText']>>>;
|
|
148
|
+
export type CreateStreamResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getIntegrationsAPI>['createStream']>>>;
|
|
76
149
|
//# sourceMappingURL=generated-api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generated-api.d.ts","sourceRoot":"","sources":["../src/generated-api.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"generated-api.d.ts","sourceRoot":"","sources":["../src/generated-api.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,MAAM,gCAAgC,GAAG,OAAO,gCAAgC,CAAC,MAAM,OAAO,gCAAgC,CAAC,CAAC;AAItI,eAAO,MAAM,gCAAgC;;;;CAInC,CAAC;AAEX,MAAM,MAAM,4BAA4B,GAAG;IACzC,iCAAiC;IACjC,IAAI,EAAE,gCAAgC,CAAC;IACvC,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,wB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C;IACjC,IAAI,EAAE,gCAAgC,CAAC;IACvC,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,OAAO,wBAAwB,CAAC,MAAM,OAAO,wBAAwB,CAAC,CAAC;AAI9G,eAAO,MAAM,wBAAwB;;;;CAI3B,CAAC;AAEX,MAAM,MAAM,uBAAuB,GAAG;IACpC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,QAAQ,EAAE,4BAA4B,EAAE,CAAC;IACzC,0BAA0B;IAC1B,QAAQ,EAAE,wBAAwB,CAAC;IACnC,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,uBAAuB,CAAC;IAClC,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,kBAAkB;qCAKT,gBAAgB;qCAchB,gBAAgB;CAUH,CAAC;AACpC,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;AACxH,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA"}
|
package/dist/generated-api.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getIntegrationsAPI = exports.
|
|
3
|
+
exports.getIntegrationsAPI = exports.CreateStreamBodyProvider = exports.CreateStreamBodyMessagesItemRole = exports.GenerateTextBodyProvider = exports.GenerateTextBodyMessagesItemRole = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Generated by orval v7.21.0 🍺
|
|
6
6
|
* Do not edit manually.
|
|
@@ -10,28 +10,49 @@ exports.getIntegrationsAPI = exports.GenerateBodyProvider = exports.GenerateBody
|
|
|
10
10
|
*/
|
|
11
11
|
const http_client_1 = require("./http-client");
|
|
12
12
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
13
|
-
exports.
|
|
13
|
+
exports.GenerateTextBodyMessagesItemRole = {
|
|
14
14
|
user: 'user',
|
|
15
15
|
assistant: 'assistant',
|
|
16
16
|
system: 'system',
|
|
17
17
|
};
|
|
18
18
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
19
|
-
exports.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
exports.GenerateTextBodyProvider = {
|
|
20
|
+
Anthropic: 'Anthropic',
|
|
21
|
+
OpenAI: 'OpenAI',
|
|
22
|
+
Gemini: 'Gemini',
|
|
23
|
+
};
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
25
|
+
exports.CreateStreamBodyMessagesItemRole = {
|
|
26
|
+
user: 'user',
|
|
27
|
+
assistant: 'assistant',
|
|
28
|
+
system: 'system',
|
|
29
|
+
};
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
31
|
+
exports.CreateStreamBodyProvider = {
|
|
32
|
+
Anthropic: 'Anthropic',
|
|
33
|
+
OpenAI: 'OpenAI',
|
|
34
|
+
Gemini: 'Gemini',
|
|
23
35
|
};
|
|
24
36
|
const getIntegrationsAPI = () => {
|
|
25
37
|
/**
|
|
26
38
|
* @summary Chat with LLM
|
|
27
39
|
*/
|
|
28
|
-
const
|
|
29
|
-
return (0, http_client_1.customAxios)({ url: `/llm/
|
|
40
|
+
const generateText = (generateTextBody) => {
|
|
41
|
+
return (0, http_client_1.customAxios)({ url: `/llm/generateText`, method: 'POST',
|
|
42
|
+
headers: { 'Content-Type': 'application/json', },
|
|
43
|
+
data: generateTextBody
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* @summary Create a stream with LLM
|
|
48
|
+
*/
|
|
49
|
+
const createStream = (createStreamBody) => {
|
|
50
|
+
return (0, http_client_1.customAxios)({ url: `/llm/createStream`, method: 'POST',
|
|
30
51
|
headers: { 'Content-Type': 'application/json', },
|
|
31
|
-
data:
|
|
52
|
+
data: createStreamBody
|
|
32
53
|
});
|
|
33
54
|
};
|
|
34
|
-
return {
|
|
55
|
+
return { generateText, createStream };
|
|
35
56
|
};
|
|
36
57
|
exports.getIntegrationsAPI = getIntegrationsAPI;
|
|
37
58
|
//# sourceMappingURL=generated-api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generated-api.js","sourceRoot":"","sources":["../src/generated-api.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,+CAA4C;AAO5C,2DAA2D;AAC9C,QAAA,
|
|
1
|
+
{"version":3,"file":"generated-api.js","sourceRoot":"","sources":["../src/generated-api.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,+CAA4C;AAO5C,2DAA2D;AAC9C,QAAA,gCAAgC,GAAG;IAC9C,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,QAAQ;CACR,CAAC;AAeX,2DAA2D;AAC9C,QAAA,wBAAwB,GAAG;IACtC,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;CACR,CAAC;AAyEX,2DAA2D;AAC9C,QAAA,gCAAgC,GAAG;IAC9C,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,QAAQ;CACR,CAAC;AAeX,2DAA2D;AAC9C,QAAA,wBAAwB,GAAG;IACtC,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;CACR,CAAC;AAsCJ,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACvC;;OAEG;IACH,MAAM,YAAY,GAAG,CACjB,gBAAkC,EACnC,EAAE;QACC,OAAO,IAAA,yBAAW,EAClB,EAAC,GAAG,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM;YACzC,OAAO,EAAE,EAAC,cAAc,EAAE,kBAAkB,GAAG;YAC/C,IAAI,EAAE,gBAAgB;SACvB,CACE,CAAC;IACJ,CAAC,CAAA;IAEL;;OAEG;IACH,MAAM,YAAY,GAAG,CACjB,gBAAkC,EACnC,EAAE;QACC,OAAO,IAAA,yBAAW,EAClB,EAAC,GAAG,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM;YACzC,OAAO,EAAE,EAAC,cAAc,EAAE,kBAAkB,GAAG;YAC/C,IAAI,EAAE,gBAAgB;SACvB,CACE,CAAC;IACJ,CAAC,CAAA;IAEL,OAAO,EAAC,YAAY,EAAC,YAAY,EAAC,CAAA;AAAA,CAAC,CAAC;AA7BvB,QAAA,kBAAkB,sBA6BK"}
|
package/dist/index.d.ts
CHANGED
|
@@ -17,13 +17,14 @@ export declare class Llm {
|
|
|
17
17
|
provider?: string;
|
|
18
18
|
});
|
|
19
19
|
private withContext;
|
|
20
|
-
|
|
20
|
+
generateText: (...args: Parameters<typeof this.api.generateText>) => Promise<import("./generated-api").GenerateText200>;
|
|
21
|
+
createStream: (...args: Parameters<typeof this.api.createStream>) => Promise<string>;
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
24
|
* Default llm instance - ready to use with env vars
|
|
24
25
|
* @example
|
|
25
26
|
* import { llm } from 'uptiq-integration';
|
|
26
|
-
* await llm.
|
|
27
|
+
* await llm.generateText({ ... });
|
|
27
28
|
*/
|
|
28
29
|
export declare const llm: Llm;
|
|
29
30
|
export * from './generated-api';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AAEH;;GAEG;AACH,qBAAa,GAAG;IACd,OAAO,CAAC,MAAM,CAES;IACvB,OAAO,CAAC,GAAG,CAAwC;gBAEvC,OAAO,CAAC,EAAE;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB;IAaD,OAAO,CAAC,WAAW;IAInB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AAEH;;GAEG;AACH,qBAAa,GAAG;IACd,OAAO,CAAC,MAAM,CAES;IACvB,OAAO,CAAC,GAAG,CAAwC;gBAEvC,OAAO,CAAC,EAAE;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB;IAaD,OAAO,CAAC,WAAW;IAInB,YAAY,GAAI,GAAG,MAAM,UAAU,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,wDACR;IAEzD,YAAY,GAAI,GAAG,MAAM,UAAU,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,qBACR;CAC1D;AAED;;;;;GAKG;AACH,eAAO,MAAM,GAAG,KAAY,CAAC;AAG7B,cAAc,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -28,11 +28,8 @@ const http_client_1 = require("./http-client");
|
|
|
28
28
|
*/
|
|
29
29
|
class Llm {
|
|
30
30
|
constructor(options) {
|
|
31
|
-
this.
|
|
32
|
-
|
|
33
|
-
...(args[0].model || this.config.modelId ? { model: args[0].model || this.config.modelId } : {}),
|
|
34
|
-
...(args[0].provider || this.config.provider ? { provider: args[0].provider || this.config.provider } : {})
|
|
35
|
-
}));
|
|
31
|
+
this.generateText = (...args) => this.withContext(() => this.api.generateText(...args));
|
|
32
|
+
this.createStream = (...args) => this.withContext(() => this.api.createStream(...args));
|
|
36
33
|
// Store config for this instance (uses env vars if not provided)
|
|
37
34
|
this.config = {
|
|
38
35
|
...(options?.accessKey ? { accessKey: options.accessKey } : {}),
|
|
@@ -53,7 +50,7 @@ exports.Llm = Llm;
|
|
|
53
50
|
* Default llm instance - ready to use with env vars
|
|
54
51
|
* @example
|
|
55
52
|
* import { llm } from 'uptiq-integration';
|
|
56
|
-
* await llm.
|
|
53
|
+
* await llm.generateText({ ... });
|
|
57
54
|
*/
|
|
58
55
|
exports.llm = new Llm();
|
|
59
56
|
// Re-export all types from generated API
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mDAAqD;AACrD,+CAA2C;AAE3C;;;;;GAKG;AAEH;;GAEG;AACH,MAAa,GAAG;IAMd,YAAY,OAKX;QAiBD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mDAAqD;AACrD,+CAA2C;AAE3C;;;;;GAKG;AAEH;;GAEG;AACH,MAAa,GAAG;IAMd,YAAY,OAKX;QAiBD,iBAAY,GAAG,CAAC,GAAG,IAA8C,EAAE,EAAE,CACnE,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;QAEzD,iBAAY,GAAG,CAAC,GAAG,IAA8C,EAAE,EAAE,CACnE,IAAI,CAAC,WAAW,CAAC,GAAG,E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