Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GPT-4o for Azure OpenAI #1755

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/api/chat/azure/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 || ""
1orZero marked this conversation as resolved.
Show resolved Hide resolved
break
case "gpt-4-turbo-preview":
DEPLOYMENT_ID = profile.azure_openai_45_turbo_id || ""
break
Expand Down
26 changes: 26 additions & 0 deletions components/utility/profile-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ export const ProfileSettings: FC<ProfileSettingsProps> = ({}) => {
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 || ""
)
Expand Down Expand Up @@ -154,6 +157,7 @@ export const ProfileSettings: FC<ProfileSettingsProps> = ({}) => {
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,
Expand Down Expand Up @@ -535,6 +539,28 @@ export const ProfileSettings: FC<ProfileSettingsProps> = ({}) => {
</div>
}

{
<div className="space-y-1">
{envKeyMap["azure_gpt_45_o_name"] ? (
<Label className="text-xs">
Azure GPT-4.5 O deployment name set by admin.
</Label>
) : (
<>
<Label>Azure GPT-4.5 O Deployment Name</Label>

<Input
placeholder="Azure GPT-4.5 O Deployment Name"
value={azureOpenai45OID}
onChange={e =>
setAzureOpenai45OID(e.target.value)
}
/>
</>
)}
</div>
}

{
<div className="space-y-1">
{envKeyMap["azure_gpt_45_turbo_name"] ? (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
alter table "public"."profiles" add column "azure_openai_45_o_id" text default ''::text;


3 changes: 3 additions & 0 deletions supabase/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down