Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
msveshnikov committed Mar 17, 2024
1 parent 993b947 commit a43a981
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ app.post("/interact", async (req, res) => {
userInput = userInput?.toLowerCase();
let imageResponse;
if (userInput.includes("paint") || userInput.includes("draw") || userInput.includes("generate")) {
imageResponse = await getImageTitan(textResponse.trim().substr(0, 200));
imageResponse = await getImageTitan(textResponse?.trim()?.substr(0, 200) ?? userInput);
}

res.json({ textResponse: textResponse.trim(), imageResponse });
res.json({ textResponse: textResponse?.trim(), imageResponse });
} catch (error) {
console.error(error);
res.status(500).json({
Expand Down

0 comments on commit a43a981

Please sign in to comment.