debug: 添加 chat API 请求验证日志
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
339bf91019
commit
5b4e350568
@ -311,8 +311,10 @@ export async function POST(request: Request) {
|
||||
|
||||
try {
|
||||
const json = await request.json();
|
||||
console.log("[Chat API] Received request body:", JSON.stringify(json, null, 2));
|
||||
requestBody = postRequestBodySchema.parse(json);
|
||||
} catch (_) {
|
||||
} catch (error) {
|
||||
console.error("[Chat API] Schema validation failed:", error);
|
||||
return new ChatSDKError("bad_request:api").toResponse();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user