feat(api): add MiniMax provider option to the ontology builder - #103
Open
Octopus (octo-patch) wants to merge 1 commit into
Open
feat(api): add MiniMax provider option to the ontology builder#103Octopus (octo-patch) wants to merge 1 commit into
Octopus (octo-patch) wants to merge 1 commit into
Conversation
- Introduce a resolveProvider() abstraction in the generate-ontology function so the builder is no longer hard-wired to Azure OpenAI - Add an AI_PROVIDER selector (default azure) with a MiniMax path that uses the OpenAI-compatible chat-completions endpoint and Bearer auth - Document MINIMAX_BASE_URL / MINIMAX_API_KEY / MINIMAX_MODEL in the settings template and README
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Reason: The AI ontology builder was hard-wired to Azure OpenAI, so it could not use MiniMax's OpenAI-compatible endpoints.
What changed
api/generate-ontology/index.ts— Introduced a small provider abstraction (resolveProvider) that builds the chat-completions request for the configured provider. Azure OpenAI stays the default so existing deployments are unaffected. SettingAI_PROVIDER=minimaxroutes the request to MiniMax's OpenAI-compatible chat-completions API:Authorization: Bearer <MINIMAX_API_KEY>auth and the model sent in the request bodyMiniMax-M3(override withMINIMAX_MODEL)https://api.minimax.io/v1(override withMINIMAX_BASE_URL, e.g.https://api.minimaxi.com/v1for the mainland China endpoint)api/local.settings.json.template— AddedAI_PROVIDERand theMINIMAX_*settings next to the existing Azure keys.README.md— Documented theAI_PROVIDERselector and the backend provider environment variables.Configuration
Set
AI_PROVIDER=minimaxandMINIMAX_API_KEYin the Function App application settings (orapi/local.settings.json). Optional overrides:MINIMAX_BASE_URL,MINIMAX_MODEL.Checks
npx eslint api/generate-ontology/index.ts— passes with no errors.Note:
npm run buildinapi/already fails onmainbecause the pinned@azure/functions@4no longer exports the v3-styleAzureFunction/Contexttypes the existing code imports. That failure is pre-existing, reproduces identically without this change, and this change adds no new type errors.