File size: 1,294 Bytes
f31fa55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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'

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=os.getenv('PALM_KEY')

genai.configure(api_key=GOOGLE_API_KEY)
model = genai.GenerativeModel('gemini-pro')

# Generate text
if prompt := st.chat_input("Hi, explain me what goal you want to achieve."):
    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)

response = palm.chat(messages=["Hello."])
print(response.last) #  'Hello! What can I help you with?' 
response.reply("Can you tell me a joke?")