green-xylophone-76590
04/18/2024, 4:06 PMArgument 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:
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.quick-musician-29561
04/18/2024, 5:14 PM