Skip to content

Commit

Permalink
fix: decode utf8 escape sequences returned from GPT (#1192)
Browse files Browse the repository at this point in the history
  • Loading branch information
julianpoy authored Dec 22, 2023
2 parents 4644026 + ce454a3 commit 9443d94
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/trpc/src/services/chat/chatFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ export const initBuildRecipe = (
activeTime: typeof args.activeTime === "string" ? args.activeTime : "",
totalTime: typeof args.totalTime === "string" ? args.totalTime : "",
ingredients: Array.isArray(args.ingredients)
? args.ingredients.join("\n")
? JSON.parse(`"${args.ingredients.join("\n")}`)
: "",
instructions: Array.isArray(args.instructions)
? args.instructions.join("\n")
? JSON.parse(`"${args.instructions.join("\n")}`)
: "",
notes: "",
};
Expand Down Expand Up @@ -127,10 +127,10 @@ export const initOCRFormatRecipe = (
activeTime: typeof args.activeTime === "string" ? args.activeTime : "",
totalTime: typeof args.totalTime === "string" ? args.totalTime : "",
ingredients: Array.isArray(args.ingredients)
? args.ingredients.join("\n")
? JSON.parse(`"${args.ingredients.join("\n")}`)
: "",
instructions: Array.isArray(args.instructions)
? args.instructions.join("\n")
? JSON.parse(`"${args.instructions.join("\n")}`)
: "",
notes: typeof args.notes === "string" ? args.notes : "",
};
Expand Down

0 comments on commit 9443d94

Please sign in to comment.