Skip to content

Commit a0910d3

Browse files
committed
refactor(stream): fix dto
1 parent a640ad4 commit a0910d3

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/wizard/stream.service.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -300,19 +300,22 @@ export class StreamService {
300300
subscriber,
301301
);
302302

303+
const tools = (requestDto.tools || []).map((tool) => {
304+
if (tool.name === 'private_search') {
305+
return {
306+
...tool,
307+
namespace_id: namespaceId,
308+
} as WizardPrivateSearchToolDto;
309+
}
310+
return tool;
311+
});
312+
303313
const wizardRequest: WizardAgentRequestDto = {
304314
namespace_id: namespaceId,
305315
conversation_id: requestDto.conversation_id,
306316
query: requestDto.query,
307317
messages,
308-
tools: requestDto.tools.map((tool) =>
309-
tool.name === 'private_search'
310-
? ({
311-
...tool,
312-
namespace_id: namespaceId,
313-
} as WizardPrivateSearchToolDto)
314-
: tool,
315-
),
318+
tools,
316319
enable_thinking: requestDto.enable_thinking,
317320
lang: requestDto.lang,
318321
};

0 commit comments

Comments
 (0)