Hi, I have a python cloud function with dir structure
Code snippet is
TypeScript
@app.post("/process")
async def process_cv(
user_id: str = Query(..., description="The ID of the user whose CV to process")
):
"""API endpoint to process the uploaded CV, extract information, and update the user profile."""
try:
cv_file_info = supabase.storage.from_("span").list(f"resumes/{user_id}")
if not cv_file_info or len(cv_file_info) == 0:
raise HTTPException(
status_code=404, detail="CV not found for the specified user"
)
cv_file_name = cv_file_info[0]["name"]
cv_download = supabase.storage.from_("span").download(
f"resumes/{user_id}/{cv_file_name}"
)
pdf_text = extract_text_from_pdf(cv_download)
print("Extracted PDF text:", pdf_text)
user_profile_data = extract_profile_info(pdf_text)
print("Extracted user profile data:", json.dumps(user_profile_data, indent=2))
return update_user_profile(user_id, user_profile_data[0])
except Exception as e:
raise HTTPException(status_code=500, detail=f"Error processing CV: {str(e)}")
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=9092)
I set the build command for pip install from requirements.txt but what must I set the entry point as under Configuration?
TL;DR
The entrypoint for the Python cloud function code snippet provided should be set as `python -m your_script.main:app` under Configuration.Recommended threads
- RowList: The value of total is coming as...
RowList: The value of total is coming as a String, so it throws an error because it’s not parsed into an int. Error: TypeError: \"37\": type 'String' is not a ...
- 408 Timeout / Curl Error 7 in Executor w...
Hey everyone, I am losing my mind over a routing loop/timeout issue on a fresh self-hosted setup. I have a single Linux VPS (IP: 45.141.37.105) and one domain (...
- functions returning error 401 in local
I updated to 1.9.0, and the functions that used to work fine in 1.8.1 are now giving me a 401 error. I can't seem to find a solution. If anyone is running versi...