Spaces:
Sleeping
Sleeping
changes
Browse files
app.py
CHANGED
@@ -360,11 +360,12 @@ async def get_customer_content_recommendations(customer_id: str, n: int = 5):
|
|
360 |
|
361 |
# Get content recommendations
|
362 |
recommendations = get_content_recommendations(customer_id, n)
|
363 |
-
|
364 |
return {
|
365 |
"customer_id": customer_id,
|
366 |
"profile_summary": profile_summary,
|
367 |
-
"recommendations": recommendations
|
|
|
368 |
}
|
369 |
|
370 |
except HTTPException:
|
@@ -710,9 +711,8 @@ async def get_financial_recommendations(customer_id: str):
|
|
710 |
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
711 |
detail=f"Error processing request: {str(e)}"
|
712 |
)
|
713 |
-
|
714 |
-
|
715 |
-
async def contentcreation(category:str):
|
716 |
inputdata = "Generate articles for "
|
717 |
inputdata += category +" in few words. Don't show the thinking part in the output"
|
718 |
completion = client.chat.completions.create(
|
@@ -730,3 +730,7 @@ async def contentcreation(category:str):
|
|
730 |
# Clean the complete response
|
731 |
cleaned_response = full_response.replace("<think>", "").replace("</think>", "").strip()
|
732 |
return(cleaned_response)
|
|
|
|
|
|
|
|
|
|
360 |
|
361 |
# Get content recommendations
|
362 |
recommendations = get_content_recommendations(customer_id, n)
|
363 |
+
cleaned_response= Get_contentDescription('Getting Started with Personal Finance')
|
364 |
return {
|
365 |
"customer_id": customer_id,
|
366 |
"profile_summary": profile_summary,
|
367 |
+
"recommendations": recommendations,
|
368 |
+
"AIContent":cleaned_response
|
369 |
}
|
370 |
|
371 |
except HTTPException:
|
|
|
711 |
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
712 |
detail=f"Error processing request: {str(e)}"
|
713 |
)
|
714 |
+
|
715 |
+
def Get_contentDescription(category:str):
|
|
|
716 |
inputdata = "Generate articles for "
|
717 |
inputdata += category +" in few words. Don't show the thinking part in the output"
|
718 |
completion = client.chat.completions.create(
|
|
|
730 |
# Clean the complete response
|
731 |
cleaned_response = full_response.replace("<think>", "").replace("</think>", "").strip()
|
732 |
return(cleaned_response)
|
733 |
+
@app.get("/contentcreation/{category}")
|
734 |
+
async def contentcreation(category:str):
|
735 |
+
cleaned_response= Get_contentDescription(category)
|
736 |
+
return(cleaned_response)
|