diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 7b53804e51..35fba0b086 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -64,6 +64,11 @@ jobs: if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' run: poetry install --no-interaction --no-root - name: Run Flake8 Linter + if: ${{ !cancelled() }} run: poetry run flake8 . + - name: Check migrations + if: ${{ !cancelled() }} + run: poetry run python manage.py makemigrations --dry-run --check - name: "Run he backend unit tests" + if: ${{ !cancelled() }} run: poetry run pytest ./tests/unit diff --git a/fab_credits/migrations/0003_alter_userusage_model_name.py b/fab_credits/migrations/0003_alter_userusage_model_name.py new file mode 100644 index 0000000000..7235f7eab6 --- /dev/null +++ b/fab_credits/migrations/0003_alter_userusage_model_name.py @@ -0,0 +1,35 @@ +# Generated by Django 5.0.8 on 2024-09-05 08:01 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ( + "fab_credits", + "0002_alter_userusage_unique_together_userusage_model_name_and_more", + ), + ] + + operations = [ + migrations.AlterField( + model_name="userusage", + name="model_name", + field=models.CharField( + choices=[ + ("gpt-4o", "gpt-4o"), + ("gpt-4o-mini", "gpt-4o-mini"), + ("gpt-4o-2024-05-13", "gpt-4o-2024-05-13"), + ("gpt-3.5-turbo-0125", "gpt-3.5-turbo-0125"), + ("gpt-3.5-turbo-instruct", "gpt-3.5-turbo-instruct"), + ("claude-3-5-sonnet-20240620", "claude-3-5-sonnet-20240620"), + ("claude-3-opus-20240229", "claude-3-opus-20240229"), + ("claude-3-sonnet-20240229", "claude-3-sonnet-20240229"), + ("claude-3-haiku-20240307", "claude-3-haiku-20240307"), + ], + default="gpt-4o", + max_length=50, + ), + ), + ] diff --git a/fab_credits/models.py b/fab_credits/models.py index 200e429324..c74224b514 100644 --- a/fab_credits/models.py +++ b/fab_credits/models.py @@ -4,6 +4,7 @@ available_models = [ ("gpt-4o", "gpt-4o"), + ("gpt-4o-mini", "gpt-4o-mini"), ("gpt-4o-2024-05-13", "gpt-4o-2024-05-13"), ("gpt-3.5-turbo-0125", "gpt-3.5-turbo-0125"), ("gpt-3.5-turbo-instruct", "gpt-3.5-turbo-instruct"),