Spaces:
Sleeping
Sleeping
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) |