Skip to content

Commit

Permalink
refactor: API endpoint to use 'POST' method and 'chat' route for chat…
Browse files Browse the repository at this point in the history
… functionality
  • Loading branch information
glaucia86 committed Apr 3, 2024
1 parent f8e80e4 commit f652564
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/api/src/functions/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ export async function chat(request: HttpRequest, context: InvocationContext): Pr
try {
const requestBody: any = await request.json();

const { messages } = requestBody;
const { stream } = requestBody;
const { messages, stream } = requestBody;

if (!messages || messages.length === 0 || !messages[0].content) {
return badRequest(new Error('Invalid or missing messages in the request body'));
Expand Down

0 comments on commit f652564

Please sign in to comment.