Skip to content

feat(api): add MiniMax provider option to the ontology builder - #103

Open
Octopus (octo-patch) wants to merge 1 commit into
microsoft:mainfrom
octo-patch:octo/20260729-provider-add-recvqaCeSZMAty
Open

feat(api): add MiniMax provider option to the ontology builder#103
Octopus (octo-patch) wants to merge 1 commit into
microsoft:mainfrom
octo-patch:octo/20260729-provider-add-recvqaCeSZMAty

Conversation

@octo-patch

Copy link
Copy Markdown

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. Setting AI_PROVIDER=minimax routes the request to MiniMax's OpenAI-compatible chat-completions API:
    • Authorization: Bearer <MINIMAX_API_KEY> auth and the model sent in the request body
    • default model MiniMax-M3 (override with MINIMAX_MODEL)
    • default base URL https://api.minimax.io/v1 (override with MINIMAX_BASE_URL, e.g. https://api.minimaxi.com/v1 for the mainland China endpoint)
    • The response-handling path is shared because the response shape is OpenAI-compatible.
  • api/local.settings.json.template — Added AI_PROVIDER and the MINIMAX_* settings next to the existing Azure keys.
  • README.md — Documented the AI_PROVIDER selector and the backend provider environment variables.

Configuration

Set AI_PROVIDER=minimax and MINIMAX_API_KEY in the Function App application settings (or api/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 build in api/ already fails on main because the pinned @azure/functions@4 no longer exports the v3-style AzureFunction/Context types the existing code imports. That failure is pre-existing, reproduces identically without this change, and this change adds no new type errors.

- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant