danny-avila / LibreChat

Enhanced ChatGPT Clone: Features Anthropic, OpenAI, Assistants API, Azure, Groq, GPT-4o, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, langchain, DALL-E-3, ChatGPT Plugins, OpenAI Functions, Secure Multi-User System, Presets, completely open-source for self-hosting. Actively in public development.
https://librechat.ai/
MIT License
17.2k stars 2.87k forks source link

[Bug]: Dall-E plugin tries to use azure openai chat model to generate an image #498

Closed thunderbug1 closed 1 year ago

thunderbug1 commented 1 year ago

Contact Details

No response

What happened?

When using the azure openai api + installing the dall-e plugin and giving it a valid openai api key from openai it tries to use the azure openai chat instead of calling the openai dall-e endpoint.

In the logs I see a request to: "POST /openai/deployments/chat/images/generations?api-version=2023-03-15-preview " (where "chat" is the endpoint configured in AZURE_OPENAI_API_DEPLOYMENT_NAME )

I think here are 2 issues:

  1. it should never try to generate images with a chat model endpoint
  2. it should be able to either use the openai dall-e endpoint or the azure openai dall-e endpoint

Steps to Reproduce

Set values in .env file for: AZURE_OPENAI_API_KEY= AZURE_OPENAI_API_INSTANCE_NAME= AZURE_OPENAI_API_DEPLOYMENT_NAME= AZURE_OPENAI_API_VERSION= AZURE_OPENAI_API_COMPLETIONS_DEPLOYMENT_NAME= AZURE_OPENAI_API_EMBEDDINGS_DEPLOYMENT_NAME=

comment out all ChatGPT Endpoint settings

Start with docker-compose up

open librechat page

What browsers are you seeing the problem on?

No response

Relevant log output

