Skip to content

Commit

Permalink
(adding) retry
Browse files Browse the repository at this point in the history
  • Loading branch information
rdvo committed Jul 1, 2024
1 parent 394764c commit 2d87c25
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/llm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@ class LLM {
if (sanitizedContent) {
return sanitizedContent;
} else {
return JSON.stringify({ error: "Invalid JSON format", originalMessage: contentText });
console.log("Invalid JSON format, retrying request...");
return await this.cloudflareAIChat(messages, options);


}
} else {
return contentText;
Expand Down

0 comments on commit 2d87c25

Please sign in to comment.