mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
feat: Add DALL-E reverse proxy settings and handle errors in image generation (#1173)
* feat: Add DALL-E reverse proxy settings and handle errors in image generation * fix(ci): avoid importing extra utilities
This commit is contained in:
parent
25402fd208
commit
c7205c9bb2
4 changed files with 66 additions and 23 deletions
|
|
@ -134,15 +134,6 @@ describe('DALLE3', () => {
|
|||
await expect(dalle._call(mockData)).rejects.toThrow('Missing required field: prompt');
|
||||
});
|
||||
|
||||
it('should throw an error if no image URL is returned from OpenAI API', async () => {
|
||||
const mockData = {
|
||||
prompt: 'A test prompt',
|
||||
};
|
||||
// Simulate a response with an object that has a `url` property set to `undefined`
|
||||
generate.mockResolvedValue({ data: [{ url: undefined }] });
|
||||
await expect(dalle._call(mockData)).rejects.toThrow('No image URL returned from OpenAI API.');
|
||||
});
|
||||
|
||||
it('should log to console if no image name is found in the URL', async () => {
|
||||
const mockData = {
|
||||
prompt: 'A test prompt',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue