Skip to content

Conversation

liuzhiqi71
Copy link
Contributor

Bug Description

There is a SyntaxError in examples/streamlit/streamlit_chat.py when running the script, caused by unmatched parentheses in an f-string.

File

examples/streamlit/streamlit_chat.py

Error message

  File "examples/streamlit/streamlit_chat.py", line 176
    st.markdown(f"Called `{item.get("name")}`")
                                     ^
SyntaxError: f-string: unmatched '('

How to reproduce

Run the script with Python, for example, in a Jupyter notebook or with Streamlit, and you will encounter this error.

Solution

Change the inner double quotes to single quotes inside the f-string, like this:

st.markdown(f"Called `{item.get('name')}`")

This fixes the unmatched parentheses SyntaxError and allows the script to run properly.

@dkundel-openai dkundel-openai merged commit 53efd59 into openai:main Aug 14, 2025
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

Successfully merging this pull request may close these issues.

3 participants