mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 12:11:09 +00:00
Summarize tool call outputs using tool specific summarizers (#3745)
This commit is contained in:
parent
cdbe2fffd9
commit
23197151c2
9 changed files with 421 additions and 9 deletions
|
|
@ -128,6 +128,7 @@ describe('useReactToolScheduler in YOLO Mode', () => {
|
|||
(mockToolRequiresConfirmation.execute as Mock).mockResolvedValue({
|
||||
llmContent: expectedOutput,
|
||||
returnDisplay: 'YOLO Formatted tool output',
|
||||
summary: 'YOLO summary',
|
||||
} as ToolResult);
|
||||
|
||||
const { result } = renderSchedulerInYoloMode();
|
||||
|
|
@ -280,6 +281,7 @@ describe('useReactToolScheduler', () => {
|
|||
(mockTool.execute as Mock).mockResolvedValue({
|
||||
llmContent: 'Tool output',
|
||||
returnDisplay: 'Formatted tool output',
|
||||
summary: 'Formatted summary',
|
||||
} as ToolResult);
|
||||
(mockTool.shouldConfirmExecute as Mock).mockResolvedValue(null);
|
||||
|
||||
|
|
@ -442,6 +444,7 @@ describe('useReactToolScheduler', () => {
|
|||
(mockToolRequiresConfirmation.execute as Mock).mockResolvedValue({
|
||||
llmContent: expectedOutput,
|
||||
returnDisplay: 'Confirmed display',
|
||||
summary: 'Confirmed summary',
|
||||
} as ToolResult);
|
||||
|
||||
const { result } = renderScheduler();
|
||||
|
|
@ -608,6 +611,7 @@ describe('useReactToolScheduler', () => {
|
|||
resolveExecutePromise({
|
||||
llmContent: 'Final output',
|
||||
returnDisplay: 'Final display',
|
||||
summary: 'Final summary',
|
||||
} as ToolResult);
|
||||
});
|
||||
await act(async () => {
|
||||
|
|
@ -644,6 +648,7 @@ describe('useReactToolScheduler', () => {
|
|||
execute: vi.fn().mockResolvedValue({
|
||||
llmContent: 'Output 1',
|
||||
returnDisplay: 'Display 1',
|
||||
summary: 'Summary 1',
|
||||
} as ToolResult),
|
||||
shouldConfirmExecute: vi.fn().mockResolvedValue(null),
|
||||
};
|
||||
|
|
@ -654,6 +659,7 @@ describe('useReactToolScheduler', () => {
|
|||
execute: vi.fn().mockResolvedValue({
|
||||
llmContent: 'Output 2',
|
||||
returnDisplay: 'Display 2',
|
||||
summary: 'Summary 2',
|
||||
} as ToolResult),
|
||||
shouldConfirmExecute: vi.fn().mockResolvedValue(null),
|
||||
};
|
||||
|
|
@ -733,7 +739,12 @@ describe('useReactToolScheduler', () => {
|
|||
mockToolRegistry.getTool.mockReturnValue(mockTool);
|
||||
const longExecutePromise = new Promise<ToolResult>((resolve) =>
|
||||
setTimeout(
|
||||
() => resolve({ llmContent: 'done', returnDisplay: 'done display' }),
|
||||
() =>
|
||||
resolve({
|
||||
llmContent: 'done',
|
||||
returnDisplay: 'done display',
|
||||
summary: 'done summary',
|
||||
}),
|
||||
50,
|
||||
),
|
||||
);
|
||||
|
|
@ -814,6 +825,7 @@ describe('mapToDisplay', () => {
|
|||
} as PartUnion,
|
||||
],
|
||||
resultDisplay: 'Test display output',
|
||||
summary: 'Test summary',
|
||||
error: undefined,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue