@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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rws-framework/ai-tools",
3
3
  "private": false,
4
- "version": "3.2.5",
4
+ "version": "3.3.0",
5
5
  "description": "",
6
6
  "main": "src/index.ts",
7
7
  "scripts": {},
@@ -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
- type: enchantment.input.type,
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 = [{ type: 'text', text: prompt }, ...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
 
@@ -128,15 +128,18 @@ interface IRWSPromptJSON {
128
128
 
129
129
  type ChainStreamType = AsyncGenerator<IterableReadableStream<ChainValues>>;
130
130
 
131
- interface CompoundInput {
132
- type: InputType,
133
- text?: string,
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
- source?: {
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
  };