fix: Change base_url to full_url

This commit is contained in:
hiro 2023-12-08 22:42:07 +07:00
parent b939692187
commit f9e73b0bbd
3 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@ import { Model } from "@janhq/core";
declare const MODULE: string; declare const MODULE: string;
declare interface EngineSettings { declare interface EngineSettings {
base_url?: string; full_url?: string;
api_key?: string; api_key?: string;
} }

View File

@ -22,7 +22,7 @@ export function requestInference(
// Model parameters spreading // Model parameters spreading
...model.parameters, ...model.parameters,
}); });
fetch(`${engine.base_url}/chat/completions`, { fetch(`${engine.full_url}`, {
method: "POST", method: "POST",
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",

View File

@ -37,7 +37,7 @@ export default class JanInferenceOpenAIExtension implements InferenceExtension {
private static _currentModel: OpenAIModel; private static _currentModel: OpenAIModel;
private static _engineSettings: EngineSettings = { private static _engineSettings: EngineSettings = {
base_url: "https://api.openai.com/v1", full_url: "https://api.openai.com/v1/chat/completion",
api_key: "sk-<your key here>", api_key: "sk-<your key here>",
}; };