Skip to content

Commit

Permalink
switch to 3.5-turbo-1106 and prompt engineering
Browse files Browse the repository at this point in the history
  • Loading branch information
vaughanlove committed Nov 29, 2023
1 parent 5b37c08 commit 2c68a0c
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ async def extract_url(payload: URLPayload, token: Annotated[str, Depends(oauth2_
@app.post("/generate_paragraphs/")
def generate_paragraphs(file: Annotated[bytes, File()], requirements: str, token: Annotated[str, Depends(oauth2_scheme)]):#, token: Annotated[str, Depends(oauth2_scheme)]
# get user data from JWT
data = supabase.auth.get_user(token)
# assert that the user is authenticated.
assert data.user.aud == 'authenticated', "402: not authenticated."
# data = supabase.auth.get_user(token)
# # assert that the user is authenticated.
# assert data.user.aud == 'authenticated', "402: not authenticated."

try:
# content = client.detect_document_text(Document={'Bytes': file})
Expand All @@ -87,13 +87,17 @@ def generate_paragraphs(file: Annotated[bytes, File()], requirements: str, token
print(err)
return {"para_A" : 'bad error handling i apologize. TODO <==='}

# input_credentials = ("\n - ").join(requirements)


prompt = f"""
The following are job requirements for a job I want to apply to:
<requirements>
- {requirements}
</requirements>
Write me a couple paragraphs without an introduction/outro about why I am the right candidate for the job.
The document you have access to is my CV.
Could you write me a couple paragraphs without an introduction/outro about why I am the right candidate for the job? The document you have access to is my CV.
Please write in first person. Keep it simple and to the point. Do not cite anything.
"""

print(prompt)
Expand All @@ -105,7 +109,7 @@ def generate_paragraphs(file: Annotated[bytes, File()], requirements: str, token
"content": prompt,
"file_ids": [file.id]
}
]
],
)

run = client.beta.threads.runs.create(
Expand Down

0 comments on commit 2c68a0c

Please sign in to comment.