mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 05:31:23 +00:00
feat(gateway): add config toggle for chat completions endpoint
This commit is contained in:
@@ -328,6 +328,11 @@ export type GatewayServerOptions = {
|
||||
* Default: config `gateway.controlUi.enabled` (or true when absent).
|
||||
*/
|
||||
controlUiEnabled?: boolean;
|
||||
/**
|
||||
* If false, do not serve `POST /v1/chat/completions`.
|
||||
* Default: config `gateway.http.endpoints.chatCompletions.enabled` (or true when absent).
|
||||
*/
|
||||
openAiChatCompletionsEnabled?: boolean;
|
||||
/**
|
||||
* Override gateway auth configuration (merges with config).
|
||||
*/
|
||||
@@ -432,6 +437,10 @@ export async function startGatewayServer(
|
||||
}
|
||||
const controlUiEnabled =
|
||||
opts.controlUiEnabled ?? cfgAtStart.gateway?.controlUi?.enabled ?? true;
|
||||
const openAiChatCompletionsEnabled =
|
||||
opts.openAiChatCompletionsEnabled ??
|
||||
cfgAtStart.gateway?.http?.endpoints?.chatCompletions?.enabled ??
|
||||
true;
|
||||
const controlUiBasePath = normalizeControlUiBasePath(
|
||||
cfgAtStart.gateway?.controlUi?.basePath,
|
||||
);
|
||||
@@ -615,6 +624,7 @@ export async function startGatewayServer(
|
||||
canvasHost,
|
||||
controlUiEnabled,
|
||||
controlUiBasePath,
|
||||
openAiChatCompletionsEnabled,
|
||||
handleHooksRequest,
|
||||
resolvedAuth,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user