fix non-streaming

This commit is contained in:
Severian
2025-10-04 05:22:04 +08:00
parent 3a67baf48b
commit 875ace5b2d
2 changed files with 11 additions and 6 deletions

View File

@@ -312,11 +312,7 @@ export async function POST(request: NextRequest) {
try {
const body = await request.json();
// Check if this is a streaming request (JanitorAI expects SSE)
const acceptHeader = request.headers.get("accept");
const isStreamingRequest =
acceptHeader?.includes("text/event-stream") || body.stream === true;
const isStreamingRequest = body.stream === true;
if (!body.messages || body.messages.length < 2) {
if (isStreamingRequest) {