Bug fix: Unwrap final_answer in Gradio_UI

#413
by m-bano - opened

There is a bug in Gradio_UI.py: line 157 calls handle_agent_output_types(final_answer), but this function does not unwrap final_answer (which can contain an AgentText, an AgentImage, an AgentAudio or another object). Since this object is never unwrapped from final_answer, the checks in lines 159 - 173 all fail. This means whatever is inside final_answer just gets output as a string (instead of an image, audio file, etc.). This fix exposes the contents of final_answer and lets Gradio handle them appropriately.

m-bano changed pull request status to closed
m-bano changed pull request status to open
m-bano changed pull request title from Unwrap final_answer in Gradio_UI to Bug fix: Unwrap final_answer in Gradio_UI
Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment