diff --git a/backend/core/models/brains.py b/backend/core/models/brains.py index ab7af6d62..9ccdf6ef8 100644 --- a/backend/core/models/brains.py +++ b/backend/core/models/brains.py @@ -16,7 +16,7 @@ class Brain(BaseModel): name: Optional[str] = "Default brain" description: Optional[str] = "This is a description" status: Optional[str] = "private" - model: Optional[str] = "gpt-3.5-turbo-0613" + model: Optional[str] = "gpt-3.5-turbo" temperature: Optional[float] = 0.0 max_tokens: Optional[int] = 256 openai_api_key: Optional[str] = None diff --git a/backend/core/models/chats.py b/backend/core/models/chats.py index c89d2da65..e1cbb0f99 100644 --- a/backend/core/models/chats.py +++ b/backend/core/models/chats.py @@ -17,7 +17,7 @@ class ChatMessage(BaseModel): class ChatQuestion(BaseModel): - model: str = "gpt-3.5-turbo-0613" + model: str = "gpt-3.5-turbo" question: str temperature: float = 0.0 max_tokens: int = 256 diff --git a/backend/core/models/databases/supabase/brains.py b/backend/core/models/databases/supabase/brains.py index 4eec64a01..1320a924e 100644 --- a/backend/core/models/databases/supabase/brains.py +++ b/backend/core/models/databases/supabase/brains.py @@ -13,7 +13,7 @@ class CreateBrainProperties(BaseModel): name: Optional[str] = "Default brain" description: Optional[str] = "This is a description" status: Optional[str] = "private" - model: Optional[str] = "gpt-3.5-turbo-0613" + model: Optional[str] = "gpt-3.5-turbo" temperature: Optional[float] = 0.0 max_tokens: Optional[int] = 256 openai_api_key: Optional[str] = None diff --git a/backend/core/routes/chat_routes.py b/backend/core/routes/chat_routes.py index 4c0aaa93a..b6535fdee 100644 --- a/backend/core/routes/chat_routes.py +++ b/backend/core/routes/chat_routes.py @@ -182,7 +182,7 @@ async def create_question_handler( or not chat_question.max_tokens ): # TODO: create ChatConfig class (pick config from brain or user or chat) and use it here - chat_question.model = chat_question.model or brain.model or "gpt-3.5-turbo-0613" + chat_question.model = chat_question.model or brain.model or "gpt-3.5-turbo" chat_question.temperature = chat_question.temperature or brain.temperature or 0 chat_question.max_tokens = chat_question.max_tokens or brain.max_tokens or 256 @@ -254,7 +254,7 @@ async def create_stream_question_handler( or not chat_question.max_tokens ): # TODO: create ChatConfig class (pick config from brain or user or chat) and use it here - chat_question.model = chat_question.model or brain.model or "gpt-3.5-turbo-0613" + chat_question.model = chat_question.model or brain.model or "gpt-3.5-turbo" chat_question.temperature = chat_question.temperature or brain.temperature or 0 chat_question.max_tokens = chat_question.max_tokens or brain.max_tokens or 256 diff --git a/backend/core/tests/test_brains.py b/backend/core/tests/test_brains.py index 5c7e571af..5e75bb823 100644 --- a/backend/core/tests/test_brains.py +++ b/backend/core/tests/test_brains.py @@ -29,7 +29,7 @@ def test_create_brain(client, api_key): payload = { "name": random_brain_name, "status": "public", - "model": "gpt-3.5-turbo-0613", + "model": "gpt-3.5-turbo", "temperature": 0, "max_tokens": 256, "file_sha1": "", @@ -173,7 +173,7 @@ def test_set_as_default_brain_endpoint(client, api_key): payload = { "name": random_brain_name, "status": "public", - "model": "gpt-3.5-turbo-0613", + "model": "gpt-3.5-turbo", "temperature": 0, "max_tokens": 256, } diff --git a/backend/core/tests/test_chats.py b/backend/core/tests/test_chats.py index 567a8660b..c2523bc84 100644 --- a/backend/core/tests/test_chats.py +++ b/backend/core/tests/test_chats.py @@ -50,7 +50,7 @@ def test_create_chat_and_talk(client, api_key): response = client.post( f"/chat/{chat_id}/question?brain_id={default_brain_id}", json={ - "model": "gpt-3.5-turbo-0613", + "model": "gpt-3.5-turbo", "question": "Hello, how are you?", "temperature": "0", "max_tokens": "256", @@ -100,7 +100,7 @@ def test_create_chat_and_talk_with_no_brain(client, api_key): response = client.post( f"/chat/{chat_id}/question?brain_id=", json={ - "model": "gpt-3.5-turbo-0613", + "model": "gpt-3.5-turbo", "question": "Hello, how are you?", "temperature": "0", "max_tokens": "256", diff --git a/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/SettingsTab.tsx b/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/SettingsTab.tsx index c1f4cb2f8..7babf96dd 100644 --- a/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/SettingsTab.tsx +++ b/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/SettingsTab.tsx @@ -10,8 +10,11 @@ import Button from "@/lib/components/ui/Button"; import { Divider } from "@/lib/components/ui/Divider"; import Field from "@/lib/components/ui/Field"; import { TextArea } from "@/lib/components/ui/TextArea"; -import { models, paidModels } from "@/lib/context/BrainConfigProvider/types"; -import { defineMaxTokens } from "@/lib/helpers/defineMexTokens"; +import { + freeModels, + paidModels, +} from "@/lib/context/BrainConfigProvider/types"; +import { defineMaxTokens } from "@/lib/helpers/defineMaxTokens"; import { PublicPrompts } from "./components/PublicPrompts/PublicPrompts"; import { useSettingsTab } from "./hooks/useSettingsTab"; @@ -99,7 +102,7 @@ export const SettingsTab = ({ brainId }: SettingsTabProps): JSX.Element => { {...register("model")} className="px-5 py-2 dark:bg-gray-700 bg-gray-200 rounded-md" > - {(openAiKey !== undefined ? paidModels : models).map( + {(openAiKey !== undefined ? paidModels : freeModels).map( (availableModel) => ( @@ -85,7 +85,7 @@ export const ConfigModal = ({ chatId }: { chatId?: string }): JSX.Element => { diff --git a/frontend/app/chat/[chatId]/components/ChatInput/components/ConfigModal/hooks/useConfigModal.ts b/frontend/app/chat/[chatId]/components/ChatInput/components/ConfigModal/hooks/useConfigModal.ts index 506a7bc6e..2fd85cccd 100644 --- a/frontend/app/chat/[chatId]/components/ChatInput/components/ConfigModal/hooks/useConfigModal.ts +++ b/frontend/app/chat/[chatId]/components/ChatInput/components/ConfigModal/hooks/useConfigModal.ts @@ -10,7 +10,7 @@ import { import { useBrainConfig } from "@/lib/context/BrainConfigProvider"; import { useBrainContext } from "@/lib/context/BrainProvider/hooks/useBrainContext"; import { ChatConfig } from "@/lib/context/ChatProvider/types"; -import { defineMaxTokens } from "@/lib/helpers/defineMexTokens"; +import { defineMaxTokens } from "@/lib/helpers/defineMaxTokens"; import { useToast } from "@/lib/hooks"; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types diff --git a/frontend/lib/api/brain/__tests__/useBrainApi.test.ts b/frontend/lib/api/brain/__tests__/useBrainApi.test.ts index e2ee7c588..4d37e7991 100644 --- a/frontend/lib/api/brain/__tests__/useBrainApi.test.ts +++ b/frontend/lib/api/brain/__tests__/useBrainApi.test.ts @@ -66,7 +66,7 @@ describe("useBrainApi", () => { name: "Test Brain", description: "This is a description", status: "public", - model: "gpt-3.5-turbo-0613", + model: "gpt-3.5-turbo", temperature: 0.0, max_tokens: 256, openai_api_key: "123", @@ -217,7 +217,7 @@ describe("useBrainApi", () => { name: "Test Brain", description: "This is a description", status: "public", - model: "gpt-3.5-turbo-0613", + model: "gpt-3.5-turbo", temperature: 0.0, max_tokens: 256, openai_api_key: "123", diff --git a/frontend/lib/components/AddBrainModal/AddBrainModal.tsx b/frontend/lib/components/AddBrainModal/AddBrainModal.tsx index e5c8efc3a..4498867a8 100644 --- a/frontend/lib/components/AddBrainModal/AddBrainModal.tsx +++ b/frontend/lib/components/AddBrainModal/AddBrainModal.tsx @@ -7,8 +7,11 @@ import { PublicPrompts } from "@/app/brains-management/[brainId]/components/Brai import Button from "@/lib/components/ui/Button"; import Field from "@/lib/components/ui/Field"; import { Modal } from "@/lib/components/ui/Modal"; -import { models, paidModels } from "@/lib/context/BrainConfigProvider/types"; -import { defineMaxTokens } from "@/lib/helpers/defineMexTokens"; +import { + freeModels, + paidModels, +} from "@/lib/context/BrainConfigProvider/types"; +import { defineMaxTokens } from "@/lib/helpers/defineMaxTokens"; import { useAddBrainModal } from "./hooks/useAddBrainModal"; import { Divider } from "../ui/Divider"; @@ -84,7 +87,7 @@ export const AddBrainModal = (): JSX.Element => { {...register("model")} className="px-5 py-2 dark:bg-gray-700 bg-gray-200 rounded-md" > - {(openAiKey !== undefined ? paidModels : models).map( + {(openAiKey !== undefined ? paidModels : freeModels).map( (availableModel) => (