-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_api.py
More file actions
28 lines (24 loc) · 880 Bytes
/
test_api.py
File metadata and controls
28 lines (24 loc) · 880 Bytes
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
import asyncio
from app.workflows.user_summary import UserSummaryWorkflow
async def test_api():
# Sample user data
user_data = {
"username": "test_user",
"bio": "Testing OpenAI API calls",
"recent_casts": ["This is a test cast"],
"interests": ["testing", "AI"],
"engagement_stats": {
"avg_replies": 1,
"avg_likes": 1,
"top_channels": ["test"]
}
}
workflow = UserSummaryWorkflow()
result = await workflow.run({"user_data": user_data})
print("\nAPI Call Results:")
print("----------------")
print("Keywords:", ", ".join(result["user_summary"]["keywords"]))
print("Raw Summary:", result["user_summary"]["raw_summary"])
print("Embedding Vector Size:", len(result["user_embedding"]["vector"]))
if __name__ == "__main__":
asyncio.run(test_api())