Browse Source

Improve web_fetch tool

pull/7730/head
Thomas Kaul 2 days ago
parent
commit
ac84beab07
  1. 10
      apps/api/src/services/fetch/fetch.service.ts

10
apps/api/src/services/fetch/fetch.service.ts

@ -173,9 +173,7 @@ export class FetchService implements OnModuleInit {
try { try {
JSON.parse(body); JSON.parse(body);
} catch { } catch {
if (!rejectedBody) { rejectedBody = body;
rejectedBody = body;
}
continue; continue;
} }
@ -195,9 +193,9 @@ export class FetchService implements OnModuleInit {
); );
this.logger.debug( this.logger.debug(
`Web fetch tool response for ${this.redactUrl( `Web fetch tool response for ${this.redactUrl(url)} (${
url sources?.length ?? 0
)}: ${this.getBodyPreview(rejectedBody)}` } sources): ${this.getBodyPreview(rejectedBody || text)}`
); );
return undefined; return undefined;

Loading…
Cancel
Save