Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ load_dotenv()
|
|
10 |
|
11 |
# Initialize ComposioToolSet and OpenAI LLM
|
12 |
toolset = ComposioToolSet(api_key=os.getenv('COMPOSIO_API_KEY'))
|
13 |
-
tools = toolset.get_tools(apps=[App.
|
14 |
|
15 |
llm = OpenAI(model="gpt-4o", api_key=os.getenv('OPENAI_API_KEY'))
|
16 |
|
@@ -20,9 +20,9 @@ prefix_messages = [
|
|
20 |
role="system",
|
21 |
content=(
|
22 |
f"""
|
23 |
-
You are a
|
24 |
Be extremely creative and funny about it.
|
25 |
-
Create a personalized "
|
26 |
Generate the output in a structured JSON format that can be easily parsed programmatically. Include fields that you deem necessary be creative.
|
27 |
Use the tools you have to get the info
|
28 |
"""
|
@@ -42,20 +42,20 @@ agent = FunctionCallingAgentWorker(
|
|
42 |
|
43 |
def generate_wrapped(username):
|
44 |
"""
|
45 |
-
Function to generate a "
|
46 |
"""
|
47 |
-
user_input = f"Create a
|
48 |
response = agent.chat(user_input)
|
49 |
return response
|
50 |
|
51 |
# Create Gradio interface
|
52 |
with gr.Blocks() as demo:
|
53 |
-
gr.Markdown("""###
|
54 |
-
Enter a
|
55 |
""")
|
56 |
|
57 |
-
username_input = gr.Textbox(label="
|
58 |
-
output = gr.Textbox(label="Output", placeholder="Your
|
59 |
|
60 |
generate_button = gr.Button("Generate Wrapped")
|
61 |
|
|
|
10 |
|
11 |
# Initialize ComposioToolSet and OpenAI LLM
|
12 |
toolset = ComposioToolSet(api_key=os.getenv('COMPOSIO_API_KEY'))
|
13 |
+
tools = toolset.get_tools(apps=[App.GOOGLECALENDAR])
|
14 |
|
15 |
llm = OpenAI(model="gpt-4o", api_key=os.getenv('OPENAI_API_KEY'))
|
16 |
|
|
|
20 |
role="system",
|
21 |
content=(
|
22 |
f"""
|
23 |
+
You are a GOOGLE CALENDAR wrapped generator. Based on the GOOGLE CALENDAR username provided, analyze the user's profile, recent tweets, and engagement data.
|
24 |
Be extremely creative and funny about it.
|
25 |
+
Create a personalized "GOOGLE CALENDAR Wrapped" summary highlighting their key insights.
|
26 |
Generate the output in a structured JSON format that can be easily parsed programmatically. Include fields that you deem necessary be creative.
|
27 |
Use the tools you have to get the info
|
28 |
"""
|
|
|
42 |
|
43 |
def generate_wrapped(username):
|
44 |
"""
|
45 |
+
Function to generate a "GOOGLE CALENDAR Wrapped" summary based on the GOOGLE CALENDAR username provided by the user.
|
46 |
"""
|
47 |
+
user_input = f"Create a GOOGLE CALENDAR Wrapped summary for the username: {username}"
|
48 |
response = agent.chat(user_input)
|
49 |
return response
|
50 |
|
51 |
# Create Gradio interface
|
52 |
with gr.Blocks() as demo:
|
53 |
+
gr.Markdown("""### GOOGLE CALENDAR Wrapped Generator
|
54 |
+
Enter a GOOGLE CALENDAR username below to generate your personalized GOOGLE CALENDAR Wrapped summary.
|
55 |
""")
|
56 |
|
57 |
+
username_input = gr.Textbox(label="GOOGLE CALENDAR Username", placeholder="e.g., elonmusk")
|
58 |
+
output = gr.Textbox(label="Output", placeholder="Your GOOGLE CALENDAR Wrapped summary and Google Sheet link will appear here.", lines=10)
|
59 |
|
60 |
generate_button = gr.Button("Generate Wrapped")
|
61 |
|