Skip to content

Commit fd77ac6

Browse files
committed
Add trim after removing think/thought tags to clean up whitespace
1 parent e3024f8 commit fd77ac6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎packages/vscode/src/utils/cleanup-api-response/cleanup-api-response.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ export const cleanup_api_response = (params: { content: string }): string => {
1010
if (content.startsWith('<think>')) {
1111
const end_index = content.indexOf('</think>')
1212
if (end_index != -1) {
13-
content = content.substring(end_index + '</think>'.length)
13+
content = content.substring(end_index + '</think>'.length).trim()
1414
}
1515
} else if (content.startsWith('<thought>')) {
1616
const end_index = content.indexOf('</thought>')
1717
if (end_index != -1) {
18-
content = content.substring(end_index + '</thought>'.length)
18+
content = content.substring(end_index + '</thought>'.length).trim()
1919
}
2020
}
2121

0 commit comments

Comments
 (0)