Spaces:
Sleeping
Sleeping
Commit
·
d98e505
1
Parent(s):
99959b2
fix(api): clean unused imports and prefer-const in ask-ai route to satisfy ESLint
Browse files- app/api/ask-ai/route.ts +3 -3
app/api/ask-ai/route.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { headers } from "next/headers";
|
|
| 6 |
import { InferenceClient } from "@huggingface/inference";
|
| 7 |
|
| 8 |
import { MODELS, PROVIDERS } from "@/lib/providers";
|
| 9 |
-
import {
|
| 10 |
import {
|
| 11 |
DIVIDER,
|
| 12 |
FOLLOW_UP_SYSTEM_PROMPT,
|
|
@@ -30,7 +30,7 @@ export async function POST(request: NextRequest) {
|
|
| 30 |
|
| 31 |
const body = await request.json();
|
| 32 |
const { prompt, redesignMarkdown, previousPrompts, pages } = body;
|
| 33 |
-
|
| 34 |
|
| 35 |
// In embed mode, we previously locked provider/model to defaults.
|
| 36 |
// Now we allow selection from the client; caps and rate limits still apply.
|
|
@@ -224,7 +224,7 @@ export async function PUT(request: NextRequest) {
|
|
| 224 |
|
| 225 |
const body = await request.json();
|
| 226 |
const { prompt, previousPrompts, selectedElementHtml, pages, files } = body;
|
| 227 |
-
|
| 228 |
|
| 229 |
// Allow provider/model selection in embed mode; keep demo safeguards elsewhere.
|
| 230 |
|
|
|
|
| 6 |
import { InferenceClient } from "@huggingface/inference";
|
| 7 |
|
| 8 |
import { MODELS, PROVIDERS } from "@/lib/providers";
|
| 9 |
+
import { EMBED_MODE, MAX_REQUESTS_PER_IP_ENV, MAX_OUTPUT_TOKENS } from "@/lib/flags";
|
| 10 |
import {
|
| 11 |
DIVIDER,
|
| 12 |
FOLLOW_UP_SYSTEM_PROMPT,
|
|
|
|
| 30 |
|
| 31 |
const body = await request.json();
|
| 32 |
const { prompt, redesignMarkdown, previousPrompts, pages } = body;
|
| 33 |
+
const { provider, model } = body;
|
| 34 |
|
| 35 |
// In embed mode, we previously locked provider/model to defaults.
|
| 36 |
// Now we allow selection from the client; caps and rate limits still apply.
|
|
|
|
| 224 |
|
| 225 |
const body = await request.json();
|
| 226 |
const { prompt, previousPrompts, selectedElementHtml, pages, files } = body;
|
| 227 |
+
const { provider, model } = body;
|
| 228 |
|
| 229 |
// Allow provider/model selection in embed mode; keep demo safeguards elsewhere.
|
| 230 |
|