(
history: Content[],
{ stripThoughts = false }: { stripThoughts?: boolean } = {},
)
| 175 | } |
| 176 | |
| 177 | setHistory( |
| 178 | history: Content[], |
| 179 | { stripThoughts = false }: { stripThoughts?: boolean } = {}, |
| 180 | ) { |
| 181 | const historyToSet = stripThoughts |
| 182 | ? history.map((content) => { |
| 183 | const newContent = { ...content }; |
| 184 | if (newContent.parts) { |
| 185 | newContent.parts = newContent.parts.map((part) => { |
| 186 | if ( |
| 187 | part && |
| 188 | typeof part === 'object' && |
| 189 | 'thoughtSignature' in part |
| 190 | ) { |
| 191 | const newPart = { ...part }; |
| 192 | delete (newPart as { thoughtSignature?: string }) |
| 193 | .thoughtSignature; |
| 194 | return newPart; |
| 195 | } |
| 196 | return part; |
| 197 | }); |
| 198 | } |
| 199 | return newContent; |
| 200 | }) |
| 201 | : history; |
| 202 | this.getChat().setHistory(historyToSet); |
| 203 | this.forceFullIdeContext = true; |
| 204 | } |
| 205 | |
| 206 | async setTools(): Promise<void> { |
| 207 | const toolRegistry = await this.config.getToolRegistry(); |
no test coverage detected