From d60c51a03d963aa04b43be413d4d3fa3f26fb28b Mon Sep 17 00:00:00 2001 From: Shivank Kacker Date: Wed, 24 Jul 2024 21:49:39 +0530 Subject: [PATCH] added gpt 4 o mini --- ...54_alter_chat_model_alter_project_model.py | 48 +++++++++++++++++++ ayushma/models/enums.py | 1 + ayushma/utils/langchain.py | 5 +- 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 ayushma/migrations/0054_alter_chat_model_alter_project_model.py diff --git a/ayushma/migrations/0054_alter_chat_model_alter_project_model.py b/ayushma/migrations/0054_alter_chat_model_alter_project_model.py new file mode 100644 index 0000000..9304a05 --- /dev/null +++ b/ayushma/migrations/0054_alter_chat_model_alter_project_model.py @@ -0,0 +1,48 @@ +# Generated by Django 4.2.6 on 2024-07-24 14:21 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("ayushma", "0053_alter_chat_model_alter_project_model"), + ] + + operations = [ + migrations.AlterField( + model_name="chat", + name="model", + field=models.IntegerField( + blank=True, + choices=[ + (1, "Gpt 3 5"), + (2, "Gpt 3 5 16K"), + (3, "Gpt 4"), + (4, "Gpt 4 32K"), + (5, "Gpt 4 Visual"), + (6, "Gpt 4 Turbo"), + (7, "Gpt 4 Omni"), + (8, "Gpt 4 Omni Mini"), + ], + null=True, + ), + ), + migrations.AlterField( + model_name="project", + name="model", + field=models.IntegerField( + choices=[ + (1, "Gpt 3 5"), + (2, "Gpt 3 5 16K"), + (3, "Gpt 4"), + (4, "Gpt 4 32K"), + (5, "Gpt 4 Visual"), + (6, "Gpt 4 Turbo"), + (7, "Gpt 4 Omni"), + (8, "Gpt 4 Omni Mini"), + ], + default=1, + ), + ), + ] diff --git a/ayushma/models/enums.py b/ayushma/models/enums.py index eea3c91..64f89c6 100644 --- a/ayushma/models/enums.py +++ b/ayushma/models/enums.py @@ -48,6 +48,7 @@ class ModelType(IntegerChoices): GPT_4_VISUAL = 5 GPT_4_TURBO = 6 GPT_4_OMNI = 7 + GPT_4_OMNI_MINI = 8 class StatusChoices(IntegerChoices): diff --git a/ayushma/utils/langchain.py b/ayushma/utils/langchain.py index 56bf63a..da538ed 100644 --- a/ayushma/utils/langchain.py +++ b/ayushma/utils/langchain.py @@ -38,9 +38,12 @@ def get_model_name(model_type: ModelType): elif model_type == ModelType.GPT_4_VISUAL: return "gpt-4-vision-preview" elif model_type == ModelType.GPT_4_TURBO: - return "gpt-4-1106-preview" + return "gpt-4-turbo" elif model_type == ModelType.GPT_4_OMNI: return "gpt-4o" + elif model_type == ModelType.GPT_4_OMNI_MINI: + return "gpt-4o-mini" + else: if settings.OPENAI_API_TYPE == "azure": return settings.AZURE_CHAT_MODEL