diff --git a/core/src/types/engine/index.ts b/core/src/types/engine/index.ts index fc41caf7a0..7c848a2794 100644 --- a/core/src/types/engine/index.ts +++ b/core/src/types/engine/index.ts @@ -6,7 +6,7 @@ export type Engines = { export type EngineMetadata = { get_models_url?: string - api_key_template?: string + header_template?: string transform_req?: { chat_completions?: { url?: string diff --git a/web/containers/ModelDropdown/index.tsx b/web/containers/ModelDropdown/index.tsx index 7bbb1b2646..7a12642ff0 100644 --- a/web/containers/ModelDropdown/index.tsx +++ b/web/containers/ModelDropdown/index.tsx @@ -142,7 +142,7 @@ const ModelDropdown = ({ .filter((e) => { if (searchFilter === 'local') { return ( - engineList.find((t) => t.engine.engine === e.engine)?.type === + engineList.find((t) => t.engine?.engine === e.engine)?.type === 'local' ) } diff --git a/web/screens/Settings/Engines/ModalAddRemoteEngine.tsx b/web/screens/Settings/Engines/ModalAddRemoteEngine.tsx index b5bb02c01a..871066f106 100644 --- a/web/screens/Settings/Engines/ModalAddRemoteEngine.tsx +++ b/web/screens/Settings/Engines/ModalAddRemoteEngine.tsx @@ -13,7 +13,7 @@ const engineSchema = z.object({ engineName: z.string().min(1, 'Engine name is required'), apiUrl: z.string().url('Enter a valid API URL'), modelListUrl: z.string().url('Enter a valid Model List URL'), - apiKeyTemplate: z.string().optional(), + headerTemplate: z.string().optional(), apiKey: z.string().optional(), requestFormat: z.string().optional(), responseFormat: z.string().optional(), @@ -32,7 +32,7 @@ const ModalAddRemoteEngine = () => { engineName: '', apiUrl: '', modelListUrl: '', - apiKeyTemplate: '', + headerTemplate: '', apiKey: '', requestFormat: '', responseFormat: '', @@ -46,7 +46,7 @@ const ModalAddRemoteEngine = () => { engine: data.engineName, api_key: data.apiKey, metadata: { - api_key_template: data.apiKeyTemplate, + header_template: data.headerTemplate, get_models_url: data.modelListUrl, transform_req: { chat_completions: { @@ -148,37 +148,37 @@ const ModalAddRemoteEngine = () => {
-
-
diff --git a/web/screens/Settings/Engines/RemoteEngineSettings.tsx b/web/screens/Settings/Engines/RemoteEngineSettings.tsx index 2a76482418..55fdbb7ada 100644 --- a/web/screens/Settings/Engines/RemoteEngineSettings.tsx +++ b/web/screens/Settings/Engines/RemoteEngineSettings.tsx @@ -213,19 +213,19 @@ const RemoteEngineSettings = ({
- API Key Template + Request Headers Template

- Template for authorization header format. + Template for request headers format.

- handleChange( - 'metadata.api_key_template', + 'metadata.header_template', e.target.value ) }