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 prompt = st.text_input("Write your message: ") completion = palm.generate_text(model=model, prompt=prompt, temperature=0.5, max_output_tokens=800) # Print the generated text st.write(completion.result)