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:
2026-01-23 18:16:12 +03:00
parent 3aac83474b
commit 5ec5ee48d4
5 changed files with 173 additions and 57 deletions

View File

@@ -0,0 +1,18 @@
# Generated by Django 5.0.10 on 2026-01-23 15:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('integrations', '0009_alter_glmintegration_model_name_and_more'),
]
operations = [
migrations.AlterField(
model_name='openrouterintegration',
name='model_name',
field=models.CharField(blank=True, default='', help_text='Название используемой модели OpenRouter (загружается автоматически)', max_length=200, verbose_name='Название модели'),
),
]