diff --git a/frontend/src/features/providers/components/EndpointFormDialog.vue b/frontend/src/features/providers/components/EndpointFormDialog.vue index 222537a..add84ca 100644 --- a/frontend/src/features/providers/components/EndpointFormDialog.vue +++ b/frontend/src/features/providers/components/EndpointFormDialog.vue @@ -296,7 +296,7 @@ const form = ref({ base_url: '', custom_path: '', timeout: 300, - max_retries: 3, + max_retries: 2, max_concurrent: undefined as number | undefined, rate_limit: undefined as number | undefined, is_active: true, @@ -392,7 +392,7 @@ function resetForm() { base_url: '', custom_path: '', timeout: 300, - max_retries: 3, + max_retries: 2, max_concurrent: undefined, rate_limit: undefined, is_active: true, diff --git a/frontend/src/mocks/handler.ts b/frontend/src/mocks/handler.ts index 6ecb7f3..cab5319 100644 --- a/frontend/src/mocks/handler.ts +++ b/frontend/src/mocks/handler.ts @@ -425,9 +425,9 @@ const MOCK_ENDPOINT_KEYS = [ // Mock Endpoints const MOCK_ENDPOINTS = [ - { id: 'ep-001', provider_id: 'provider-001', provider_name: 'anthropic', api_format: 'claude', base_url: 'https://api.anthropic.com', auth_type: 'bearer', timeout: 120, max_retries: 3, priority: 100, weight: 100, health_score: 98, consecutive_failures: 0, is_active: true, total_keys: 2, active_keys: 2, created_at: '2024-01-01T00:00:00Z', updated_at: new Date().toISOString() }, - { id: 'ep-002', provider_id: 'provider-002', provider_name: 'openai', api_format: 'openai', base_url: 'https://api.openai.com', auth_type: 'bearer', timeout: 60, max_retries: 3, priority: 90, weight: 100, health_score: 97, consecutive_failures: 0, is_active: true, total_keys: 1, active_keys: 1, created_at: '2024-01-01T00:00:00Z', updated_at: new Date().toISOString() }, - { id: 'ep-003', provider_id: 'provider-003', provider_name: 'google', api_format: 'gemini', base_url: 'https://generativelanguage.googleapis.com', auth_type: 'api_key', timeout: 60, max_retries: 3, priority: 80, weight: 100, health_score: 96, consecutive_failures: 0, is_active: true, total_keys: 1, active_keys: 1, created_at: '2024-01-15T00:00:00Z', updated_at: new Date().toISOString() } + { id: 'ep-001', provider_id: 'provider-001', provider_name: 'anthropic', api_format: 'claude', base_url: 'https://api.anthropic.com', auth_type: 'bearer', timeout: 120, max_retries: 2, priority: 100, weight: 100, health_score: 98, consecutive_failures: 0, is_active: true, total_keys: 2, active_keys: 2, created_at: '2024-01-01T00:00:00Z', updated_at: new Date().toISOString() }, + { id: 'ep-002', provider_id: 'provider-002', provider_name: 'openai', api_format: 'openai', base_url: 'https://api.openai.com', auth_type: 'bearer', timeout: 60, max_retries: 2, priority: 90, weight: 100, health_score: 97, consecutive_failures: 0, is_active: true, total_keys: 1, active_keys: 1, created_at: '2024-01-01T00:00:00Z', updated_at: new Date().toISOString() }, + { id: 'ep-003', provider_id: 'provider-003', provider_name: 'google', api_format: 'gemini', base_url: 'https://generativelanguage.googleapis.com', auth_type: 'api_key', timeout: 60, max_retries: 2, priority: 80, weight: 100, health_score: 96, consecutive_failures: 0, is_active: true, total_keys: 1, active_keys: 1, created_at: '2024-01-15T00:00:00Z', updated_at: new Date().toISOString() } ] // Mock 能力定义 @@ -1224,7 +1224,7 @@ function generateMockEndpointsForProvider(providerId: string) { 'https://generativelanguage.googleapis.com', auth_type: format.includes('GEMINI') ? 'api_key' : 'bearer', timeout: 120, - max_retries: 3, + max_retries: 2, priority: 100 - index * 10, weight: 100, health_score: healthDetail?.health_score ?? 1.0, diff --git a/src/api/admin/system.py b/src/api/admin/system.py index ca0b06e..aa4a698 100644 --- a/src/api/admin/system.py +++ b/src/api/admin/system.py @@ -887,7 +887,7 @@ class AdminImportConfigAdapter(AdminApiAdapter): ) existing_ep.headers = ep_data.get("headers") existing_ep.timeout = ep_data.get("timeout", 300) - existing_ep.max_retries = ep_data.get("max_retries", 3) + existing_ep.max_retries = ep_data.get("max_retries", 2) existing_ep.max_concurrent = ep_data.get("max_concurrent") existing_ep.rate_limit = ep_data.get("rate_limit") existing_ep.is_active = ep_data.get("is_active", True) @@ -903,7 +903,7 @@ class AdminImportConfigAdapter(AdminApiAdapter): base_url=ep_data["base_url"], headers=ep_data.get("headers"), timeout=ep_data.get("timeout", 300), - max_retries=ep_data.get("max_retries", 3), + max_retries=ep_data.get("max_retries", 2), max_concurrent=ep_data.get("max_concurrent"), rate_limit=ep_data.get("rate_limit"), is_active=ep_data.get("is_active", True),