Nikhil0987 commited on
Commit
42c1f9b
·
verified ·
1 Parent(s): b863fc8

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -0
app.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import google.generativeai as genai
2
+ import streamlit as st
3
+ import os
4
+ import json
5
+ import random
6
+ # from getvalues import getValues
7
+ from datetime import datetime, timedelta
8
+ import uuid
9
+ import re
10
+
11
+ # Set your API key
12
+ # Or use `os.getenv('GOOGLE_API_KEY')` to fetch an environment variable.
13
+ GOOGLE_API_KEY=os.getenv('PALM_KEY')
14
+
15
+ genai.configure(api_key=GOOGLE_API_KEY)
16
+ model = genai.GenerativeModel('gemini-pro')
17
+
18
+ # Generate text
19
+ if prompt := st.chat_input("Hi, explain me what goal you want to achieve."):
20
+ enprom = f"""
21
+ 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.
22
+ 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.
23
+ Follow all the above instruction for this given input:- {prompt}"""
24
+ completion = model.generate_content(enprom)