Skip to content

Commit

Permalink
Update generate.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
babaohuang committed Dec 14, 2023
1 parent 307bc22 commit b695806
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/pages/api/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,6 @@ export const post: APIRoute = async(context) => {

console.log('Received messages:', messages);

// 验证 messages 是否为数组
if (!Array.isArray(messages)) {
console.error('Expected messages to be an array, but received:', messages);
return new Response(JSON.stringify({
error: {
message: 'The messages field must be an array.',
},
}), { status: 400 });
}


const initOptions = generatePayload(messages)

Expand Down

0 comments on commit b695806

Please sign in to comment.