Fix LM Studio response payload format compatibility
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user