From 3a9e394814da5eb66fd541fb2ab46ed2b8e68b35 Mon Sep 17 00:00:00 2001 From: t0ng7u Date: Sat, 9 Aug 2025 09:33:13 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20Extend=20endpoint=20templat?= =?UTF-8?q?es=20to=20cover=20all=20native=20endpoints?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit updates the quick-fill endpoint templates used in the model and pre-fill group editors: • `EditModelModal.jsx` • `EditPrefillGroupModal.jsx` Key changes 1. Added missing default endpoints defined in `common/endpoint_defaults.go`. - `openai-response` - `gemini` - `jina-rerank` 2. Ensured each template entry includes both `path` and `method` for clarity. Benefits • Provides one-click access to every built-in upstream endpoint, reducing manual input. • Keeps the UI definitions in sync with backend defaults, preventing mismatch errors. --- web/src/components/table/models/modals/EditModelModal.jsx | 3 +++ .../components/table/models/modals/EditPrefillGroupModal.jsx | 3 +++ 2 files changed, 6 insertions(+) diff --git a/web/src/components/table/models/modals/EditModelModal.jsx b/web/src/components/table/models/modals/EditModelModal.jsx index 7e368aac..f2f50018 100644 --- a/web/src/components/table/models/modals/EditModelModal.jsx +++ b/web/src/components/table/models/modals/EditModelModal.jsx @@ -42,7 +42,10 @@ const { Text, Title } = Typography; // Example endpoint template for quick fill const ENDPOINT_TEMPLATE = { openai: { path: '/v1/chat/completions', method: 'POST' }, + 'openai-response': { path: '/v1/responses', method: 'POST' }, anthropic: { path: '/v1/messages', method: 'POST' }, + gemini: { path: '/v1beta/models/{model}:generateContent', method: 'POST' }, + 'jina-rerank': { path: '/rerank', method: 'POST' }, 'image-generation': { path: '/v1/images/generations', method: 'POST' }, }; diff --git a/web/src/components/table/models/modals/EditPrefillGroupModal.jsx b/web/src/components/table/models/modals/EditPrefillGroupModal.jsx index 88e802ae..1c172164 100644 --- a/web/src/components/table/models/modals/EditPrefillGroupModal.jsx +++ b/web/src/components/table/models/modals/EditPrefillGroupModal.jsx @@ -46,7 +46,10 @@ const { Text, Title } = Typography; // Example endpoint template for quick fill const ENDPOINT_TEMPLATE = { openai: { path: '/v1/chat/completions', method: 'POST' }, + 'openai-response': { path: '/v1/responses', method: 'POST' }, anthropic: { path: '/v1/messages', method: 'POST' }, + gemini: { path: '/v1beta/models/{model}:generateContent', method: 'POST' }, + 'jina-rerank': { path: '/rerank', method: 'POST' }, 'image-generation': { path: '/v1/images/generations', method: 'POST' }, };