Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR Copy Button On Response #8

Open
se4n01 opened this issue Mar 28, 2024 · 1 comment
Open

FR Copy Button On Response #8

se4n01 opened this issue Mar 28, 2024 · 1 comment

Comments

@se4n01
Copy link

se4n01 commented Mar 28, 2024

Hello,
It would be nice to have a copy button I had a look at this which seemed promising but I could not get it to work, I dont know where to insert it exactly into the code for the bot response.

https://github.com/everydaydigital/streamlit-custom-copy-buttons

Essentially it boils down to adding the

st.markdown(f'<iframe style="overflow: hidden;" src="{iframe_url}"></iframe>', unsafe_allow_html=True)

To the right place. A hint at to where that right place is and I can already submit a PR for your perusal

Best wishes,

Sean

@ryo-ma
Copy link
Owner

ryo-ma commented Mar 28, 2024

The following part is the code that displays the response from the Assistant.

with st.chat_message("Assistant"):
st.markdown(
input_code,
True,
)

with st.chat_message("Assistant"):
st.markdown(response, True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants