From 4fa0bbd5233cc873f7cc538d4c2135897a6057d0 Mon Sep 17 00:00:00 2001 From: Ali Salimli <67149699+elisalimli@users.noreply.github.com> Date: Fri, 3 May 2024 10:25:26 +0400 Subject: [PATCH] chore: add missing gpt models (#989) --- libs/superagent/app/utils/llm.py | 12 ++++++++++++ .../migration.sql | 14 ++++++++++++++ libs/superagent/prisma/schema.prisma | 7 +++++++ 3 files changed, 33 insertions(+) create mode 100644 libs/superagent/prisma/migrations/20240503060243_update_gpt_4_models/migration.sql diff --git a/libs/superagent/app/utils/llm.py b/libs/superagent/app/utils/llm.py index e4deb74a8..e277f22dc 100644 --- a/libs/superagent/app/utils/llm.py +++ b/libs/superagent/app/utils/llm.py @@ -4,11 +4,17 @@ "GPT_3_5_TURBO_16K_0613": "gpt-3.5-turbo-16k-0613", "GPT_3_5_TURBO_0613": "gpt-3.5-turbo-0613", "GPT_3_5_TURBO_1106": "gpt-3.5-turbo-1106", + "GPT_3_5_TURBO": "gpt-3.5-turbo", "GPT_4_0613": "gpt-4-0613", "GPT_4_32K_0613": "gpt-4-32k-0613", + "GPT_4_32K": "gpt-4-32k", "GPT_4_1106_PREVIEW": "gpt-4-1106-preview", "GPT_4_TURBO_PREVIEW": "gpt-4-turbo-preview", "GPT_3_5_TURBO_0125": "gpt-3.5-turbo-0125", + "GPT_4": "gpt-4", + "GPT_4_TURBO": "gpt-4-turbo", + "GPT_4_TURBO_2024_04_09": "gpt-4-turbo-2024-04-09", + "GPT_4_0125_PREVIEW": "gpt-4-0125-preview", } LLM_REVERSE_MAPPING = {v: k for k, v in LLM_MAPPING.items()} @@ -16,6 +22,7 @@ LLM_PROVIDER_MAPPING = { "OPENAI": [ + "GPT_3_5_TURBO", "GPT_3_5_TURBO_16K_0613", "GPT_3_5_TURBO_0613", "GPT_3_5_TURBO_1106", @@ -24,6 +31,11 @@ "GPT_4_32K_0613", "GPT_4_1106_PREVIEW", "GPT_4_TURBO_PREVIEW", + "GPT_4", + "GPT_4_TURBO", + "GPT_4_TURBO_2024_04_09", + "GPT_4_0125_PREVIEW", + "GPT_4_32K", ] } diff --git a/libs/superagent/prisma/migrations/20240503060243_update_gpt_4_models/migration.sql b/libs/superagent/prisma/migrations/20240503060243_update_gpt_4_models/migration.sql new file mode 100644 index 000000000..c6d5951fa --- /dev/null +++ b/libs/superagent/prisma/migrations/20240503060243_update_gpt_4_models/migration.sql @@ -0,0 +1,14 @@ +-- AlterEnum +-- This migration adds more than one value to an enum. +-- With PostgreSQL versions 11 and earlier, this is not possible +-- in a single migration. This can be worked around by creating +-- multiple migrations, each migration adding only one value to +-- the enum. + + +ALTER TYPE "LLMModel" ADD VALUE 'GPT_3_5_TURBO'; +ALTER TYPE "LLMModel" ADD VALUE 'GPT_4'; +ALTER TYPE "LLMModel" ADD VALUE 'GPT_4_32K'; +ALTER TYPE "LLMModel" ADD VALUE 'GPT_4_0125_PREVIEW'; +ALTER TYPE "LLMModel" ADD VALUE 'GPT_4_TURBO'; +ALTER TYPE "LLMModel" ADD VALUE 'GPT_4_TURBO_2024_04_09'; diff --git a/libs/superagent/prisma/schema.prisma b/libs/superagent/prisma/schema.prisma index d10bb6620..65d5d151a 100644 --- a/libs/superagent/prisma/schema.prisma +++ b/libs/superagent/prisma/schema.prisma @@ -30,14 +30,21 @@ enum LLMProvider { } enum LLMModel { + GPT_3_5_TURBO GPT_3_5_TURBO_16K_0613 GPT_3_5_TURBO_0613 GPT_3_5_TURBO_1106 GPT_3_5_TURBO_0125 + + GPT_4 GPT_4_0613 + GPT_4_32K GPT_4_32K_0613 GPT_4_1106_PREVIEW + GPT_4_0125_PREVIEW + GPT_4_TURBO GPT_4_TURBO_PREVIEW + GPT_4_TURBO_2024_04_09 MISTRAL_7B_INSTRUCT_V01 MIXTRAL_8X7B_INSTRUCT_V01 }