generated from MLH-Fellowship/orientation-project-python
-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into delete_existing_skill
- Loading branch information
Showing
7 changed files
with
265 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
.venv | ||
.pytest_cache/ | ||
__pycache__ | ||
.vscode | ||
.vscode | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
|
||
from openai import OpenAI | ||
import os | ||
from dotenv import load_dotenv | ||
from models import Experience, Education | ||
load_dotenv() | ||
|
||
client = OpenAI( | ||
api_key=os.getenv("OPENAI_API_KEY") | ||
) | ||
|
||
def get_improvement(model : Experience | Education): | ||
prompt = f"Improve the following description for the {model.__class__.__name__}: {model.description}" | ||
|
||
response = client.chat.completions.create( | ||
model="gpt-4o-mini", | ||
messages=[ | ||
{"role": "system", "content": "You are a helpful assistant that improves descriptions for resumes."}, | ||
{"role": "assistant", "content": "Here is the improved description:"}, | ||
{"role": "system", "content": f"Consider the following information about the {model.__class__.__name__}: {model.model_dump_json()}"}, | ||
{"role": "user", "content": prompt}, | ||
] | ||
) | ||
try: | ||
return response.choices[0].message.content | ||
except: | ||
return None | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
""" | ||
Module for spell checking functionality using autocorrect library. | ||
""" | ||
|
||
from autocorrect import Speller | ||
|
||
spell = Speller(lang='en') | ||
|
||
def spell_check(text): | ||
''' | ||
Spell checks the text | ||
''' | ||
return spell(text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.