Skip to content

Commit

Permalink
update: update chat function to only use message history
Browse files Browse the repository at this point in the history
  • Loading branch information
tyllenb committed Feb 13, 2024
1 parent bb6cc00 commit 7247994
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions supabase/functions/chat/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,7 @@ const chat = async (req) => {
"Unable to get auth user details in request data"
);
const requestBody = await req.json();
const { messageHistory, userMessage } = requestBody;

// Append userMessage to messageHistory if it exists
if (userMessage) {
messageHistory.push({ role: "user", content: userMessage });
}
const { messageHistory } = requestBody;

if (!messageHistory) throw new UserError("Missing query in request data");

Expand Down

0 comments on commit 7247994

Please sign in to comment.