-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Enhance Azure AI integration with multi-model support #170
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
Conversation
…ved configuration options - Added support for multi-model configuration via AZURE_MODELS_CONFIG for Azure OpenAI and Azure AI Foundry models. - Implemented new Azure embeddings class with fallback to hashing embeddings. - Updated configuration parsing to handle both single deployment and multi-model formats. - Enhanced tests for Azure AI configuration, including legacy and multi-model scenarios. - Updated documentation to reflect new configuration options and examples for Azure AI integration.
…JSON string usage
…cing and capabilities
… settings page, disables interpolation per default
mucke2701
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot Review:
Adds multi-model Azure configuration for AI providers (AZURE_MODELS_CONFIG), improves Azure model discovery and selection, and extends get_llm to select deployments per model_name.
Adds Azure embeddings support and a new embedding-provider priority (custom factory → Azure → OpenAI → hashing fallback).
Adds frontend embedding-progress interpolation: runtime config, client interpolation logic, tests (unit + Playwright), and UI changes to show interpolated values without regressing baseline.
Adds CHANGELOG and docs stubs and various model info updates (OpenAI models + default OPENAI_MODEL change).
Adds tests for the new Azure configuration and embedding logic.
What I like
Good separation of concerns: parsing AZURE_MODELS_CONFIG, mapping to ModelInfo objects, and using that mapping to select deployments.
Fallbacks are considered throughout (e.g., fallback to a single deployment, hashing embeddings if packages missing or Azure fails).
Frontend interpolation addresses a real UX issue (preventing visual resets while still keeping baseline aligned to real backend values).
Tests: clear, thorough unit and E2E-style Playwright tests for interpolation and Azure config parsing.
Clear environment configuration additions (env.example and runtime injection).
Potential issues / requested changes (high priority)
Ensure logger is available in vector_store.py
New code in backend/services/tools/geoserver/vector_store.py references logger (logger.info/warning/error). Confirm the file defines/imports logger at top (e.g., logging.getLogger(name)). If not present, add it.
langchain-openai dependency
The code imports AzureOpenAIEmbeddings and AzureChatOpenAI from langchain_openai in a few places. Ensure langchain-openai (or the correct package) is added to backend requirements / pyproject so CI and deployments have it.
The code does fall back on missing import, but CI should have the package for full functionality.
AZURE env var naming consistency
You added AZURE_EMBEDDING_DEPLOYMENT / AZURE_EMBEDDING_MODEL and also use AZURE_OPENAI_DEPLOYMENT and AZURE_MODELS_CONFIG. Document the intended canonical names in docs/azure-ai-configuration.md and .env.example. Some comments still reference AZURE_OPENAI_* vs AZURE_*; make the migration path clear.
get_llm: api_version default
get_llm uses getenv("AZURE_OPENAI_API_VERSION", "2024-02-01"). Ensure that default is valid for all intended deployments or clearly documented.
provider_interface ordering change — verify side effects
You moved the OpenAI provider block below Azure and kept logic the same. This is probably fine, but verify there are no initialization-order side effects (imports that depend on other providers).
Frontend: useMemo for embedding config
getEmbeddingConfig() is called every render and returns a new object; you rely on primitive props (pollingInterval, defaultVelocity, interpolationEnabled) in effect dependencies which is fine. Consider using useMemo to compute embeddingConfig once on mount to avoid accidental re-runs if you later include the object itself in dependencies.
Frontend: requestAnimationFrame and SSR
The interpolation useEffect early-returns if interpolation disabled — good. Ensure the effect only runs in the browser (useEffect already ensures that), and requestAnimationFrame is available. This is OK but mention in comments that the effect is client-only.
Tests: Playwright coverage, runtime config injection
Playwright tests inject window.RUNTIME_CONFIG using page.addInitScript — this is fine, but ensure CI Playwright environment runs with the same setup and that network intercepts in tests are stable.
TypeScript typing / missing export
GeoServerSettingsComponent: you added displayEncoded to the type and used it in places. Ensure every place that reads interpolatedProgress uses displayEncoded for display and encoded for baseline calculations. Looks correct in diffs, but double-check other components that may access interpolatedProgress.
CHANGELOG and dates
CHANGELOG contains references to October 2025 and "Since v.0.1.0-beta.1 (350+ commits from October 2025)". Make sure this date/claim matches the real release timeline and contributors list before merging.
Minor / suggestions
Add tests for the new Azure embeddings class (unit tests) to verify fallback behavior when langchain_openai is not installed and when Azure fails.
Add docs/azure-ai-configuration.md content describing AZURE_MODELS_CONFIG JSON schema and examples (the file exists but currently empty).
In .env.example, consider marking sensitive variables (API keys) more explicitly and showing example AZURE_MODELS_CONFIG snippet.
Consider logging at debug level when AZURE_MODELS_CONFIG parsing fails (currently a logger.warning is used — fine).
In openai.get_available_models you replaced many pre-existing model entries — ensure this list is intentional and keep comments to indicate why some older models are removed or renamed.
Confirm the frontend runtime-env route still renders valid JS for both server and client cases (string quoting looks OK in diffs).
Security / compliance notes
New environment variables (AZURE_* and embedding provider configs) are sensitive; ensure they are not leaked in logs. The code logs deployment names (not keys) which is OK. Avoid logging API keys.
When adding support for multiple models and providers, ensure any cost/pricing information in model metadata is informational only.
CI / release notes
Update CI to run new backend tests (backend/tests/test_azure_ai_config.py) and Playwright tests (frontend tests). Playwright tests may require added configuration to run headless and have Node tooling installed.
Add the detailed changelog file content (docs/changelog/CHANGELOG_v0.2.0-iucn_DETAILED.md) or link to a generated changelog.
Suggested review action (what I’d recommend)
Request changes with the above high-priority items (ensure logger present, dependency added to requirements, docs for AZURE_MODELS_CONFIG, add unit tests for Azure embeddings).
Once those are addressed, re-run CI and E2E tests; if green, approve.
and improved configuration options
Pull Request
Description
Related Issue
Fixes #
Type of Change
Checklist
Screenshots
Additional Notes