@rws-framework/ai-tools 3.2.5 → 3.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.
package/package.json
CHANGED
|
@@ -36,8 +36,7 @@ export class InputOutputManager {
|
|
|
36
36
|
readInput(): CompoundInput[] {
|
|
37
37
|
const enchantedInput: CompoundInput[] = this.enhancedInput.map(enchantment => ({
|
|
38
38
|
role: enchantment.input.role || 'user',
|
|
39
|
-
|
|
40
|
-
text: enchantment.input.text
|
|
39
|
+
content: enchantment.input.content
|
|
41
40
|
}));
|
|
42
41
|
|
|
43
42
|
return [...enchantedInput, ...this.input];
|
|
@@ -87,7 +86,13 @@ export class InputOutputManager {
|
|
|
87
86
|
if (callback) {
|
|
88
87
|
callback(messages, prompt);
|
|
89
88
|
} else {
|
|
90
|
-
this.input = [{
|
|
89
|
+
this.input = [{
|
|
90
|
+
role: 'user',
|
|
91
|
+
content: {
|
|
92
|
+
type: 'text',
|
|
93
|
+
text: prompt
|
|
94
|
+
}
|
|
95
|
+
}, ...this.input];
|
|
91
96
|
}
|
|
92
97
|
}
|
|
93
98
|
|
package/src/types/IPrompt.ts
CHANGED
|
@@ -128,15 +128,18 @@ interface IRWSPromptJSON {
|
|
|
128
128
|
|
|
129
129
|
type ChainStreamType = AsyncGenerator<IterableReadableStream<ChainValues>>;
|
|
130
130
|
|
|
131
|
-
interface
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
interface CompoundInputContent{
|
|
132
|
+
text?: string,
|
|
133
|
+
type: InputType,
|
|
134
|
+
source?: {
|
|
135
|
+
media_type: string,
|
|
136
|
+
data: string
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
interface CompoundInput {
|
|
134
141
|
role?: 'user' | 'assistant' | 'system',
|
|
135
|
-
|
|
136
|
-
type: string,
|
|
137
|
-
media_type: string,
|
|
138
|
-
data: string
|
|
139
|
-
}
|
|
142
|
+
content: CompoundInputContent | CompoundInputContent[],
|
|
140
143
|
}
|
|
141
144
|
|
|
142
145
|
export {
|
|
@@ -161,6 +164,7 @@ export {
|
|
|
161
164
|
IRWSHistoryMessage,
|
|
162
165
|
InputType,
|
|
163
166
|
CompoundInput,
|
|
167
|
+
CompoundInputContent,
|
|
164
168
|
IToolCall,
|
|
165
169
|
ToolHandler
|
|
166
170
|
};
|