mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
Feat : Auto restart after crash
This commit is contained in:
@@ -49,7 +49,7 @@ export function transformToOllama(response, model) {
|
||||
const formattedCalls = toolCallsArr.map(tc => ({
|
||||
function: {
|
||||
name: tc.function.name,
|
||||
arguments: JSON.parse(tc.function.arguments || "{}")
|
||||
arguments: (() => { try { return JSON.parse(tc.function.arguments || "{}"); } catch { return {}; } })()
|
||||
}
|
||||
}));
|
||||
const ollama = JSON.stringify({
|
||||
@@ -75,6 +75,9 @@ export function transformToOllama(response, model) {
|
||||
}
|
||||
});
|
||||
|
||||
if (!response.body) {
|
||||
return new Response("", { status: response.status, headers: { "Content-Type": "application/x-ndjson" } });
|
||||
}
|
||||
return new Response(response.body.pipeThrough(transform), {
|
||||
headers: { "Content-Type": "application/x-ndjson", "Access-Control-Allow-Origin": "*" }
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user