feat(integrations): add dynamic OpenRouter model loading
- Remove hardcoded OPENROUTER_MODEL_CHOICES from openrouter.py
- Add API endpoint /integrations/openrouter/models/ to fetch models dynamically
- Models loaded from OpenRouter API with free models (':free') at top
- Update OpenRouterIntegration model_name field (remove choices, blank=True)
- Add async buildForm() with dynamic_choices support
- Show asterisks (********) for saved API keys with helpful placeholder
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@ from .views import (
|
||||
get_integration_form_data,
|
||||
test_integration_connection,
|
||||
RecommerceBatchSyncView,
|
||||
get_openrouter_models,
|
||||
)
|
||||
|
||||
app_name = 'integrations'
|
||||
@@ -22,4 +23,7 @@ urlpatterns = [
|
||||
|
||||
# Синхронизация
|
||||
path("recommerce/sync/", RecommerceBatchSyncView.as_view(), name="recommerce_sync"),
|
||||
|
||||
# OpenRouter модели
|
||||
path("openrouter/models/", get_openrouter_models, name="openrouter_models"),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user