Hey everyone.
I’m trying to use gpt-4 (or gpt-4-0613) function calling feature and i do not receive the result i expect. Actually, the API returns the exact same data i’ve provided in the prompt.
Needless to mention that it works perfectly on the UI
Here’s my code:
const completionConfig = {
model: "gpt-4",
temperature: 0.2,
messages: [
{
role: "system",
content: `You are an expert CV writer. You will be provided with professional experiences, keywords, and a targeted job title. Your task is to refine the experiences to align with the targeted job position, naturally incorporate the provided keywords, and ensure the content is compelling while maintaining authenticity`,
},
{
role: "user",
content: `
Job title: Web3 Frontend Developer
Keywords: javascript,React,React Native,web3,blockchain,mobile development,QA,communication,collaboration,proactive,self-driven,kind,empathetic,supportive
Experiences:
Web3 Developer At Google, Sept. 2022 – July 2023
Built a landing page
Developed 'Robo,' off-chain technology for payment on chain
Contributed to the core smart contract
Designed a standout landing page for Google's NFT collection
`,
},
],
functions: [
{
name: "refine_experiences",
description: "Refined Experiences",
parameters: {
title: "Refined Experiences Schema",
description: "Schema for storing the refined experiences",
type: "object",
properties: {
experiences: {
type: "array",
items: {
type: "object",
properties: {
company: {
type: "string",
description: "Name of the Company",
},
title: { type: "string", description: "Job title" },
dates: {
type: "string",
description: "Dates of employements",
},
achievements: {
type: "array",
description: "Tasks/Responsibilities/Achievements ",
items: { type: "string" },
},
},
required: ["company", "title", "dates", "achievements"],
},
},
},
required: ["experiences"],
},
},
],
function_call: { name: "refine_experiences" },
};
And i got the following result:
{
company: "Google",
title: "Web3 Developer",
dates: "Sept. 2022 – July 2023",
achievements: [
"Built a landing page",
"Developed 'Robo,' off-chain technology for payment on chain",
"Contributed to the core smart contract",
"Designed a standout landing page for Google's NFT collection"
}
Basically the API is totally ignoring my prompt. I’ve tried with different temperatures, different prompt, use only user prompt, … same result.
This is why i decided to ask for help.
Thank you so much for your help!!