Need help with axios config not accepting "respons...
# 🤝help
g
I am trying to retrieve a stream from an API. In VS Code everything works as expected, however in botpress it gives the following error:
Copy code
Argument of type '{ method: string; maxBodyLength: number; url: string; headers: { 'OpenAI-Beta': string; Authorization: string; 'Content-Type': string; }; responseType: string; data: string; }' is not assignable to parameter of type 'AxiosRequestConfig<string>'.
  Types of property 'responseType' are incompatible.
    Type 'string' is not assignable to type 'ResponseType | undefined'.
The config variable looks as follows:
Copy code
const config = {
    method: 'post',
    maxBodyLength: Infinity,
    url: `https://api.openai.com/v1/threads/${workflow.threadId}/runs`,
    headers: {
      'OpenAI-Beta': 'assistants=v2',
      Authorization: 'Bearer ' + env.openAIToken,
      'Content-Type': 'application/json'
    },
    responseType: 'stream',
    data: data
  }
I have tried things like requiring the AxiosRequestConfig and explicitely making the config that type. And defining the type ResponseType myself and casting the 'stream' to that type but nothing works.
q
Botpress doesn't support streaming responses.
2 Views