浏览代码

try using openai api key for dalle-3 plugin

lloydzhou 1 年之前
父节点
当前提交
90e7b5aecf
共有 1 个文件被更改,包括 6 次插入6 次删除
  1. 6 6
      app/store/plugin.ts

+ 6 - 6
app/store/plugin.ts

@@ -60,12 +60,12 @@ export const FunctionToolService = {
     };
     if (authLocation == "header") {
       headers[headerName] = tokenValue;
-      // try using openaiApiKey for Dalle3 Plugin.
-      if (!tokenValue && plugin.id === "dalle3") {
-        const openaiApiKey = useAccessStore.getState().openaiApiKey;
-        if (openaiApiKey) {
-          headers[headerName] = `Bearer ${openaiApiKey}`;
-        }
+    }
+    // try using openaiApiKey for Dalle3 Plugin.
+    if (!tokenValue && plugin.id === "dalle3") {
+      const openaiApiKey = useAccessStore.getState().openaiApiKey;
+      if (openaiApiKey) {
+        headers[headerName] = `Bearer ${openaiApiKey}`;
       }
     }
     const api = new OpenAPIClientAxios({