Spaces:
Sleeping
Sleeping
File size: 600 Bytes
8fec317 56fd26b bb584ac 56fd26b 637892d 8fec317 637892d 8fec317 56fd26b 637892d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
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) |