Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
feat: Adds user safeguard on compute
Browse files Browse the repository at this point in the history
  • Loading branch information
frgfm committed Nov 7, 2023
1 parent 6b49009 commit 1f8a2a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/api/api_v1/endpoints/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async def check_code_against_repo_guidelines(
# Fetch guidelines
guideline_list = [elt for elt in await guidelines.fetch_all(("repo_id", repo_id))]
# Run analysis
return openai_client.analyze_multi(payload.code, guideline_list, mode=ExecutionMode.MULTI)
return openai_client.analyze_multi(payload.code, guideline_list, mode=ExecutionMode.MULTI, user_id=str(user.id))


@router.post("/check/{guideline_id}", status_code=status.HTTP_200_OK)
Expand All @@ -47,4 +47,4 @@ async def check_code_against_guideline(
user.id, event="compute-check", properties={"repo_id": guideline.repo_id, "guideline_id": guideline_id}
)
# Run analysis
return openai_client.analyze_mono(payload.code, guideline)
return openai_client.analyze_mono(payload.code, guideline, user_id=str(user.id))

0 comments on commit 1f8a2a1

Please sign in to comment.