Skip to content

Commit

Permalink
fix(docs): code example
Browse files Browse the repository at this point in the history
  • Loading branch information
arielweinberger committed Oct 22, 2023
1 parent 7f9fcf7 commit 1f13a3a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions apps/docs/components/DynamicCodeExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,13 @@ export function DynamicCodeExample({ children, defaultLLM, allowedProvider }: Pr
if (setupRef.current && modelRef.current) {
const model = models[selectedLLM];

modelRef.current.innerText = `"${selectedLLM}"`;
modelRef.current.innerText = `"${model.modelTokenOverride ?? selectedLLM}"`;
setupRef.current.innerText = model.setup;
setupRef.current.style.color = "var(--shiki-token-comment)";
}
}, [selectedLLM]);

const handleSelectChange = (value: string) => {
if (modelRef.current) {
modelRef.current.innerText = `"${value}"`;
}

setSelectedLLM(value);
}

Expand Down
1 change: 0 additions & 1 deletion apps/docs/pages/providers-and-models/azure-openai.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { DynamicCodeExample } from "../../components/DynamicCodeExample";
3. Set the following environment variables:
- `AZURE_OPENAI_ENDPOINT` - your Azure OpenAI endpoint
- `AZURE_OPENAI_API_KEY` - your Azure OpenAI API key
- `AZURE_OPENAI_DEPLOYMENT` - your Azure OpenAI deployment name

## Usage

Expand Down
3 changes: 2 additions & 1 deletion packages/llm-repo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export type ModelDefinition = {
provider: keyof typeof providers;
name: string;
setup: string;
modelTokenOverride?: string;
};

const openaiSetup = ` Make sure the following environment variables are set:
Expand All @@ -35,7 +36,6 @@ const anthropicSetup = ` Make sure the following environment variables are set:
const azureSetup = ` Make sure the following environment variables are set:
AZURE_OPENAI_ENDPOINT - your Azure OpenAI endpoint
AZURE_OPENAI_API_KEY - your Azure OpenAI API key
AZURE_OPENAI_DEPLOYMENT - your Azure OpenAI deployment name
`;

export const models: {
Expand Down Expand Up @@ -65,6 +65,7 @@ export const models: {
provider: "azure",
name: "Azure OpenAI",
setup: azureSetup,
modelTokenOverride: "azure/openai/<deployment-name>",
},
};

Expand Down

0 comments on commit 1f13a3a

Please sign in to comment.