Skip to content

Commit

Permalink
cr
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul committed Nov 5, 2024
1 parent d0ea4be commit 0a41bd1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
11 changes: 6 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=

# Azure OpenAI Configuration
AZURE_OPENAI_API_KEY=your-azure-openai-api-key
AZURE_OPENAI_API_INSTANCE_NAME=your-instance-name
AZURE_OPENAI_API_DEPLOYMENT_NAME=your-deployment-name
AZURE_OPENAI_API_VERSION=2024-08-01-preview
# ENSURE THEY ARE PREFIXED WITH AN UNDERSCORE.
_AZURE_OPENAI_API_KEY=your-azure-openai-api-key
_AZURE_OPENAI_API_INSTANCE_NAME=your-instance-name
_AZURE_OPENAI_API_DEPLOYMENT_NAME=your-deployment-name
_AZURE_OPENAI_API_VERSION=2024-08-01-preview
# Optional: Azure OpenAI Base Path (if using a different domain)
# AZURE_OPENAI_API_BASE_PATH=https://your-custom-domain.com/openai/deployments
# _AZURE_OPENAI_API_BASE_PATH=https://your-custom-domain.com/openai/deployments
10 changes: 5 additions & 5 deletions src/agent/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,14 @@ export const getModelConfig = (
modelName: actualModelName,
modelProvider: "azure_openai",
azureConfig: {
azureOpenAIApiKey: process.env.AZURE_OPENAI_API_KEY || "",
azureOpenAIApiKey: process.env._AZURE_OPENAI_API_KEY || "",
azureOpenAIApiInstanceName:
process.env.AZURE_OPENAI_API_INSTANCE_NAME || "",
process.env._AZURE_OPENAI_API_INSTANCE_NAME || "",
azureOpenAIApiDeploymentName:
process.env.AZURE_OPENAI_API_DEPLOYMENT_NAME || "",
process.env._AZURE_OPENAI_API_DEPLOYMENT_NAME || "",
azureOpenAIApiVersion:
process.env.AZURE_OPENAI_API_VERSION || "2024-08-01-preview",
azureOpenAIBasePath: process.env.AZURE_OPENAI_API_BASE_PATH,
process.env._AZURE_OPENAI_API_VERSION || "2024-08-01-preview",
azureOpenAIBasePath: process.env._AZURE_OPENAI_API_BASE_PATH,
},
};
}
Expand Down
2 changes: 2 additions & 0 deletions src/components/chat-interface/model-selector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
FIREWORKS_MODELS,
GEMINI_MODELS,
LS_HAS_SEEN_MODEL_DROPDOWN_ALERT,
AZURE_MODELS,
} from "@/constants";
import { Dispatch, SetStateAction, useState } from "react";
import { AlertNewModelSelectorFeature } from "./alert-new-model-selector";
Expand All @@ -26,6 +27,7 @@ const allModels = [
...OPENAI_MODELS,
...FIREWORKS_MODELS,
...GEMINI_MODELS,
...AZURE_MODELS,
];

const modelNameToLabel = (modelName: ALL_MODEL_NAMES) => {
Expand Down
1 change: 1 addition & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const AZURE_MODELS = [
name: "azure/gpt-4o-mini",
modelName: "gpt-4o-mini",
label: "GPT-4o mini (Azure)",
isNew: false,
},
];

Expand Down

0 comments on commit 0a41bd1

Please sign in to comment.