-
Notifications
You must be signed in to change notification settings - Fork 229
[Fix] Azure OpenAI returns 404 with resource endpoint #1192
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
1acc0ae
fix(provider): support Azure OpenAI resource endpoints
roomote 646693d
test(provider): keep Azure constructor mock focused
roomote 3a121b8
test(settings): snapshot Azure OpenAI guidance
roomote dfd281e
test(settings): focus Azure guidance snapshot
roomote 6cf5a95
test(settings): trim Azure guidance snapshot
roomote d3688f5
test(settings): add Azure guidance visual baseline
roomote 147fb86
test(settings): explain CT bundle setup
roomote fd41164
fix(settings): translate Azure OpenAI guidance
roomote 1afa5f8
fix(providers): correct and deduplicate Azure OpenAI detection
edelauna bd481dd
fix: align Azure AI Inference routing guidance
edelauna File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
webview-ui/src/components/settings/providers/__tests__/OpenAICompatible.visual.fixture.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| /* v8 ignore file -- Playwright component fixture is covered by the visual test. */ | ||
| import React from "react" | ||
| import { QueryClient, QueryClientProvider } from "@tanstack/react-query" | ||
|
|
||
| import { type ProviderSettings } from "@roo-code/types" | ||
|
|
||
| import { TranslationContext as AppTranslationContext } from "@/i18n/TranslationContext" | ||
| import { TranslationContext as PlaywrightTranslationContext } from "@src/i18n/TranslationContext" | ||
| import { TooltipProvider } from "@src/components/ui/tooltip" | ||
| import { OpenAICompatible } from "../OpenAICompatible" | ||
| import enSettings from "@/i18n/locales/en/settings.json" | ||
|
|
||
| function flattenTranslations(obj: Record<string, unknown>, prefix = "settings:"): Record<string, string> { | ||
| const result: Record<string, string> = {} | ||
| for (const [key, value] of Object.entries(obj)) { | ||
| const fullKey = `${prefix}${key}` | ||
| if (typeof value === "string") { | ||
| result[fullKey] = value | ||
| } else if (value !== null && typeof value === "object" && !Array.isArray(value)) { | ||
| Object.assign(result, flattenTranslations(value as Record<string, unknown>, `${fullKey}.`)) | ||
| } | ||
| } | ||
| return result | ||
| } | ||
|
|
||
| const translations = flattenTranslations(enSettings as Record<string, unknown>) | ||
|
|
||
| const queryClient = new QueryClient({ | ||
| defaultOptions: { | ||
| queries: { retry: false }, | ||
| }, | ||
| }) | ||
|
|
||
| const apiConfiguration: ProviderSettings = { | ||
| apiProvider: "openai", | ||
| openAiBaseUrl: "", | ||
| openAiModelId: "my-gpt4o-deployment", | ||
| openAiUseAzure: true, | ||
| } | ||
|
|
||
| export const OpenAICompatibleAzureFixture = () => ( | ||
| <PlaywrightTranslationContext.Provider | ||
| value={{ | ||
| t: (key) => translations[key] ?? key, | ||
| i18n: null as unknown as typeof import("../../../../i18n/setup").default, | ||
| }}> | ||
| <AppTranslationContext.Provider | ||
| value={{ | ||
| t: (key) => translations[key] ?? key, | ||
| i18n: null as unknown as typeof import("../../../../i18n/setup").default, | ||
| }}> | ||
| <QueryClientProvider client={queryClient}> | ||
| <TooltipProvider> | ||
| <div className="h-[295px] w-[480px] overflow-hidden bg-vscode-editor-background p-4 text-vscode-foreground"> | ||
| <OpenAICompatible | ||
| apiConfiguration={apiConfiguration} | ||
| setApiConfigurationField={() => {}} | ||
| organizationAllowList={{ allowAll: true, providers: {} }} | ||
| simplifySettings | ||
| /> | ||
| </div> | ||
| </TooltipProvider> | ||
| </QueryClientProvider> | ||
| </AppTranslationContext.Provider> | ||
| </PlaywrightTranslationContext.Provider> | ||
| ) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.