-
Notifications
You must be signed in to change notification settings - Fork 654
feat(py/plugins): add msfoundry plugin for Azure OpenAI #4383
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
Summary of ChangesHello @yesudeep, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances Genkit's Python capabilities by adding a robust integration with Microsoft Foundry. It enables Python developers to leverage a vast array of AI models and advanced features like multimodal input and dynamic model discovery, streamlining the development of AI-powered applications within the Genkit framework. The addition also includes a comprehensive sample to guide users and improves the overall project structure by cleaning up old directories. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces a comprehensive new Python plugin for Microsoft Foundry, providing access to a wide range of AI models through Genkit. The implementation is well-structured, featuring support for chat completions, embeddings, streaming, tool usage, and multimodal inputs. The inclusion of a detailed README and a sample application is excellent for user adoption. My review focuses on improving robustness, test coverage, and clarity in documentation and examples. I've identified a few areas for enhancement, such as refining error handling during model discovery, expanding test coverage to include core generation logic, and correcting some examples to ensure they are clear and accurate for developers.
py/plugins/msfoundry/src/genkit/plugins/msfoundry/models/model_info.py
Outdated
Show resolved
Hide resolved
43abbf2 to
f6b9e9c
Compare
f6b9e9c to
aaf4166
Compare
57fe4e5 to
e35fc4f
Compare
|
/gemini review |
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.
Code Review
This pull request introduces a comprehensive new Genkit plugin for Microsoft Foundry, providing access to a wide range of AI models on Azure. The implementation is well-structured, includes thorough documentation, tests, and a sample application, demonstrating full feature parity with the JavaScript ecosystem. I've identified a few areas for improvement, including a high-severity issue related to Azure AD token handling that could affect long-running applications, an unsafe type conversion, and some opportunities for code simplification and consistency improvements. Overall, this is an excellent contribution that significantly expands Genkit's capabilities.
cd4668c to
bfab64f
Compare
|
/gemini review |
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.
Code Review
This pull request introduces a new Genkit Python plugin for Microsoft Foundry (genkit-plugin-msfoundry), providing access to a wide range of AI models from Azure. The implementation is comprehensive, with support for chat completions, embeddings, streaming, tools, and multimodal inputs. The code is well-structured and includes thorough documentation, tests, and a sample application.
My review found a couple of minor issues: a typo in a model name within the model information file and a mismatched content type in the sample application. These are small fixes in an otherwise excellent contribution.
py/plugins/msfoundry/src/genkit/plugins/msfoundry/models/model_info.py
Outdated
Show resolved
Hide resolved
Add a new Python plugin for Microsoft Foundry (formerly Azure AI Foundry) that provides access to 11,000+ AI models through the Genkit framework. The plugin uses "msfoundry" as the name, which is not an exact trademark match, following nominative fair use for interoperability descriptions. Plugin features: - Chat completion models (GPT-4o, GPT-5, o-series, Claude, DeepSeek, Grok, Llama, Mistral) - Text embedding models (text-embedding-3-small/large, embed-v-4-0) - Tool/function calling support - Streaming responses with real-time token delivery - Multimodal inputs (images with visual_detail_level control) - JSON output mode for structured responses - Dynamic model discovery from Azure OpenAI API (discover_models=True) - Azure AD / Managed Identity authentication support - API key authentication Implementation details: - Uses OpenAI Python SDK with AsyncAzureOpenAI client - Implements genkit.core.plugin.Plugin interface - Uses alias_generator=to_camel for Pydantic models (consistent with Genkit core) - Full type annotations passing ty, pyrefly, and pyright Files added: - py/plugins/msfoundry/ - Plugin implementation - py/samples/msfoundry-hello/ - Sample demonstrating all features Also removes orphaned plugin directories (checks, chroma, cloud-sql-pg, pinecone) that only contained __pycache__ files and were causing workspace errors.
bfab64f to
e3923a1
Compare
|
/gemini review |
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.
Code Review
This pull request introduces a new Genkit Python plugin for Microsoft Foundry, providing access to a wide range of AI models. The implementation is comprehensive, with support for chat completions, embeddings, streaming, tools, and multimodal inputs. It also handles different authentication methods (API key, Azure AD) and endpoint types (Azure OpenAI, Foundry Project) gracefully. The code is well-structured, documented, and includes a full set of tests and a sample application to demonstrate its features. Overall, this is an excellent and feature-rich addition to the Genkit ecosystem. I have one minor suggestion for improving consistency in the model definitions.
7535db8 to
61bd71c
Compare
1113d0b to
a22dcef
Compare
|
/gemini review |
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.
Code Review
This is an excellent pull request that introduces a comprehensive and well-designed msfoundry plugin for Genkit. The plugin provides access to a vast catalog of models on Azure AI Foundry with feature parity to the JS ecosystem, including support for chat, embeddings, streaming, tools, and multimodal inputs.
The code quality is high, with thorough documentation, clear structure, and robust implementation details like handling different endpoint types and authentication methods. The addition of model-specific configuration classes is a great feature for user experience in the DevUI. The accompanying sample application is also very well-written and serves as a great guide for users.
I've identified a couple of areas for improvement: one for maintainability in the model config schema selection logic, and another to correct a potentially incorrect constraint in the Llama configuration.
Overall, this is a fantastic contribution that significantly expands Genkit's capabilities.
Replace the CC BY-SA licensed Wikipedia Commons image URL with a placeholder URL to avoid any licensing concerns. Users must provide their own image URL to test the multimodal image description feature. Affected samples: - msfoundry-hello - anthropic-hello
a22dcef to
a38f761
Compare
Summary
Add a new Genkit Python plugin for Microsoft Foundry (formerly Azure AI Foundry) that provides access to 11,000+ AI models.
genkit-plugin-msfoundryplugin with full feature parity to JS ecosystemFeatures
Naming & Trademark
The plugin uses
msfoundryas the name, which:Documentation Links
Test plan
bin/lint)cd py/samples/msfoundry-hello && ./run.sh