fix kimi
Browse filesFiles changed (2)
222 unmodified lines2232242252262262272282292302 unmodified lines233234235235236237238239240241242243244245246247222 unmodified lines const userToken = request.cookies.get(MY_TOKEN_KEY())?.value;
const body = await request.json(); const { prompt, html, previousPrompt, provider, selectedElementHtml } = body; const { prompt, html, previousPrompt, provider, selectedElementHtml, model } = body;
if (!prompt || !html) { return NextResponse.json(2 unmodified lines ); }
const selectedModel = MODELS[0]; const selectedModel = MODELS.find( (m) => m.value === model || m.label === model ); if (!selectedModel) { return NextResponse.json( { ok: false, error: "Invalid model selected" }, { status: 400 } ); }
let token = userToken; let billTo: string | null = null;66 unmodified lines67686970717273747576105 unmodified lines182183184185181186187188189190259 unmodified lines45045145244745345445545666 unmodified lines const [controller, setController] = useState<AbortController | null>(null); const [isFollowUp, setIsFollowUp] = useState(true);
const selectedModel = useMemo(() => { return MODELS.find((m: { value: string }) => m.value === model); }, [model]);
const callAi = async (redesignMarkdown?: string) => { if (isAiWorking) return; if (!redesignMarkdown && !prompt.trim()) return;105 unmodified lines setPrompt(""); setisAiWorking(false); setHasAsked(true); if (selectedModel?.isThinker) { setModel(MODELS[0].value); setModel(MODELS[0].value); } if (audio.current) audio.current.play();
// Now we have the complete HTML including </html>, so set it to be sure259 unmodified lines id="diff-patch-checkbox" checked={isFollowUp} onCheckedChange={(e) => { if (e === true && !isSameHtml) { if (e === true && !isSameHtml && selectedModel?.isThinker) { setModel(MODELS[0].value); } setIsFollowUp(e === true);app/api/ask-ai/route.ts+11-2
components/editor/ask-ai/index.tsx+8-2