Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,10 +7,14 @@ from datetime import datetime
|
|
7 |
import time
|
8 |
|
9 |
# Initialize Groq client
|
|
|
|
|
10 |
@st.cache_resource
|
11 |
def get_groq_client():
|
12 |
return Groq(api_key=st.secrets["groq_api_key"])
|
13 |
|
|
|
|
|
14 |
class ContentAnalysisAgent:
|
15 |
def __init__(self):
|
16 |
"""Initialize the agent with Groq client"""
|
@@ -43,6 +47,8 @@ class ContentAnalysisAgent:
|
|
43 |
|
44 |
POST: {text}
|
45 |
|
|
|
|
|
46 |
Think through the following aspects:
|
47 |
|
48 |
1. CONTENT STRUCTURE ANALYSIS
|
@@ -65,11 +71,14 @@ Think through the following aspects:
|
|
65 |
- Identify emotional undertones
|
66 |
- Evaluate brand voice consistency
|
67 |
|
|
|
68 |
5. OPTIMIZATION OPPORTUNITIES
|
69 |
- Identify areas for improvement
|
70 |
- Suggest engagement boosters
|
71 |
- Note potential risks or concerns
|
72 |
|
|
|
|
|
73 |
Return a JSON structured response with:
|
74 |
{
|
75 |
"style": "primary posting style",
|
@@ -100,6 +109,8 @@ Return a JSON structured response with:
|
|
100 |
|
101 |
if not analysis_response:
|
102 |
return None
|
|
|
|
|
103 |
|
104 |
# Parse JSON response
|
105 |
try:
|
|
|
7 |
import time
|
8 |
|
9 |
# Initialize Groq client
|
10 |
+
|
11 |
+
|
12 |
@st.cache_resource
|
13 |
def get_groq_client():
|
14 |
return Groq(api_key=st.secrets["groq_api_key"])
|
15 |
|
16 |
+
|
17 |
+
|
18 |
class ContentAnalysisAgent:
|
19 |
def __init__(self):
|
20 |
"""Initialize the agent with Groq client"""
|
|
|
47 |
|
48 |
POST: {text}
|
49 |
|
50 |
+
|
51 |
+
|
52 |
Think through the following aspects:
|
53 |
|
54 |
1. CONTENT STRUCTURE ANALYSIS
|
|
|
71 |
- Identify emotional undertones
|
72 |
- Evaluate brand voice consistency
|
73 |
|
74 |
+
|
75 |
5. OPTIMIZATION OPPORTUNITIES
|
76 |
- Identify areas for improvement
|
77 |
- Suggest engagement boosters
|
78 |
- Note potential risks or concerns
|
79 |
|
80 |
+
|
81 |
+
|
82 |
Return a JSON structured response with:
|
83 |
{
|
84 |
"style": "primary posting style",
|
|
|
109 |
|
110 |
if not analysis_response:
|
111 |
return None
|
112 |
+
|
113 |
+
|
114 |
|
115 |
# Parse JSON response
|
116 |
try:
|