45 lines
2.3 KiB
Python
45 lines
2.3 KiB
Python
# Generated by Django 5.2.12 on 2026-07-29 14:39
|
|
|
|
import django.db.models.deletion
|
|
import encrypted_model_fields.fields
|
|
from django.conf import settings
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('ai', '0001_initial'),
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='AgentConfig',
|
|
fields=[
|
|
('id', models.AutoField(primary_key=True, serialize=False)),
|
|
('name', models.CharField(max_length=100)),
|
|
('description', models.TextField(blank=True)),
|
|
('provider', models.CharField(choices=[('openai', 'OpenAI'), ('google', 'Google Gemini'), ('deepseek', 'DeepSeek'), ('ollama', 'Ollama'), ('custom', 'Custom')], default='openai', max_length=20)),
|
|
('api_key', encrypted_model_fields.fields.EncryptedCharField(blank=True, default='')),
|
|
('api_secret', encrypted_model_fields.fields.EncryptedCharField(blank=True, default='')),
|
|
('base_url', models.URLField(blank=True, default='', max_length=500)),
|
|
('model_name', models.CharField(default='gpt-4o', max_length=100)),
|
|
('system_prompt', models.TextField(blank=True, default='')),
|
|
('temperature', models.FloatField(default=0.7)),
|
|
('max_tokens', models.IntegerField(default=2000)),
|
|
('capabilities', models.JSONField(blank=True, default=list)),
|
|
('is_active', models.BooleanField(default=True)),
|
|
('is_default', models.BooleanField(default=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='agent_configs', to=settings.AUTH_USER_MODEL)),
|
|
],
|
|
options={
|
|
'verbose_name': 'Agent Configuration',
|
|
'verbose_name_plural': 'Agent Configurations',
|
|
'db_table': 'agent_configs',
|
|
'constraints': [models.UniqueConstraint(fields=('user', 'name'), name='unique_agent_per_user')],
|
|
},
|
|
),
|
|
]
|