mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-07-05 04:01:31 +02:00
update for typing
This commit is contained in:
@ -204,11 +204,8 @@ class Answer:
|
|||||||
]:
|
]:
|
||||||
tool_calls = 0
|
tool_calls = 0
|
||||||
initiated = False
|
initiated = False
|
||||||
forced_tool_use = (
|
|
||||||
self.force_use_tool.force_use and self.force_use_tool.args is not None
|
|
||||||
)
|
|
||||||
|
|
||||||
while tool_calls < (1 if forced_tool_use else MAX_TOOL_CALLS):
|
while tool_calls < (1 if self.force_use_tool.force_use else MAX_TOOL_CALLS):
|
||||||
if initiated:
|
if initiated:
|
||||||
yield StreamStopInfo(stop_reason=StreamStopReason.NEW_RESPONSE)
|
yield StreamStopInfo(stop_reason=StreamStopReason.NEW_RESPONSE)
|
||||||
initiated = True
|
initiated = True
|
||||||
@ -217,7 +214,7 @@ class Answer:
|
|||||||
|
|
||||||
tool_call_chunk: AIMessageChunk | None = None
|
tool_call_chunk: AIMessageChunk | None = None
|
||||||
|
|
||||||
if forced_tool_use:
|
if self.force_use_tool.force_use and self.force_use_tool.args is not None:
|
||||||
tool_call_chunk = AIMessageChunk(content="")
|
tool_call_chunk = AIMessageChunk(content="")
|
||||||
tool_call_chunk.tool_calls = [
|
tool_call_chunk.tool_calls = [
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user