turn image-file(charts) content to image url
# 👀feature-requests
l
I need a function to display image-files(charts) created by openai in webchart I have created the code to separate image-files from text, all I need is to display the image, but the Image card required the URL const response = await axios.request({ method: 'get', maxBodyLength: Infinity, url:
https://api.openai.com/v1/threads/${workflow.threadId}/messages
, headers: { 'OpenAI-Beta': 'assistants=v1', 'Authorization':
Bearer ${bot.openAIToken}
, 'Content-Type': 'application/json' } }); workflow.imageURL = false; const currentResponse = response.data.data[0].content; // Verificați dacă există conținut în răspuns if (currentResponse && currentResponse.length > 0) { // iterate throught the items for (const contentItem of currentResponse) { if (contentItem.type === 'text') { // Display text workflow.textResponse = contentItem.text.value; } else if (contentItem.type === 'image_file') { // Display Image workflow.response =
https://api.openai.com/v1/files/${contentItem.image_file.file_id}/content
workflow.imageURL = true; } // Add whatever other types of content that the message has } } else { workflow.response = 'The response has nothing to retrieve'; } https://cdn.discordapp.com/attachments/1223217703800799262/1223217703985086545/image.png?ex=66190d42&is=66069842&hm=2a5bfff9b3cd359545bffbea4a2e26ce4a54cc476aa4280904755fa2e912ff67& https://cdn.discordapp.com/attachments/1223217703800799262/1223217704308179035/image.png?ex=66190d42&is=66069842&hm=b0a6e7ecfac906eab23cd2c3fa72b0d60484f25aeb0b3caf364eec74d29695aa&