mirror of https://github.com/kortix-ai/suna.git
fix: Return async generator directly for non-streaming responses
This commit is contained in:
parent
bc7662a484
commit
7de2756b44
|
@ -325,16 +325,13 @@ Here are the XML tools available with examples:
|
||||||
return response_generator
|
return response_generator
|
||||||
else:
|
else:
|
||||||
logger.debug("Processing non-streaming response")
|
logger.debug("Processing non-streaming response")
|
||||||
try:
|
# Return the async generator directly, don't await it
|
||||||
response = await self.response_processor.process_non_streaming_response(
|
response_generator = self.response_processor.process_non_streaming_response(
|
||||||
llm_response=llm_response,
|
llm_response=llm_response,
|
||||||
thread_id=thread_id,
|
thread_id=thread_id,
|
||||||
config=processor_config
|
config=processor_config
|
||||||
)
|
)
|
||||||
return response
|
return response_generator # Return the generator
|
||||||
except Exception as e:
|
|
||||||
logger.error(f"Error in non-streaming response: {str(e)}", exc_info=True)
|
|
||||||
raise
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error in run_thread: {str(e)}", exc_info=True)
|
logger.error(f"Error in run_thread: {str(e)}", exc_info=True)
|
||||||
|
|
Loading…
Reference in New Issue