Problem with API
# 🤝help


07/24/2023, 5:06 PM
I am using botpress to connect to customgpt via api. The user will submit a question in botpress which is then sent to customgpt. The answer from customgpt is then retrieved by botpress and written to the user. What I have now works well when the responses are short, but when the responses are longer , I will get an error. Here is the JavaScript code I am using: const projectID = workflow.projectId; const sessionId = workflow.sessionId; const apikey = workflow.apikey; const question = workflow.question; const options = { method: 'POST', url:${projectID}/conversations/${sessionId}/messages
, params: {stream: 'false', lang: 'da'}, headers: { accept: 'application/json', 'content-type': 'application/json', authorization:
Bearer ${apikey}
}, data: {prompt:
}, //timeout: 10000 // sets timeout to 10 seconds }; try { const response = await axios.request(options); workflow.openaiResponse =["openai_response"]; } catch (error) { throw new Error(
customGPT-error: ${error}
) } And here is the error message: Request: prompt:"hvad koster det at klatre?" Error: Network Error Logs (4 items - 2 error) Execute code "inline-ins-e77c8d316d.js" [AxiosError: Network Error] Error executing action "inline-ins-e77c8d316d.js" in flow:Main:node:qToCustomGPT [Error, customGPT-error: AxiosError: Network Error] Entering workflow (flow:Error) [node:Entry] from (flow:Main) [node:qToCustomGPT]


07/24/2023, 5:07 PM
Sorry, this is the error coming from customGPT, can you check with their team or on their community?


07/24/2023, 6:25 PM
Thanks. I will try to contact them.