Spaces:
Runtime error
Runtime error
| import google.generativeai as genai | |
| import streamlit as st | |
| import os | |
| import json | |
| import random | |
| # from getvalues import getValues | |
| from datetime import datetime, timedelta | |
| import uuid | |
| import re | |
| # Set your API key | |
| # Or use `os.getenv('GOOGLE_API_KEY')` to fetch an environment variable. | |
| GOOGLE_API_KEY="AIzaSyCwSszcd45k1Ce0B48oiQnYPRdTLh49kg8" | |
| genai.configure(api_key=GOOGLE_API_KEY) | |
| model = genai.GenerativeModel('gemini-pro') | |
| # Generate text | |
| if prompt := st.chat_input("Hi"): | |
| enprom = f""" | |
| Act as a personal assistant, Understand user intent from the point of view for creating a goal. ask to know more details about the goal. | |
| show your suggestions of routines or tasks which will help to achieve the goal as a table of 3 column of Task title, with time to invest, and repetation frequency. | |
| Follow all the above instruction for this given input:- {prompt}""" | |
| completion = model.generate_content(enprom) | |
| with st.chat_message("Assistant"): | |
| st.write(completetion.text) | |