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

Turn this into a chat #12

Open
Sophon-0 opened this issue Oct 4, 2023 · 0 comments
Open

Turn this into a chat #12

Sophon-0 opened this issue Oct 4, 2023 · 0 comments

Comments

@Sophon-0
Copy link

Sophon-0 commented Oct 4, 2023

hello Jason
I tried to turn this into a chat:

`
def main():
st.set_page_config(page_title="search", page_icon=":eagle:")
st.header("search 🦅")

global agent  # Let the function know we're using the global version of agent
i = 0
continue_chat = True
while continue_chat:
    if i > 0:
        query = st.text_input("", key=f'text_input_{i}')
    else:
        query = st.text_input("What would you like to ask about ?", key=f'text_input_{i}')

    if query:
        result = agent({"input": query})
        st.info(result['output'])
        st.download_button('Download result', result['output'])

        # add another query here so we can continue to ask questions
        i += 1

    else:
        continue_chat = False

`

when I start this app, I type a question and get an answer. But when I continue the chat by typing a second question, they answer my first question again before answering the second question. So every time I type a new question, all previous get answered again.

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

1 participant