diff --git a/app/api/chat/azure/route.ts b/app/api/chat/azure/route.ts index 642eb771fe..106be08ec5 100644 --- a/app/api/chat/azure/route.ts +++ b/app/api/chat/azure/route.ts @@ -23,6 +23,9 @@ export async function POST(request: Request) { case "gpt-3.5-turbo": DEPLOYMENT_ID = profile.azure_openai_35_turbo_id || "" break + case "gpt-4o": + DEPLOYMENT_ID = profile.azure_openai_45_o_id || "" + break case "gpt-4-turbo-preview": DEPLOYMENT_ID = profile.azure_openai_45_turbo_id || "" break diff --git a/components/utility/profile-settings.tsx b/components/utility/profile-settings.tsx index ec123c04c6..5f397ab0cb 100644 --- a/components/utility/profile-settings.tsx +++ b/components/utility/profile-settings.tsx @@ -91,6 +91,9 @@ export const ProfileSettings: FC = ({}) => { const [azureOpenai35TurboID, setAzureOpenai35TurboID] = useState( profile?.azure_openai_35_turbo_id || "" ) + const [azureOpenai45OID, setAzureOpenai45OID] = useState( + profile?.azure_openai_45_o_id || "" + ) const [azureOpenai45TurboID, setAzureOpenai45TurboID] = useState( profile?.azure_openai_45_turbo_id || "" ) @@ -154,6 +157,7 @@ export const ProfileSettings: FC = ({}) => { azure_openai_api_key: azureOpenaiAPIKey, azure_openai_endpoint: azureOpenaiEndpoint, azure_openai_35_turbo_id: azureOpenai35TurboID, + azure_openai_45_o_id: azureOpenai45OID, azure_openai_45_turbo_id: azureOpenai45TurboID, azure_openai_45_vision_id: azureOpenai45VisionID, azure_openai_embeddings_id: azureEmbeddingsID, @@ -535,6 +539,28 @@ export const ProfileSettings: FC = ({}) => { } + { +
+ {envKeyMap["azure_gpt_45_o_name"] ? ( + + ) : ( + <> + + + + setAzureOpenai45OID(e.target.value) + } + /> + + )} +
+ } + {
{envKeyMap["azure_gpt_45_turbo_name"] ? ( diff --git a/supabase/migrations/20240526065246_add_azure_openai_45_o_id_to_profiles.sql b/supabase/migrations/20240526065246_add_azure_openai_45_o_id_to_profiles.sql new file mode 100644 index 0000000000..1be3d9e95f --- /dev/null +++ b/supabase/migrations/20240526065246_add_azure_openai_45_o_id_to_profiles.sql @@ -0,0 +1,3 @@ +alter table "public"."profiles" add column "azure_openai_45_o_id" text default ''::text; + + diff --git a/supabase/types.ts b/supabase/types.ts index e54950274a..a4c6cab6ca 100644 --- a/supabase/types.ts +++ b/supabase/types.ts @@ -1105,6 +1105,7 @@ export type Database = { Row: { anthropic_api_key: string | null azure_openai_35_turbo_id: string | null + azure_openai_45_o_id: string | null azure_openai_45_turbo_id: string | null azure_openai_45_vision_id: string | null azure_openai_api_key: string | null @@ -1133,6 +1134,7 @@ export type Database = { Insert: { anthropic_api_key?: string | null azure_openai_35_turbo_id?: string | null + azure_openai_45_o_id?: string | null azure_openai_45_turbo_id?: string | null azure_openai_45_vision_id?: string | null azure_openai_api_key?: string | null @@ -1161,6 +1163,7 @@ export type Database = { Update: { anthropic_api_key?: string | null azure_openai_35_turbo_id?: string | null + azure_openai_45_o_id?: string | null azure_openai_45_turbo_id?: string | null azure_openai_45_vision_id?: string | null azure_openai_api_key?: string | null