Files
octopus/myproject/integrations/urls.py
Andrey Smakotin 5ec5ee48d4 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>
2026-01-23 18:16:12 +03:00

30 lines
1.0 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from django.urls import path
from .views import (
IntegrationsListView,
toggle_integration,
save_integration_settings,
get_integration_form_data,
test_integration_connection,
RecommerceBatchSyncView,
get_openrouter_models,
)
app_name = 'integrations'
urlpatterns = [
# Страница со списком интеграций
path("", IntegrationsListView.as_view(), name="list"),
# API endpoints для управления интеграциями
path("toggle/<str:integration_id>/", toggle_integration, name="toggle"),
path("settings/<str:integration_id>/", save_integration_settings, name="settings"),
path("form/<str:integration_id>/", get_integration_form_data, name="form_data"),
path("test/<str:integration_id>/", test_integration_connection, name="test"),
# Синхронизация
path("recommerce/sync/", RecommerceBatchSyncView.as_view(), name="recommerce_sync"),
# OpenRouter модели
path("openrouter/models/", get_openrouter_models, name="openrouter_models"),
]