lloydzhou vor 1 Jahr
Ursprung
Commit
b2965e1deb
1 geänderte Dateien mit 7 neuen und 0 gelöschten Zeilen
  1. 7 0
      app/utils/chat.ts

+ 7 - 0
app/utils/chat.ts

@@ -218,6 +218,13 @@ export function stream(
                 JSON.parse(tool.function.arguments),
               ),
             )
+              .then((res) => {
+                const content = JSON.stringify(res.data);
+                if (res.status >= 300) {
+                  return Promise.reject(content);
+                }
+                return content;
+              })
               .then((content) => {
                 options?.onAfterTool?.({
                   ...tool,