Skip to content

Commit

Permalink
Add GPT 4 Turbo Model (#411)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashesh3 authored Dec 9, 2023
1 parent 4cb060b commit 110ad26
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
43 changes: 43 additions & 0 deletions ayushma/migrations/0050_alter_chat_model_alter_project_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Generated by Django 4.2.6 on 2023-12-09 13:43

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("ayushma", "0049_chat_thread_id_project_assistant_id"),
]

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"),
],
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"),
],
default=1,
),
),
]
1 change: 1 addition & 0 deletions ayushma/models/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class ModelType(IntegerChoices):
GPT_4 = 3
GPT_4_32K = 4
GPT_4_VISUAL = 5
GPT_4_TURBO = 6


class StatusChoices(IntegerChoices):
Expand Down
2 changes: 2 additions & 0 deletions ayushma/utils/langchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def get_model_name(model_type: ModelType):
return "gpt-4-32k"
elif model_type == ModelType.GPT_4_VISUAL:
return "gpt-4-vision-preview"
elif model_type == ModelType.GPT_4_TURBO:
return "gpt-4-1106-preview"
else:
if settings.OPENAI_API_TYPE == "azure":
return settings.AZURE_CHAT_MODEL
Expand Down

0 comments on commit 110ad26

Please sign in to comment.