File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
apps/www/src/registry/app/api/ai/command
templates/plate-playground-template/src/app/api/ai/command Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,12 @@ import {
3030} from './prompts' ;
3131
3232export async function POST ( req : NextRequest ) {
33- const { apiKey : key , ctx, messages : messagesRaw , model } = await req . json ( ) ;
33+ const {
34+ apiKey : key ,
35+ ctx,
36+ messages : messagesRaw = [ ] ,
37+ model,
38+ } = await req . json ( ) ;
3439
3540 const { children, selection, toolName : toolNameParam } = ctx ;
3641
Original file line number Diff line number Diff line change 1- import type {
2- ChatMessage ,
3- ToolName ,
4- } from '@/components/editor/use-chat' ;
1+ import type { ChatMessage , ToolName } from '@/components/editor/use-chat' ;
52import type { NextRequest } from 'next/server' ;
63
74import { createGateway } from '@ai-sdk/gateway' ;
@@ -30,7 +27,12 @@ import {
3027} from './prompts' ;
3128
3229export async function POST ( req : NextRequest ) {
33- const { apiKey : key , ctx, messages : messagesRaw , model } = await req . json ( ) ;
30+ const {
31+ apiKey : key ,
32+ ctx,
33+ messages : messagesRaw = [ ] ,
34+ model,
35+ } = await req . json ( ) ;
3436
3537 const { children, selection, toolName : toolNameParam } = ctx ;
3638
You can’t perform that action at this time.
0 commit comments