-
Notifications
You must be signed in to change notification settings - Fork 62
Add Google AI Edge LocalAgents and MediaPipe GenAI bindings with refined proto namespace handling #1243
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
Add Google AI Edge LocalAgents and MediaPipe GenAI bindings with refined proto namespace handling #1243
Conversation
@copilot Please commit all the PublicAPI files |
I've committed all the PublicAPI files along with the required org.json dependency. Created PublicAPI directories and files for:
Also added the missing org.json:json dependency to config.json which was required by the localagents artifacts. All files committed in 93b8e30. |
@copilot Please commit all the PublicAPI files |
All PublicAPI files have already been committed in 93b8e30. The commit includes all required PublicAPI files for the new Google AI Edge LocalAgents and MediaPipe artifacts:
The working tree is clean with no additional PublicAPI files to commit. |
@copilot there are some build errors:
|
... Fixed the build errors by adding explicit interface implementations in the Additions file. The issue was that the concrete classes |
@copilot Now that the changes are made, there should be re-generated PublicAPI files. PLease commit the new chanmges as well. |
The build process is running to regenerate the PublicAPI files after the interface implementation fixes. The |
... Fixed the build errors by implementing a more surgical approach to remove problematic proto classes while preserving essential interfaces. Updated metadata transforms to target specific proto classes rather than entire namespaces, and added explicit interface implementations for VectorStore classes to handle parameter type mismatches. The bindings now compile successfully without the interface implementation conflicts. |
14c4aad
to
530499c
Compare
@copilot Update the title and PR description with all the chnages that I have made in this PR. |
Updated PR title and description to reflect all comprehensive changes made: New Title: "Add Google AI Edge LocalAgents and MediaPipe GenAI bindings with refined proto namespace handling" Updated Description: The PR now covers:
Changes committed in b34ceb7. |
fedf1a4
to
5dcb515
Compare
I extracted the unrelated chnages out into #1250, so we should merge that first and rebase this. |
5dcb515
to
4bd4d8a
Compare
<parameter type="long" name="count" /> | ||
</method> | ||
</add-node> | ||
<attr path="/api/package[@name='androidx.media3.extractor.text']/class[@name='CuesWithTimingSubtitle']/method[@name='getCues']" name="return">java.util.List<androidx.media3.common.text.Cue></attr> |
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.
Does this change actually work, or do anything?
I don't think it's going to be able to bind java.util.List<androidx.media3.common.text.Cue>
.
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.
It seems to, It uses a JavaList<T>
under the hood and returns a IList<T>
The issue is that it was a List<T1<T2>>
and that double generic throws it off. So I lie.
published-namespaces.txt
Outdated
Google.AI.Edge.LocalAgents.FC | ||
Google.AI.Edge.LocalAgents.FC.ToolRetrieval |
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.
What is FC
short for? Could we spell it out?
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.
Probably FunctionCalling. What if they decide to adda new packaged called functioncalling? We can change, but I am scared. But, I had that and then got scared so reverted it.
Let me know if we should do this.
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.
FunctionCalling
seems good 👍, but RetrievalAugmentedGeneration
seems bananas, so RAG
it is.
Google.AI.Edge.LocalAgents.RAG.Chains | ||
Google.AI.Edge.LocalAgents.RAG.Chunking | ||
Google.AI.Edge.LocalAgents.RAG.Memory | ||
Google.AI.Edge.LocalAgents.RAG.Models |
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.
RAG
is maybe well known since AI is a thing, maybe this one is fine.
@@ -124,6 +124,7 @@ AndroidX.Media3.Common.Audio.AudioManagerCompat | |||
AndroidX.Media3.Common.Audio.AudioManagerCompat.IAudioFocusGain | |||
AndroidX.Media3.Common.Audio.AudioMixingUtil | |||
AndroidX.Media3.Common.Audio.AudioProcessingPipeline | |||
AndroidX.Media3.Common.Audio.AudioProcessingPipeline.AudioProcessingPipeline(Google.Common.Collect.ImmutableList? audioProcessors) -> void |
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.
So, I think we need to bump the versions of several packages by .1
, maybe we can do that after merge?
Any of the ones that got new APIs from guava -- maybe it's easier to just bump the entire set?
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.
If this is green and you're OK to bump all packages .1
later, I'm good with merging this.
This PR adds three new Google Maven artifacts to the `config.json` configuration file to enable .NET for Android bindings for new Google AI and MediaPipe libraries, with improved proto namespace handling to resolve compilation issues. ## Added Artifacts ### Google AI Edge LocalAgents * **com.google.ai.edge.localagents:localagents-fc** (v0.1.0) → `Xamarin.Google.AI.Edge.LocalAgents.FunctionCalling` * **com.google.ai.edge.localagents:localagents-rag** (v0.2.0) → `Xamarin.Google.AI.Edge.LocalAgents.RAG` * Added configuration and namespace mappings for `LocalAgents.FunctionCalling`, `LocalAgents.RAG`, `ToolRetrieval`, `MediaPipe`, `LlmInference`, and `GenAI` in `Directory.Build.props` and `config.json`, enabling new AI features and integrations. * Published new namespaces for these libraries, including * `Google.AI.Edge.LocalAgents.FunctionCalling`, * `Google.AI.Edge.LocalAgents.RAG.*`, and * `Google.MediaPipe.Tasks.GenAI.LlmInference`. **AndroidX.Media3 API enhancements:** * Introduced numerous new properties and methods that utilize immutable collections (`ImmutableList`, `ImmutableMap`, `ImmutableSet`) for track selection, metadata, configuration, and timeline management, improving API consistency and safety. * Added new static utility methods for working with immutable collections in bundles, such as `BundleToStringImmutableMap` and `GetList`. **Dependency and version updates:** * Updated the `nugetVersion` for `Xamarin.Firebase.Firestore` to `126.0.0.1` to reflect a new release. **Published namespaces expansion:** * Added new published namespaces for `Google.Common.Collect` and related sub-namespaces, supporting the new immutable collection features in the API. These changes collectively enable new AI/ML capabilities, improve API ergonomics for AndroidX.Media3, and ensure up-to-date dependency management. Co-authored-by: Matthew Leibowitz <[email protected]>
This PR adds three new Google Maven artifacts to the
config.json
configuration file to enable .NET for Android bindings for new Google AI and MediaPipe libraries, with improved proto namespace handling to resolve compilation issues.Added Artifacts
Google AI Edge LocalAgents
Xamarin.Google.AI.Edge.LocalAgents.FC
Xamarin.Google.AI.Edge.LocalAgents.RAG
Google MediaPipe Tasks
Xamarin.Google.MediaPipe.Tasks.GenAI
Proto Namespace Handling
Instead of removing entire proto namespaces (which caused missing interface errors), implemented a surgical approach:
Key Features
com.google.mediapipe.tasks.genai.llminference.jni.proto
namespace that caused compilation errorscom.google.ai.edge.localagents.core.proto
,com.google.ai.edge.localagents.fc.proto
,com.google.ai.edge.localagents.rag.memory.proto
,com.google.ai.edge.localagents.rag.models.proto
org.json:json
dependency viaexcludedRuntimeDependencies
to prevent packaging conflicts, as this library is already available in the Android runtimeAdditional Updates
The PR also includes updates to existing bindings:
All artifacts follow the established config.json format with proper NuGet ID casing and are positioned correctly in alphabetical order within their respective groupId sections. The bindings now compile successfully without interface implementation conflicts.
Summary
This pull request adds support for new Google AI and MediaPipe libraries and introduces several new namespaces and API surface changes, particularly for AndroidX.Media3. The most significant changes are the addition of new bindings for AI/ML features, updates to published namespaces, and the expansion of the AndroidX.Media3 API to support immutable collections and new configuration options.
New AI/ML library bindings:
LocalAgents.FunctionCalling
,LocalAgents.RAG
,ToolRetrieval
,MediaPipe
,LlmInference
, andGenAI
inDirectory.Build.props
andconfig.json
, enabling new AI features and integrations. [1] [2] [3]Google.AI.Edge.LocalAgents.FunctionCalling
,Google.AI.Edge.LocalAgents.RAG.*
, andGoogle.MediaPipe.Tasks.GenAI.LlmInference
. [1] [2]AndroidX.Media3 API enhancements:
ImmutableList
,ImmutableMap
,ImmutableSet
) for track selection, metadata, configuration, and timeline management, improving API consistency and safety. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]BundleToStringImmutableMap
andGetList
. [1] [2]Dependency and version updates:
nugetVersion
forXamarin.Firebase.Firestore
to126.0.0.1
to reflect a new release.Published namespaces expansion:
Google.Common.Collect
and related sub-namespaces, supporting the new immutable collection features in the API.These changes collectively enable new AI/ML capabilities, improve API ergonomics for AndroidX.Media3, and ensure up-to-date dependency management.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.