LibreChat      | ask log
LibreChat      | {
LibreChat      |   text: 'show me an image of a dog playing on a river in a picasso style',
LibreChat      |   conversationId: '52cb01a5-c907-475c-9f66-104821ae5e2e',
LibreChat      |   endpointOption: {
LibreChat      |     chatGptLabel: null,
LibreChat      |     promptPrefix: null,
LibreChat      |     tools: [ 'dall-e' ],
LibreChat      |     modelOptions: {
LibreChat      |       model: 'gpt-3.5-turbo-0301',
LibreChat      |       temperature: 0.8,
LibreChat      |       top_p: 1,
LibreChat      |       presence_penalty: 0,
LibreChat      |       frequency_penalty: 0
LibreChat      |     },
LibreChat      |     agentOptions: { model: 'gpt-3.5-turbo', temperature: 0 }
LibreChat      |   }
LibreChat      | }
LibreChat      | Using Azure endpoint: https://hai-assistant.openai.azure.com/openai/deployments/chat/chat/completions?api-version=2023-03-15-preview {
LibreChat      |   azureOpenAIApiKey: '***************',
LibreChat      |   azureOpenAIApiInstanceName: 'hai-assistant',
LibreChat      |   azureOpenAIApiDeploymentName: 'chat',
LibreChat      |   azureOpenAIApiVersion: '2023-03-15-preview'
LibreChat      | }
LibreChat      | Using Azure endpoint: https://hai-assistant.openai.azure.com/openai/deployments/chat/chat/completions?api-version=2023-03-15-preview {
LibreChat      |   azureOpenAIApiKey: '***************',
LibreChat      |   azureOpenAIApiInstanceName: 'hai-assistant',
LibreChat      |   azureOpenAIApiDeploymentName: 'chat',
LibreChat      |   azureOpenAIApiVersion: '2023-03-15-preview'
LibreChat      | }
LibreChat      | sendMessage show me an image of a dog playing on a river in a picasso style {
LibreChat      |   getIds: [Function: getIds],
LibreChat      |   user: '6486d9d381668c5695eb982f',
LibreChat      |   parentMessageId: '00000000-0000-0000-0000-000000000000',
LibreChat      |   conversationId: '52cb01a5-c907-475c-9f66-104821ae5e2e',
LibreChat      |   overrideParentMessageId: null,
LibreChat      |   onAgentAction: [Function: onAgentAction],
LibreChat      |   onChainEnd: [Function: onChainEnd],
LibreChat      |   onStart: [Function: onStart],
LibreChat      |   onProgress: [Function: wrapper],
LibreChat      |   abortController: AbortController { signal: AbortSignal { aborted: false } }
LibreChat      | }
LibreChat      | Loading history for conversation 52cb01a5-c907-475c-9f66-104821ae5e2e 00000000-0000-0000-0000-000000000000
chat-meilisearch | [2023-06-13T11:35:43Z INFO  actix_web::middleware::logger] 172.30.0.4 "POST /indexes/messages/documents HTTP/1.1" 202 136 "-" "undici" 0.032656
LibreChat      | options
LibreChat      | {
LibreChat      |   debug: true,
LibreChat      |   reverseProxyUrl: null,
LibreChat      |   proxy: null,
LibreChat      |   chatGptLabel: null,
LibreChat      |   promptPrefix: null,
LibreChat      |   tools: [ 'dall-e' ],
LibreChat      |   modelOptions: {
LibreChat      |     model: 'gpt-3.5-turbo-0301',
LibreChat      |     temperature: 0.8,
LibreChat      |     top_p: 1,
LibreChat      |     presence_penalty: 0,
LibreChat      |     frequency_penalty: 0
LibreChat      |   },
LibreChat      |   agentOptions: { model: 'gpt-3.5-turbo', temperature: 0 },
LibreChat      |   azure: {
LibreChat      |     azureOpenAIApiKey: '***************',
LibreChat      |     azureOpenAIApiInstanceName: 'hai-assistant',
LibreChat      |     azureOpenAIApiDeploymentName: 'chat',
LibreChat      |     azureOpenAIApiVersion: '2023-03-15-preview'
LibreChat      |   },
LibreChat      |   getIds: [Function: getIds],
LibreChat      |   user: '6486d9d381668c5695eb982f',
LibreChat      |   parentMessageId: '00000000-0000-0000-0000-000000000000',
LibreChat      |   conversationId: '52cb01a5-c907-475c-9f66-104821ae5e2e',
LibreChat      |   overrideParentMessageId: null,
LibreChat      |   onAgentAction: [Function: onAgentAction],
LibreChat      |   onChainEnd: [Function: onChainEnd],
LibreChat      |   onStart: [Function: onStart],
LibreChat      |   onProgress: [Function: wrapper],
LibreChat      |   abortController: AbortController { signal: AbortSignal { aborted: false } }
LibreChat      | }
LibreChat      | <-----Agent Model: gpt-3.5-turbo | Temp: 0----->
LibreChat      | Requested Tools
LibreChat      | [ 'dall-e' ]
LibreChat      | Loaded Tools
LibreChat      | [ 'dall-e' ]
LibreChat      | Loaded agent.
LibreChat      | Attempt 1 of 1
chat-meilisearch | [2023-06-13T11:35:43Z INFO  actix_web::middleware::logger] 172.30.0.4 "POST /indexes/convos/documents HTTP/1.1" 202 135 "-" "undici" 0.023588
LibreChat      | [chain/start] [1:chain:agent_executor] Entering Chain run with input: {
LibreChat      |   "input": "show me an image of a dog playing on a river in a picasso style",
LibreChat      |   "signal": {},
LibreChat      |   "chat_history": ""
LibreChat      | }
LibreChat      | [chain/start] [1:chain:agent_executor > 2:chain:llm_chain] Entering Chain run with input: {
LibreChat      |   "input": "show me an image of a dog playing on a river in a picasso style",
LibreChat      |   "signal": {},
LibreChat      |   "chat_history": "",
LibreChat      |   "agent_scratchpad": "",
LibreChat      |   "stop": [
LibreChat      |     "\nObservation:",
LibreChat      |     "\nObservation 1:"
LibreChat      |   ]
LibreChat      | }
LibreChat      | [llm/start] [1:chain:agent_executor > 2:chain:llm_chain > 3:llm:openai] Entering LLM run with input: {
LibreChat      |   "messages": [
LibreChat      |     [
LibreChat      |       {
LibreChat      |         "type": "system",
LibreChat      |         "data": {
LibreChat      |           "content": "Date: June 13, 2023\nObjective: Understand the human's query with available actions & tools. Let's work this out in a step by step way to be sure we fulfill the query.\n\nUse available actions and tools judiciously.\n\n# Available Actions & Tools:\nN/A: No suitable action; use your own knowledge.\n\ndall-e: You can generate images with 'dall-e'. This tool is exclusively for visual content.\nGuidelines:\n- Visually describe the moods, details, structures, styles, and/or proportions of the image. Remember, the focus is on visual attributes.\n- Craft your input by \"showing\" and not \"telling\" the imagery. Think in terms of what you'd want to see in a photograph or a painting.\n- It's best to follow this format for image creation. Come up with the optional inputs yourself if none are given:\n\"Subject: [subject], Style: [style], Color: [color], Details: [details], Emotion: [emotion]\"\n- Generate images only once per human query unless explicitly requested by the user\n\nI want you to respond with this format and this format only, without comments or explanations, to indicate actions taken:\n\nThought: Your thought process.\nAction: Action from [dall-e,self-reflection].\nAction Input: Action's input.\nObservation: Action's result.\n```\n\nFor each action, repeat the format. If no tool is used, use N/A for Action, and provide the result as Action Input.\n\nFinally, complete with:\n```\nThought: Convey final answer determination.\nFinal Answer: Reply to user's query conversationally.\n```\n\nRemember:\n- Adhere to the Action format strictly for parsing.\n- Transition quickly to Thought/Final Answer format when a tool isn't needed.\n- Follow user's logic without superfluous steps.\n- If unable to use tools for a fitting answer, use your knowledge.\n- Strive for efficient, minimal actions."
LibreChat      |         }
LibreChat      |       },
LibreChat      |       {
LibreChat      |         "type": "human",
LibreChat      |         "data": {
LibreChat      |           "content": "\nQuery: show me an image of a dog playing on a river in a picasso style\n"
LibreChat      |         }
LibreChat      |       }
LibreChat      |     ]
LibreChat      |   ]
LibreChat      | }
chat-meilisearch | [2023-06-13T11:35:43Z INFO  index_scheduler::batch] document addition done: DocumentAdditionResult { indexed_documents: 1, number_of_documents: 25 }
chat-meilisearch | [2023-06-13T11:35:43Z INFO  index_scheduler] A batch of tasks was successfully completed.
chat-meilisearch | [2023-06-13T11:35:43Z INFO  index_scheduler::batch] document addition done: DocumentAdditionResult { indexed_documents: 1, number_of_documents: 11 }
chat-meilisearch | [2023-06-13T11:35:43Z INFO  index_scheduler] A batch of tasks was successfully completed.
LibreChat      | [llm/end] [1:chain:agent_executor > 2:chain:llm_chain > 3:llm:openai] [1.97s] Exiting LLM run with output: {
LibreChat      |   "generations": [
LibreChat      |     [
LibreChat      |       {
LibreChat      |         "text": "Thought: The user wants an image of a dog playing on a river in a Picasso style. I can use dall-e to generate this image.\n\nAction: Use dall-e.\n\nAction Input: Subject: dog, Style: Picasso, Details: playing on a river.\n",
LibreChat      |         "message": {
LibreChat      |           "type": "ai",
LibreChat      |           "data": {
LibreChat      |             "content": "Thought: The user wants an image of a dog playing on a river in a Picasso style. I can use dall-e to generate this image.\n\nAction: Use dall-e.\n\nAction Input: Subject: dog, Style: Picasso, Details: playing on a river.\n"
LibreChat      |           }
LibreChat      |         }
LibreChat      |       }
LibreChat      |     ]
LibreChat      |   ],
LibreChat      |   "llmOutput": {
LibreChat      |     "tokenUsage": {
LibreChat      |       "completionTokens": 53,
LibreChat      |       "promptTokens": 437,
LibreChat      |       "totalTokens": 490
LibreChat      |     }
LibreChat      |   }
LibreChat      | }
LibreChat      | [chain/end] [1:chain:agent_executor > 2:chain:llm_chain] [1.98s] Exiting Chain run with output: {
LibreChat      |   "text": "Thought: The user wants an image of a dog playing on a river in a Picasso style. I can use dall-e to generate this image.\n\nAction: Use dall-e.\n\nAction Input: Subject: dog, Style: Picasso, Details: playing on a river.\n"
LibreChat      | }
LibreChat      | 
LibreChat      | 
LibreChat      | <----------------Tool invalid: Re-assigning Selected Tool---------------->
LibreChat      | 
LibreChat      |  [
LibreChat      |   'Action: Use dall-e.\n' +
LibreChat      |     '\n' +
LibreChat      |     'Action Input: Subject: dog, Style: Picasso, Details: playing on a river.\n',
LibreChat      |   'Use dall-e.\n',
LibreChat      |   'Subject: dog, Style: Picasso, Details: playing on a river.\n',
LibreChat      |   index: 123,
LibreChat      |   input: 'Thought: The user wants an image of a dog playing on a river in a Picasso style. I can use dall-e to generate this image.\n' +
LibreChat      |     '\n' +
LibreChat      |     'Action: Use dall-e.\n' +
LibreChat      |     '\n' +
LibreChat      |     'Action Input: Subject: dog, Style: Picasso, Details: playing on a river.\n',
LibreChat      |   groups: undefined
LibreChat      | ]
LibreChat      | Latest Agent Action  {
LibreChat      |   tool: 'dall-e',
LibreChat      |   toolInput: 'Subject: dog, Style: Picasso, Details: playing on a river.',
LibreChat      |   log: 'Thought: The user wants an image of a dog playing on a river in a Picasso style. I can use dall-e to generate this image.\n' +
LibreChat      |     '\n' +
LibreChat      |     'Action: Use dall-e.\n' +
LibreChat      |     '\n' +
LibreChat      |     'Action Input: Subject: dog, Style: Picasso, Details: playing on a river.\n'
LibreChat      | }
LibreChat      | [agent/action] [1:chain:agent_executor] Agent selected action: {
LibreChat      |   "tool": "dall-e",
LibreChat      |   "toolInput": "Subject: dog, Style: Picasso, Details: playing on a river.",
LibreChat      |   "log": "Thought: The user wants an image of a dog playing on a river in a Picasso style. I can use dall-e to generate this image.\n\nAction: Use dall-e.\n\nAction Input: Subject: dog, Style: Picasso, Details: playing on a river.\n"
LibreChat      | }
LibreChat      | [tool/start] [1:chain:agent_executor > 4:tool:dall-e] Entering Tool run with input: "Subject: dog, Style: Picasso, Details: playing on a river."
LibreChat      | [tool/error] [1:chain:agent_executor > 4:tool:dall-e] [75ms] Tool run errored with error: "Request failed with status code 404"
LibreChat      | [chain/error] [1:chain:agent_executor] [2.06s] Chain run errored with error: "Request failed with status code 404"
LibreChat      | Error: Request failed with status code 404
LibreChat      |     at createError (/app/node_modules/openai/node_modules/axios/lib/core/createError.js:16:15)
LibreChat      |     at settle (/app/node_modules/openai/node_modules/axios/lib/core/settle.js:17:12)
LibreChat      |     at IncomingMessage.handleStreamEnd (/app/node_modules/openai/node_modules/axios/lib/adapters/http.js:322:11)
LibreChat      |     at IncomingMessage.emit (node:events:525:35)
LibreChat      |     at endReadableNT (node:internal/streams/readable:1359:12)
LibreChat      |     at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
LibreChat      |   config: {
LibreChat      |     transitional: {
LibreChat      |       silentJSONParsing: true,
LibreChat      |       forcedJSONParsing: true,
LibreChat      |       clarifyTimeoutError: false
LibreChat      |     },
LibreChat      |     adapter: [Function: httpAdapter],
LibreChat      |     transformRequest: [ [Function: transformRequest] ],
LibreChat      |     transformResponse: [ [Function: transformResponse] ],
LibreChat      |     timeout: 0,
LibreChat      |     xsrfCookieName: 'XSRF-TOKEN',
LibreChat      |     xsrfHeaderName: 'X-XSRF-TOKEN',
LibreChat      |     maxContentLength: -1,
LibreChat      |     maxBodyLength: -1,
LibreChat      |     validateStatus: [Function: validateStatus],
LibreChat      |     headers: {
LibreChat      |       Accept: 'application/json, text/plain, */*',
LibreChat      |       'Content-Type': 'application/json',
LibreChat      |       'User-Agent': 'OpenAI/NodeJS/3.2.1',
LibreChat      |       Authorization: 'Bearer ***************',
LibreChat      |       'api-key': '***************',
LibreChat      |       'Content-Length': 94
LibreChat      |     },
LibreChat      |     method: 'post',
LibreChat      |     params: { 'api-version': '2023-03-15-preview' },
LibreChat      |     data: '{"prompt":"Subject: dog, Style: Picasso, Details: playing on a river.","n":1,"size":"512x512"}',
LibreChat      |     url: 'https://hai-assistant.openai.azure.com/openai/deployments/chat/images/generations'
LibreChat      |   },
LibreChat      |   request: <ref *1> ClientRequest {
LibreChat      |     _events: [Object: null prototype] {
LibreChat      |       abort: [Function (anonymous)],
LibreChat      |       aborted: [Function (anonymous)],
LibreChat      |       connect: [Function (anonymous)],
LibreChat      |       error: [Function (anonymous)],
LibreChat      |       socket: [Function (anonymous)],
LibreChat      |       timeout: [Function (anonymous)],
LibreChat      |       finish: [Function: requestOnFinish]
LibreChat      |     },
LibreChat      |     _eventsCount: 7,
LibreChat      |     _maxListeners: undefined,
LibreChat      |     outputData: [],
LibreChat      |     outputSize: 0,
LibreChat      |     writable: true,
LibreChat      |     destroyed: true,
LibreChat      |     _last: false,
LibreChat      |     chunkedEncoding: false,
LibreChat      |     shouldKeepAlive: true,
LibreChat      |     maxRequestsOnConnectionReached: false,
LibreChat      |     _defaultKeepAlive: true,
LibreChat      |     useChunkedEncodingByDefault: true,
LibreChat      |     sendDate: false,
LibreChat      |     _removedConnection: false,
LibreChat      |     _removedContLen: false,
LibreChat      |     _removedTE: false,
LibreChat      |     strictContentLength: false,
LibreChat      |     _contentLength: 94,
LibreChat      |     _hasBody: true,
LibreChat      |     _trailer: '',
LibreChat      |     finished: true,
LibreChat      |     _headerSent: true,
LibreChat      |     _closed: true,
LibreChat      |     socket: TLSSocket {
LibreChat      |       _tlsOptions: [Object],
LibreChat      |       _secureEstablished: true,
LibreChat      |       _securePending: false,
LibreChat      |       _newSessionPending: false,
LibreChat      |       _controlReleased: true,
LibreChat      |       secureConnecting: false,
LibreChat      |       _SNICallback: null,
LibreChat      |       servername: 'hai-assistant.openai.azure.com',
LibreChat      |       alpnProtocol: false,
LibreChat      |       authorized: true,
LibreChat      |       authorizationError: null,
LibreChat      |       encrypted: true,
LibreChat      |       _events: [Object: null prototype],
LibreChat      |       _eventsCount: 9,
LibreChat      |       connecting: false,
LibreChat      |       _hadError: false,
LibreChat      |       _parent: null,
LibreChat      |       _host: 'hai-assistant.openai.azure.com',
LibreChat      |       _closeAfterHandlingError: false,
LibreChat      |       _readableState: [ReadableState],
LibreChat      |       _maxListeners: undefined,
LibreChat      |       _writableState: [WritableState],
LibreChat      |       allowHalfOpen: false,
LibreChat      |       _sockname: null,
LibreChat      |       _pendingData: null,
LibreChat      |       _pendingEncoding: '',
LibreChat      |       server: undefined,
LibreChat      |       _server: null,
LibreChat      |       ssl: [TLSWrap],
LibreChat      |       _requestCert: true,
LibreChat      |       _rejectUnauthorized: true,
LibreChat      |       timeout: 5000,
LibreChat      |       parser: null,
LibreChat      |       _httpMessage: null,
LibreChat      |       [Symbol(res)]: [TLSWrap],
LibreChat      |       [Symbol(verified)]: true,
LibreChat      |       [Symbol(pendingSession)]: null,
LibreChat      |       [Symbol(async_id_symbol)]: -1,
LibreChat      |       [Symbol(kHandle)]: [TLSWrap],
LibreChat      |       [Symbol(lastWriteQueueSize)]: 0,
LibreChat      |       [Symbol(timeout)]: Timeout {
LibreChat      |         _idleTimeout: 5000,
LibreChat      |         _idlePrev: [TimersList],
LibreChat      |         _idleNext: [Timeout],
LibreChat      |         _idleStart: 83767,
LibreChat      |         _onTimeout: [Function: bound ],
LibreChat      |         _timerArgs: undefined,
LibreChat      |         _repeat: null,
LibreChat      |         _destroyed: false,
LibreChat      |         [Symbol(refed)]: false,
LibreChat      |         [Symbol(kHasPrimitive)]: false,
LibreChat      |         [Symbol(asyncId)]: 2433,
LibreChat      |         [Symbol(triggerId)]: 2431
LibreChat      |       },
LibreChat      |       [Symbol(kBuffer)]: null,
LibreChat      |       [Symbol(kBufferCb)]: null,
LibreChat      |       [Symbol(kBufferGen)]: null,
LibreChat      |       [Symbol(kCapture)]: false,
LibreChat      |       [Symbol(kSetNoDelay)]: false,
LibreChat      |       [Symbol(kSetKeepAlive)]: true,
LibreChat      |       [Symbol(kSetKeepAliveInitialDelay)]: 1,
LibreChat      |       [Symbol(kBytesRead)]: 0,
LibreChat      |       [Symbol(kBytesWritten)]: 0,
LibreChat      |       [Symbol(connect-options)]: [Object]
LibreChat      |     },
LibreChat      |     _header: 'POST /openai/deployments/chat/images/generations?api-version=2023-03-15-preview HTTP/1.1\r\n' +
LibreChat      |       'Accept: application/json, text/plain, */*\r\n' +
LibreChat      |       'Content-Type: application/json\r\n' +
LibreChat      |       'User-Agent: OpenAI/NodeJS/3.2.1\r\n' +
LibreChat      |       'Authorization: Bearer ***************\r\n' +
LibreChat      |       'api-key: ***************\r\n' +
LibreChat      |       'Content-Length: 94\r\n' +
LibreChat      |       'Host: hai-assistant.openai.azure.com\r\n' +
LibreChat      |       'Connection: keep-alive\r\n' +
LibreChat      |       '\r\n',
LibreChat      |     _keepAliveTimeout: 0,
LibreChat      |     _onPendingData: [Function: nop],
LibreChat      |     agent: Agent {
LibreChat      |       _events: [Object: null prototype],
LibreChat      |       _eventsCount: 2,
LibreChat      |       _maxListeners: undefined,
LibreChat      |       defaultPort: 443,
LibreChat      |       protocol: 'https:',
LibreChat      |       options: [Object: null prototype],
LibreChat      |       requests: [Object: null prototype] {},
LibreChat      |       sockets: [Object: null prototype] {},
LibreChat      |       freeSockets: [Object: null prototype],
LibreChat      |       keepAliveMsecs: 1000,
LibreChat      |       keepAlive: true,
LibreChat      |       maxSockets: Infinity,
LibreChat      |       maxFreeSockets: 256,
LibreChat      |       scheduling: 'lifo',
LibreChat      |       maxTotalSockets: Infinity,
LibreChat      |       totalSocketCount: 1,
LibreChat      |       maxCachedSessions: 100,
LibreChat      |       _sessionCache: [Object],
LibreChat      |       [Symbol(kCapture)]: false
LibreChat      |     },
LibreChat      |     socketPath: undefined,
LibreChat      |     method: 'POST',
LibreChat      |     maxHeaderSize: undefined,
LibreChat      |     insecureHTTPParser: undefined,
LibreChat      |     joinDuplicateHeaders: undefined,
LibreChat      |     path: '/openai/deployments/chat/images/generations?api-version=2023-03-15-preview',
LibreChat      |     _ended: true,
LibreChat      |     res: IncomingMessage {
LibreChat      |       _readableState: [ReadableState],
LibreChat      |       _events: [Object: null prototype],
LibreChat      |       _eventsCount: 4,
LibreChat      |       _maxListeners: undefined,
LibreChat      |       socket: null,
LibreChat      |       httpVersionMajor: 1,
LibreChat      |       httpVersionMinor: 1,
LibreChat      |       httpVersion: '1.1',
LibreChat      |       complete: true,
LibreChat      |       rawHeaders: [Array],
LibreChat      |       rawTrailers: [],
LibreChat      |       joinDuplicateHeaders: undefined,
LibreChat      |       aborted: false,
LibreChat      |       upgrade: false,
LibreChat      |       url: '',
LibreChat      |       method: null,
LibreChat      |       statusCode: 404,
LibreChat      |       statusMessage: 'Resource Not Found',
LibreChat      |       client: [TLSSocket],
LibreChat      |       _consuming: false,
LibreChat      |       _dumped: false,
LibreChat      |       req: [Circular *1],
LibreChat      |       responseUrl: 'https://hai-assistant.openai.azure.com/openai/deployments/chat/images/generations?api-version=2023-03-15-preview',
LibreChat      |       redirects: [],
LibreChat      |       [Symbol(kCapture)]: false,
LibreChat      |       [Symbol(kHeaders)]: [Object],
LibreChat      |       [Symbol(kHeadersCount)]: 12,
LibreChat      |       [Symbol(kTrailers)]: null,
LibreChat      |       [Symbol(kTrailersCount)]: 0
LibreChat      |     },
LibreChat      |     aborted: false,
LibreChat      |     timeoutCb: null,
LibreChat      |     upgradeOrConnect: false,
LibreChat      |     parser: null,
LibreChat      |     maxHeadersCount: null,
LibreChat      |     reusedSocket: true,
LibreChat      |     host: 'hai-assistant.openai.azure.com',
LibreChat      |     protocol: 'https:',
LibreChat      |     _redirectable: Writable {
LibreChat      |       _writableState: [WritableState],
LibreChat      |       _events: [Object: null prototype],
LibreChat      |       _eventsCount: 3,
LibreChat      |       _maxListeners: undefined,
LibreChat      |       _options: [Object],
LibreChat      |       _ended: true,
LibreChat      |       _ending: true,
LibreChat      |       _redirectCount: 0,
LibreChat      |       _redirects: [],
LibreChat      |       _requestBodyLength: 94,
LibreChat      |       _requestBodyBuffers: [],
LibreChat      |       _onNativeResponse: [Function (anonymous)],
LibreChat      |       _currentRequest: [Circular *1],
LibreChat      |       _currentUrl: 'https://hai-assistant.openai.azure.com/openai/deployments/chat/images/generations?api-version=2023-03-15-preview',
LibreChat      |       [Symbol(kCapture)]: false
LibreChat      |     },
LibreChat      |     [Symbol(kCapture)]: false,
LibreChat      |     [Symbol(kBytesWritten)]: 0,
LibreChat      |     [Symbol(kNeedDrain)]: false,
LibreChat      |     [Symbol(corked)]: 0,
LibreChat      |     [Symbol(kOutHeaders)]: [Object: null prototype] {
LibreChat      |       accept: [Array],
LibreChat      |       'content-type': [Array],
LibreChat      |       'user-agent': [Array],
LibreChat      |       authorization: [Array],
LibreChat      |       'api-key': [Array],
LibreChat      |       'content-length': [Array],
LibreChat      |       host: [Array]
LibreChat      |     },
LibreChat      |     [Symbol(errored)]: null,
LibreChat      |     [Symbol(kHighWaterMark)]: 16384,
LibreChat      |     [Symbol(kUniqueHeaders)]: null
LibreChat      |   },
LibreChat      |   response: {
LibreChat      |     status: 404,
LibreChat      |     statusText: 'Resource Not Found',
LibreChat      |     headers: {
LibreChat      |       'content-length': '56',
LibreChat      |       'content-type': 'application/json',
LibreChat      |       'apim-request-id': '6ca205fc-e7b5-47b8-b18a-44b339d03f7b',
LibreChat      |       'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
LibreChat      |       'x-content-type-options': 'nosniff',
LibreChat      |       date: 'Tue, 13 Jun 2023 11:35:45 GMT'
LibreChat      |     },
LibreChat      |     config: {
LibreChat      |       transitional: [Object],
LibreChat      |       adapter: [Function: httpAdapter],
LibreChat      |       transformRequest: [Array],
LibreChat      |       transformResponse: [Array],
LibreChat      |       timeout: 0,
LibreChat      |       xsrfCookieName: 'XSRF-TOKEN',
LibreChat      |       xsrfHeaderName: 'X-XSRF-TOKEN',
LibreChat      |       maxContentLength: -1,
LibreChat      |       maxBodyLength: -1,
LibreChat      |       validateStatus: [Function: validateStatus],
LibreChat      |       headers: [Object],
LibreChat      |       method: 'post',
LibreChat      |       params: [Object],
LibreChat      |       data: '{"prompt":"Subject: dog, Style: Picasso, Details: playing on a river.","n":1,"size":"512x512"}',
LibreChat      |       url: 'https://hai-assistant.openai.azure.com/openai/deployments/chat/images/generations'
LibreChat      |     },
LibreChat      |     request: <ref *1> ClientRequest {
LibreChat      |       _events: [Object: null prototype],
LibreChat      |       _eventsCount: 7,
LibreChat      |       _maxListeners: undefined,
LibreChat      |       outputData: [],
LibreChat      |       outputSize: 0,
LibreChat      |       writable: true,
LibreChat      |       destroyed: true,
LibreChat      |       _last: false,
LibreChat      |       chunkedEncoding: false,
LibreChat      |       shouldKeepAlive: true,
LibreChat      |       maxRequestsOnConnectionReached: false,
LibreChat      |       _defaultKeepAlive: true,
LibreChat      |       useChunkedEncodingByDefault: true,
LibreChat      |       sendDate: false,
LibreChat      |       _removedConnection: false,
LibreChat      |       _removedContLen: false,
LibreChat      |       _removedTE: false,
LibreChat      |       strictContentLength: false,
LibreChat      |       _contentLength: 94,
LibreChat      |       _hasBody: true,
LibreChat      |       _trailer: '',
LibreChat      |       finished: true,
LibreChat      |       _headerSent: true,
LibreChat      |       _closed: true,
LibreChat      |       socket: [TLSSocket],
LibreChat      |       _header: 'POST /openai/deployments/chat/images/generations?api-version=2023-03-15-preview HTTP/1.1\r\n' +
LibreChat      |         'Accept: application/json, text/plain, */*\r\n' +
LibreChat      |         'Content-Type: application/json\r\n' +
LibreChat      |         'User-Agent: OpenAI/NodeJS/3.2.1\r\n' +
LibreChat      |         'Authorization: Bearer ***************\r\n' +
LibreChat      |         'api-key: ***************\r\n' +
LibreChat      |         'Content-Length: 94\r\n' +
LibreChat      |         'Host: hai-assistant.openai.azure.com\r\n' +
LibreChat      |         'Connection: keep-alive\r\n' +
LibreChat      |         '\r\n',
LibreChat      |       _keepAliveTimeout: 0,
LibreChat      |       _onPendingData: [Function: nop],
LibreChat      |       agent: [Agent],
LibreChat      |       socketPath: undefined,
LibreChat      |       method: 'POST',
LibreChat      |       maxHeaderSize: undefined,
LibreChat      |       insecureHTTPParser: undefined,
LibreChat      |       joinDuplicateHeaders: undefined,
LibreChat      |       path: '/openai/deployments/chat/images/generations?api-version=2023-03-15-preview',
LibreChat      |       _ended: true,
LibreChat      |       res: [IncomingMessage],
LibreChat      |       aborted: false,
LibreChat      |       timeoutCb: null,
LibreChat      |       upgradeOrConnect: false,
LibreChat      |       parser: null,
LibreChat      |       maxHeadersCount: null,
LibreChat      |       reusedSocket: true,
LibreChat      |       host: 'hai-assistant.openai.azure.com',
LibreChat      |       protocol: 'https:',
LibreChat      |       _redirectable: [Writable],
LibreChat      |       [Symbol(kCapture)]: false,
LibreChat      |       [Symbol(kBytesWritten)]: 0,
LibreChat      |       [Symbol(kNeedDrain)]: false,
LibreChat      |       [Symbol(corked)]: 0,
LibreChat      |       [Symbol(kOutHeaders)]: [Object: null prototype],
LibreChat      |       [Symbol(errored)]: null,
LibreChat      |       [Symbol(kHighWaterMark)]: 16384,
LibreChat      |       [Symbol(kUniqueHeaders)]: null
LibreChat      |     },
LibreChat      |     data: { error: [Object] }
LibreChat      |   },
LibreChat      |   isAxiosError: true,
LibreChat      |   toJSON: [Function: toJSON]
LibreChat      | }
LibreChat      | this.result {
LibreChat      |   output: 'Encountered an error while attempting to respond. Error: Request failed with status code 404',
LibreChat      |   intermediateSteps: [
LibreChat      |     {
LibreChat      |       tool: 'dall-e',
LibreChat      |       toolInput: 'Subject: dog, Style: Picasso, Details: playing on a river.',
LibreChat      |       log: 'Thought: The user wants an image of a dog playing on a river in a Picasso style. I can use dall-e to generate this image.\n' +
LibreChat      |         '\n' +
LibreChat      |         'Action: Use dall-e.\n' +
LibreChat      |         '\n' +
LibreChat      |         'Action Input: Subject: dog, Style: Picasso, Details: playing on a river.\n'
LibreChat      |     }
LibreChat      |   ],
LibreChat      |   errorMessage: 'Request failed with status code 404'
LibreChat      | }
LibreChat      | promptPrefix As ChatGPT, review and improve the answer you generated using plugins in response to the User Message below. The answer hasn't been sent to the user yet.
LibreChat      | You encountered an error in attempting a response. The user is not aware of the error so you shouldn't mention it.
LibreChat      | Review the actions taken carefully in case there is a partial or complete answer within them.
LibreChat      | Error Message: Request failed with status code 404
LibreChat      | 
LibreChat      | Internal thoughts & actions taken:
LibreChat      | "Thought: The user wants an image of a dog playing on a river in a Picasso style. I can use dall-e to generate this image.
LibreChat      | 
LibreChat      | Action: Use dall-e.
LibreChat      | 
LibreChat      | Action Input: Subject: dog, Style: Picasso, Details: playing on a river.
LibreChat      | "
LibreChat      | Preliminary Answer: "Encountered an error while attempting to respond. Error: Request failed with status code 404"
LibreChat      | Reply conversationally to the User based on your preliminary answer, internal actions, thoughts, and observations, making improvements wherever possible, but do not modify URLs.
LibreChat      | You must cite sources if you are using any web links. You must include the exact image paths from above, formatted in Markdown syntax: ![alt-text](URL)
LibreChat      | Only respond with your conversational reply to the following User Message:
LibreChat      | "show me an image of a dog playing on a river in a picasso style"
LibreChat      | buildPrompt messages [
LibreChat      |   {
LibreChat      |     messageId: 'eb24536d-b968-4758-9887-9b79d113b392',
LibreChat      |     parentMessageId: '00000000-0000-0000-0000-000000000000',
LibreChat      |     role: 'User',
LibreChat      |     text: 'show me an image of a dog playing on a river in a picasso style'
LibreChat      |   }
LibreChat      | ]
LibreChat      | 
LibreChat      | https://hai-assistant.openai.azure.com/openai/deployments/chat/chat/completions?api-version=2023-03-15-preview
LibreChat      | {
LibreChat      |   model: 'gpt-3.5-turbo-0301',
LibreChat      |   temperature: 0.8,
LibreChat      |   top_p: 1,
LibreChat      |   presence_penalty: 0,
LibreChat      |   frequency_penalty: 0,
LibreChat      |   stop: undefined,
LibreChat      |   max_tokens: 1024,
LibreChat      |   stream: true,
LibreChat      |   messages: [
LibreChat      |     {
LibreChat      |       role: 'user',
LibreChat      |       name: 'instructions',
LibreChat      |       content: '||>Instructions:\n' +
LibreChat      |         "As ChatGPT, review and improve the answer you generated using plugins in response to the User Message below. The answer hasn't been sent to the user yet.\n" +
LibreChat      |         "You encountered an error in attempting a response. The user is not aware of the error so you shouldn't mention it.\n" +
LibreChat      |         'Review the actions taken carefully in case there is a partial or complete answer within them.\n' +
LibreChat      |         'Error Message: Request failed with status code 404\n' +
LibreChat      |         '\n' +
LibreChat      |         'Internal thoughts & actions taken:\n' +
LibreChat      |         '"Thought: The user wants an image of a dog playing on a river in a Picasso style. I can use dall-e to generate this image.\n' +
LibreChat      |         '\n' +
LibreChat      |         'Action: Use dall-e.\n' +
LibreChat      |         '\n' +
LibreChat      |         'Action Input: Subject: dog, Style: Picasso, Details: playing on a river.\n' +
LibreChat      |         '"\n' +
LibreChat      |         'Preliminary Answer: "Encountered an error while attempting to respond. Error: Request failed with status code 404"\n' +
LibreChat      |         'Reply conversationally to the User based on your preliminary answer, internal actions, thoughts, and observations, making improvements wherever possible, but do not modify URLs.\n' +
LibreChat      |         'You must cite sources if you are using any web links. You must include the exact image paths from above, formatted in Markdown syntax: ![alt-text](URL)\n' +
LibreChat      |         'Only respond with your conversational reply to the following User Message:\n' +
LibreChat      |         '"show me an image of a dog playing on a river in a picasso style"'
LibreChat      |     },
LibreChat      |     {
LibreChat      |       role: 'user',
LibreChat      |       content: 'Chat History:\n' +
LibreChat      |         '||>User:\n' +
LibreChat      |         'show me an image of a dog playing on a river in a picasso style\n' +
LibreChat      |         '||>ChatGPT:\n'
LibreChat      |     }
LibreChat      |   ]
LibreChat      | }
LibreChat      |

Screenshots

image

Code of Conduct

danny-avila commented 1 year ago

This was done to accommodate azure users when the plugin worked off the main OpenAI API key. Somewhere along the line, I decided to separate the DALL-E concern but I just realized I forgot to edit this, thanks to you. I'm pushing the changes now.