Skip to content

Commit da76592

Browse files
committed
feat: Include tool-result in chat
1 parent 528ef6d commit da76592

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

apps/studio/electron/main/chat/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ class LlmManager {
9696
headers: {
9797
'anthropic-beta': 'output-128k-2025-02-19',
9898
},
99+
onStepFinish: ({ toolResults }) => {
100+
for (const toolResult of toolResults) {
101+
this.emitMessagePart(toolResult);
102+
}
103+
},
99104
});
100105
const streamParts: TextStreamPart<ToolSet>[] = [];
101106
for await (const partialStream of fullStream) {

apps/studio/src/lib/editor/engine/chat/stream.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ export class StreamResolver {
5151
resolveToolCallPart(
5252
payload: TextStreamPart<ToolSet>,
5353
): TextPart | ToolCallPart | ToolResultPart | null {
54-
if (payload.type === 'tool-call') {
54+
// @ts-expect-error tool-result is included
55+
if (payload.type === 'tool-call' || payload.type === 'tool-result') {
5556
return payload;
5657
} else if (payload.type === 'text-delta') {
5758
const textPart = {

0 commit comments

Comments
 (0)