This commit is contained in:
lloydzhou 2024-08-31 00:16:47 +08:00
parent 2214689920
commit b2965e1deb
1 changed files with 7 additions and 0 deletions

View File

@ -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,