Hi everyone,
I’m integrating OpenAI’s GPT-4 API using Bubble’s API Connector (Plugin), and I’m facing an issue where dynamic parameters (job_description
and resume_text
) are not being recognized properly when passed through the request body.
Setup Summary:
- API method: POST to
https://api.openai.com/v1/chat/completions
- Headers:
- Authorization: Bearer
sk-...
- Content-Type:
application/json
- Authorization: Bearer
- Plugin is set up with two dynamic body parameters:
job_description
(text)resume_text
(text)
- JSON body:
json
CopyEdit
{
"model": "gpt-4-turbo",
"messages": [
{
"role": "system",
"content": "You are an AI interviewer. Generate relevant questions using the provided information."
},
{
"role": "user",
"content": "**Job Description:**\n\n<job_description>\n\n**Candidate Resume:**\n\n<resume_text>\n\nUse this information to generate tailored interview questions."
}
],
"max_tokens": 700
}
What works:
- The backend workflow runs successfully.
- Job description and resume text do show up in the server logs as expected.
- OpenAI receives the request and responds.
The issue: Despite passing both parameters, the GPT-4 response is always generic — saying something like:
“Please provide a job description and resume to generate tailored questions…”
It’s as if <job_description>
and <resume_text>
are not being substituted at runtime, or are being received as empty or null values by OpenAI, even though logs show values exist.
What I’ve tried:
- Ensured
Content-Type
isapplication/json
- Used
<parameter>
syntax properly inside the JSON body - Tried removing and re-adding parameters
- Made sure body parameters are not marked as “private” or “allow blank”
- Verified that long text inputs are well under token limits
- Tested in both backend workflow and API Connector test call
What I need help with:
- Is this a Bubble bug with plugin dynamic variable resolution?
- Is there a better way to pass multi-line long-form text dynamically to OpenAI via a plugin?
- Any tricks to force evaluation of
<dynamic_value>
inside JSON without it being treated literally?
Appreciate any guidance from the community