Przeglądaj źródła

✨ feat: Extend endpoint templates to cover all native endpoints

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.
t0ng7u 4 miesięcy temu
rodzic
commit
3a9e394814

+ 3 - 0
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' },
 };
 

+ 3 - 0
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' },
 };