GoalsAI / app.py
CosmoAI's picture
Update app.py
5f28fdf
raw
history blame
451 Bytes
import google.generativeai as palm
import streamlit as st
import os
# Set your API key
palm.configure(api_key=os.environ['PALM_KEY'])
# Select the PaLM 2 model
# model = 'models/text-bison-001'
# Generate text
response = palm.chat(messages=["Hello"])
# Print the generated text
st.chat_message(response.last)
if prompt := st.text_input("Write your message: "):
with st.chat_message("assistant"):
st.write(response.reply(prompt))