Do not await sync callback managers (#3440)

This fixes a bug in the math LLM, where even the sync manager was
awaited, creating a nasty `RuntimeError`
fix_agent_callbacks
Bilal Mahmoud 1 year ago committed by GitHub
parent 0cf934ce7d
commit f22b9d0e57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -106,8 +106,8 @@ class LLMMathChain(Chain):
output, color="yellow", verbose=self.verbose
)
else:
await self.callback_manager.on_text("\nAnswer: ", verbose=self.verbose)
await self.callback_manager.on_text(
self.callback_manager.on_text("\nAnswer: ", verbose=self.verbose)
self.callback_manager.on_text(
output, color="yellow", verbose=self.verbose
)
answer = "Answer: " + output

Loading…
Cancel
Save