File size: 451 Bytes
e460bb5
 
 
71ad11e
e460bb5
 
71ad11e
e460bb5
a91e5a1
71ad11e
e460bb5
5f28fdf
71ad11e
e460bb5
5f28fdf
 
 
 
 
4238098
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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))