Skip to content

Commit

Permalink
fix: fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
citruscai committed Oct 3, 2024
1 parent f5c2024 commit 31c83e7
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 52 deletions.
89 changes: 46 additions & 43 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'''
"""
Flask Application
'''
"""

from flask import Flask, jsonify, request
from models import Experience, Education, Skill
from utils import get_suggestion
Expand All @@ -9,86 +10,88 @@

data = {
"experience": [
Experience("Software Developer",
"A Cool Company",
"October 2022",
"Present",
"Writing Python Code",
"example-logo.png")
Experience(
"Software Developer",
"A Cool Company",
"October 2022",
"Present",
"Writing Python Code",
"example-logo.png",
)
],
"education": [
Education("Computer Science",
"University of Tech",
"September 2019",
"July 2022",
"80%",
"example-logo.png")
Education(
"Computer Science",
"University of Tech",
"September 2019",
"July 2022",
"80%",
"example-logo.png",
)
],
"skill": [
Skill("Python",
"1-2 Years",
"example-logo.png")
]
"skill": [Skill("Python", "1-2 Years", "example-logo.png")],
}


@app.route('/test')
@app.route("/test")
def hello_world():
'''
"""
Returns a JSON test message
'''
"""
return jsonify({"message": "Hello, World!"})


@app.route('/resume/experience', methods=['GET', 'POST'])
@app.route("/resume/experience", methods=["GET", "POST"])
def experience():
'''
"""
Handle experience requests
'''
if request.method == 'GET':
"""
if request.method == "GET":
return jsonify()

if request.method == 'POST':
if request.method == "POST":
return jsonify({})

return jsonify({})

@app.route('/resume/education', methods=['GET', 'POST'])

@app.route("/resume/education", methods=["GET", "POST"])
def education():
'''
"""
Handles education requests
'''
if request.method == 'GET':
"""
if request.method == "GET":
return jsonify({})

if request.method == 'POST':
if request.method == "POST":
return jsonify({})

return jsonify({})


@app.route('/resume/skill', methods=['GET', 'POST'])
@app.route("/resume/skill", methods=["GET", "POST"])
def skill():
'''
"""
Handles Skill requests
'''
if request.method == 'GET':
"""
if request.method == "GET":
return jsonify({})

if request.method == 'POST':
if request.method == "POST":
return jsonify({})

return jsonify({})

@app.route('/suggestion', methods=['POST'])

@app.route("/suggestion", methods=["POST"])
def suggestion():
'''
"""
Handles suggestion requests
'''
description = request.json.get('description')
type = request.json.get('type')
"""
description = request.json.get("description")
type = request.json.get("type")
if not description or not type:
return jsonify({"error": "Description and type are required"}), 400

suggestion = get_suggestion(description, type)
return jsonify({"suggestion": suggestion})
return jsonify({"suggestion": suggestion})
18 changes: 9 additions & 9 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
load_dotenv()


GOOGLE_API_KEY = os.getenv('GOOGLE_API_KEY')
GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
genai.configure(api_key=GOOGLE_API_KEY)


def get_suggestion(description,type):
'''
def get_suggestion(description, type):
"""
give suggestions for description section using gemini (free alternative to openai's chatgpt api)
'''
if type=="education":
"""

if type == "education":
prompt = f"Improve the following education experience description for resume: {description}"
elif type =="experience":
elif type == "experience":
prompt = f"Improve the following professional experience description for resume: {description}"
model = genai.GenerativeModel('gemini-pro')

model = genai.GenerativeModel("gemini-pro")
response = model.generate_content(prompt)
return response.text

0 comments on commit 31c83e7

Please sign in to comment.