Replies: 2 comments 3 replies
-
🤖 Hey there, @ahadanjum! Nice to see you tackling new challenges. How's everything going on your end? Based on your code and the context provided, it seems like you're already on the right track with using Currently, the agent might be using As for preventing the code from being returned in the chat, you might need to modify the agent's output handling. If the agent is currently returning the code as part of its output, you could add a step in your Regarding your question about other frontend options, both Javascript and React could potentially be used to create a more interactive chat interface. However, this would likely require a significant amount of additional development and might not be necessary if you're able to achieve your desired functionality with Streamlit. As for how the agent generates Plotly graphs within a Jupyter Notebook environment, it's likely that the agent is able to do this because Jupyter Notebooks have built-in support for interactive outputs, including Plotly graphs. In a Jupyter Notebook, the agent can simply use I hope this helps! If you have any further questions or need more clarification, please let me know. Sources
|
Beta Was this translation helpful? Give feedback.
-
I have solved this problem by writing a tool. Here is the code snippet.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
I have a create_pandas_dataframe_agent running on a streamlit application that reads 3 pandas dataframes and answers questions about the data. I want the agent to be able to display graphs in the chat as well. Currently when the agent is asked to produce a graph, it either opens it up in a new tab on my browser, displays the code in the output, or does both. From either of the three options, based on my code above, I extract the python code the agent has written and change the fig.show() line to be st.plotly_chart() and am able to get the graph in the chat window.
I want to know if there is a way for the agent to create these plotly graphs without it invoking and opening a new tab and without the code being returned in the chat itself. I haven't been able to find a solution online where this is possible. Within Jupyter Notebook, the agent can easily generate plotly graphs as it knows it is able to do so in that environment but in streamlit the agent can't. How can I get things to work like that with streamlit. If not streamlit, is there another frontend option such as Javascript or React that could work better?
System Info
System Information
Package Information
Packages not installed (Not Necessarily a Problem)
The following packages were not found:
Beta Was this translation helpful? Give feedback.
All reactions