mckaywrigley / chatbot-ui

AI chat for every model.
https://chatbotui.com
MIT License
28k stars 7.8k forks source link

Add support for Azure OpenAI features #1110

Closed elwc-edge closed 7 months ago

elwc-edge commented 7 months ago

Hi, I'm a user of ChatBot-UI 2 project and I think it's awesome. I'm wondering if you could add support for some of the Azure OpenAI features, such as:

References: DALL-E 3: Text and Image Generation with Azure OpenAI Azure OpenAI Embeddings GPT-4 and GPT-4 Turbo Preview Models How to use the GPT-4 Turbo with Vision model Quickstart: Use GPT-4 Turbo with Vision on your images and videos with the Azure Open AI Service

mckaywrigley commented 7 months ago

We want to support more of those things for sure, but for now we do support text inference if you open your profile settings and enter the Azure config settings.

Chr96er commented 7 months ago

@mckaywrigley I was able to make requests to Dall-E if a message starts with "Generate an image" by making some adjustments in app/api/chat/openai/route.ts. I send the prompt to openai chat completions first to make it a lot more elaborate. I'm getting the response (either URL or base64) but I'm unable to get the image to render in the chat. I can return the image URL using the code below which isn't too bad either but it would be great to display the image in the UI.

return new Response(response.data[0].url, {
  status: 200
})

Would you be able to point me in the right direction for making either the URL or base64 render? Do I first need to somehow use uploadMessageImage?

edit: You can find my code in my fork.