Fix LM Studio response payload format compatibility

This commit is contained in:
2026-07-22 17:14:50 -04:00
parent 9ccaec0e7c
commit 5044ccc67b
3 changed files with 16 additions and 18 deletions
+7 -6
View File
@@ -49,15 +49,16 @@ const callLMStudioCompletion = async (
headers["Authorization"] = `Bearer ${apiKey}`;
}
const payload: any = {
model: modelName || "local-model",
messages,
temperature: 0.3
};
const response = await fetch(targetUrl, {
method: "POST",
headers,
body: JSON.stringify({
model: modelName || "local-model",
messages,
temperature: 0.3,
response_format: { type: "json_object" }
})
body: JSON.stringify(payload)
});
if (!response.ok) {