goof_hunk / app.py
BlitzenPrancer's picture
Update app.py
bb584ac
raw
history blame contribute delete
600 Bytes
import streamlit as st
from bardapi import Bard
token='ZAhLesJMfthLjEdF5uAJ2gS-Ohq59sjw502_Uy9VUB1dZ9PodIjVsTILT9tqXQaZ3r10MQ.'
bard = Bard(token=token)
# Initialise conversation history
convo_history = ""
# Create an empty placeholder
placeholder = st.empty()
# UI input: question
question = st.text_input('Enter your question here')
if question:
# UI output: answer
answer = bard.get_answer(question)['content']
# Update conversation history
convo_history += f"Question: {question}\nAnswer: {answer}\n---\n"
# Display conversation history
placeholder.text(convo_history)