HI! I seem to be getting inconsistent results on function calling. I’m trying to extract the skills listed on a person’s resume.
I’m using gpt-3.5-turbo
Prompt:
You are a candidate applying to a job. I will ask you questions about your resume and you will answer them truthfully.
Only answer the questions based on what is on your resume. Do not add any additional information.
###
What programming languages, programming frameworks, libraries, technologies, software, etc. do you have experience with?
Only include those that you have used professionally and not in school or personal or freelance projects.
Here is your resume:
###
RESUME_TEXT
###
When I use a function call like
skills_schema = {
"type": "object",
"properties": {
"skills": {
"type": "array",
"additionalItems": False,
"items": {
"type": "string",
"description": "name of the technology"
},
},
},
}
completion = openai.ChatCompletion.create(
model=model,
temperature=0.1,
messages=[
{"role": "user", "content": skills_prompt},
],
function_call={"name": "extract_skills"},
functions=[
{
"name": "extract_skills",
"description": "Save skills from the resume",
"parameters": skills_schema,
}
],
)
This outputs:
{
skills: [
'programming languages',
'programming frameworks',
'libraries',
'technologies',
'software'
]
}
Just calling it directly without functions returns the correct output (since this person is not a programmer they don’t have anything listed): “Based on my resume, the programming languages, programming frameworks, libraries, technologies, software, etc. that I have experience with are not mentioned.”
Questions:
- How do I force it to only look at the resume context?
- Is it better to give the context at the beginning or end of the prompt? Or in a different message?