fix kimi
Browse filesFiles changed (2)
222 unmodified lines2232242252262272282292 unmodified lines232233234235236237238222 unmodified linesconst userToken = request.cookies.get(MY_TOKEN_KEY())?.value;const body = await request.json();const { prompt, html, previousPrompt, provider, selectedElementHtml } = body;if (!prompt || !html) {return NextResponse.json(2 unmodified lines);}const selectedModel = MODELS[0];let token = userToken;let billTo: string | null = null;222 unmodified lines2232242252262272282292302 unmodified lines233234235236237238239240241242243244245246247222 unmodified linesconst userToken = request.cookies.get(MY_TOKEN_KEY())?.value;const body = await request.json();const { prompt, html, previousPrompt, provider, selectedElementHtml, model } =body;if (!prompt || !html) {return NextResponse.json(2 unmodified lines);}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 lines676869707172105 unmodified lines178179180181182183184259 unmodified lines44444544644744844945066 unmodified linesconst [controller, setController] = useState<AbortController | null>(null);const [isFollowUp, setIsFollowUp] = useState(true);const callAi = async (redesignMarkdown?: string) => {if (isAiWorking) return;if (!redesignMarkdown && !prompt.trim()) return;105 unmodified linessetPrompt("");setisAiWorking(false);setHasAsked(true);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 linesid="diff-patch-checkbox"checked={isFollowUp}onCheckedChange={(e) => {if (e === true && !isSameHtml) {setModel(MODELS[0].value);}setIsFollowUp(e === true);66 unmodified lines67686970717273747576105 unmodified lines182183184185186187188189190259 unmodified lines45045145245345445545666 unmodified linesconst [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 linessetPrompt("");setisAiWorking(false);setHasAsked(true);if (selectedModel?.isThinker) {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 linesid="diff-patch-checkbox"checked={isFollowUp}onCheckedChange={(e) => {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