# Generated by Django 5.2.3 on 2025-07-04 03:18

import application.models.application
import django.db.models.deletion
import uuid_utils.compat
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('application', '0003_chat_asker_chat_meta_and_more'),
        ('users', '0001_initial'),
    ]

    operations = [
        migrations.AddField(
            model_name='application',
            name='publish_time',
            field=models.DateTimeField(blank=True, default=None, null=True, verbose_name='发布时间'),
        ),
        migrations.CreateModel(
            name='ApplicationVersion',
            fields=[
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='修改时间')),
                ('id', models.UUIDField(default=uuid_utils.compat.uuid7, editable=False, primary_key=True, serialize=False, verbose_name='主键id')),
                ('name', models.CharField(default='', max_length=128, verbose_name='版本名称')),
                ('publish_user_id', models.UUIDField(default=None, null=True, verbose_name='发布者id')),
                ('publish_user_name', models.CharField(default='', max_length=128, verbose_name='发布者名称')),
                ('workspace_id', models.CharField(db_index=True, default='default', max_length=64, verbose_name='工作空间id')),
                ('application_name', models.CharField(max_length=128, verbose_name='应用名称')),
                ('desc', models.CharField(default='', max_length=512, verbose_name='引用描述')),
                ('prologue', models.CharField(default='', max_length=40960, verbose_name='开场白')),
                ('dialogue_number', models.IntegerField(default=0, verbose_name='会话数量')),
                ('model_id', models.UUIDField(blank=True, null=True, verbose_name='大语言模型')),
                ('knowledge_setting', models.JSONField(default=application.models.application.get_dataset_setting_dict, verbose_name='数据集参数设置')),
                ('model_setting', models.JSONField(default=application.models.application.get_model_setting_dict, verbose_name='模型参数相关设置')),
                ('model_params_setting', models.JSONField(default=dict, verbose_name='模型参数相关设置')),
                ('tts_model_params_setting', models.JSONField(default=dict, verbose_name='模型参数相关设置')),
                ('problem_optimization', models.BooleanField(default=False, verbose_name='问题优化')),
                ('icon', models.CharField(default='./favicon.ico', max_length=256, verbose_name='应用icon')),
                ('work_flow', models.JSONField(default=dict, verbose_name='工作流数据')),
                ('type', models.CharField(choices=[('SIMPLE', '简易'), ('WORK_FLOW', '工作流')], default='SIMPLE', max_length=256, verbose_name='应用类型')),
                ('problem_optimization_prompt', models.CharField(blank=True, default='()里面是用户问题,根据上下文回答揣测用户问题({question}) 要求: 输出一个补全问题,并且放在<data></data>标签中', max_length=102400, null=True, verbose_name='问题优化提示词')),
                ('tts_model_id', models.UUIDField(blank=True, null=True, verbose_name='文本转语音模型id')),
                ('stt_model_id', models.UUIDField(blank=True, null=True, verbose_name='语音转文本模型id')),
                ('tts_model_enable', models.BooleanField(default=False, verbose_name='语音合成模型是否启用')),
                ('stt_model_enable', models.BooleanField(default=False, verbose_name='语音识别模型是否启用')),
                ('tts_type', models.CharField(default='BROWSER', max_length=20, verbose_name='语音播放类型')),
                ('tts_autoplay', models.BooleanField(default=False, verbose_name='自动播放')),
                ('stt_autosend', models.BooleanField(default=False, verbose_name='自动发送')),
                ('clean_time', models.IntegerField(default=180, verbose_name='清理时间')),
                ('file_upload_enable', models.BooleanField(default=False, verbose_name='文件上传是否启用')),
                ('file_upload_setting', models.JSONField(default=dict, verbose_name='文件上传相关设置')),
                ('application', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='application.application')),
                ('user', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.SET_NULL, to='users.user')),
            ],
            options={
                'db_table': 'application_version',
            },
        ),
        migrations.DeleteModel(
            name='WorkFlowVersion',
        ),
    ]
