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

docs: add Azure to ChatModelTab #5624

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
12 changes: 12 additions & 0 deletions docs/core_docs/src/theme/ChatModelTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const DEFAULTS = {
mistralParams: `{\n model: "mistral-large-latest",\n temperature: 0\n}`,
groqParams: `{\n model: "mixtral-8x7b-32768",\n temperature: 0\n}`,
vertexParams: `{\n model: "gemini-1.5-pro",\n temperature: 0\n}`,
azureParams: `{\n azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"],\n azure_deployment=os.environ["AZURE_OPENAI_DEPLOYMENT_NAME"],\n openai_api_version=os.environ["AZURE_OPENAI_API_VERSION"]\n}`,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JavaScript uses process.env

};

const MODELS_WSO = ["openai", "anthropic", "mistral", "groq", "vertex"];
Expand All @@ -46,6 +47,7 @@ const MODELS_WSO = ["openai", "anthropic", "mistral", "groq", "vertex"];
*
* @property {boolean} [hideOpenai] - Whether or not to hide OpenAI chat model.
* @property {boolean} [hideAnthropic] - Whether or not to hide Anthropic chat model.
* @property {boolean} [hideAzure] - Whether or not to hide Microsoft Azure OpenAI chat model.
* @property {boolean} [hideFireworks] - Whether or not to hide Fireworks chat model.
* @property {boolean} [hideMistral] - Whether or not to hide Mistral chat model.
* @property {boolean} [hideGroq] - Whether or not to hide Mistral chat model.
Expand All @@ -69,9 +71,11 @@ export default function ChatModelTabs(props) {
const mistralParams = props.mistralParams ?? DEFAULTS.mistralParams;
const groqParams = props.groqParams ?? DEFAULTS.groqParams;
const vertexParams = props.vertexParams ?? DEFAULTS.vertexParams;
const azureParams = props.azureParams ?? DEFAULTS.azureParams;
const providers = props.providers ?? [
"openai",
"anthropic",
"azure",
"fireworks",
"mistral",
"groq",
Expand All @@ -95,6 +99,14 @@ export default function ChatModelTabs(props) {
envs: `ANTHROPIC_API_KEY=your-api-key`,
mainred marked this conversation as resolved.
Show resolved Hide resolved
dependencies: "@langchain/anthropic",
},
azure: {
value: "azure",
label: "Azure",
default: false,
text: `import { AzureChatOpenAI } from "@langchain/openai";\n\nconst ${llmVarName} = new AzureChatOpenAI(${azureParams});`,
envs: `AZURE_OPENAI_API_KEY=your-api-key`,
dependencies: "@langchain/openai",
},
fireworks: {
value: "fireworks",
label: "FireworksAI",
Expand Down