Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4128,6 +4128,22 @@
"nugetId": "Xamarin.Google.MLKit.FaceDetection",
"type": "xbd"
},
{
"groupId": "com.google.mlkit",
"artifactId": "genai-common",
"version": "1.0.0-beta2",
"nugetVersion": "1.0.0.0-beta2",
"nugetId": "Xamarin.Google.MLKit.GenAI.Common",
"type": "xbd"
},
{
"groupId": "com.google.mlkit",
"artifactId": "genai-prompt",
"version": "1.0.0-alpha1",
"nugetVersion": "1.0.0.0-alpha1",
"nugetId": "Xamarin.Google.MLKit.GenAI.Prompt",
"type": "xbd"
},
{
"groupId": "com.google.mlkit",
"artifactId": "image-labeling",
Expand Down
4 changes: 4 additions & 0 deletions published-namespaces.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,10 @@ Google.Internal.Firebase.InAppMessaging.V1.SdkServing
Google.Logging.Type
Google.Longrunning
Google.MediaPipe.Tasks.GenAI.LlmInference
Google.MLKit.GenAI.Common
Google.MLKit.GenAI.Common.Audio
Google.MLKit.GenAI.Prompt
Google.MLKit.GenAI.Prompt.Java
Google.MLKit.Vision.Digitalink.Common
Google.MLKit.Vision.Digitalink.Common.Downloading
Google.MLKit.Vision.Digitalink.Common.Internal
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#nullable enable
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#nullable enable
Google.MLKit.GenAI.Common.Audio.AudioSource
Google.MLKit.GenAI.Common.Audio.AudioSource.AudioSource(nint javaReference, Android.Runtime.JniHandleOwnership transfer) -> void
Google.MLKit.GenAI.Common.BaseOptions
Google.MLKit.GenAI.Common.BaseOptions.BaseOptions() -> void
Google.MLKit.GenAI.Common.BaseOptions.BaseOptions(nint javaReference, Android.Runtime.JniHandleOwnership transfer) -> void
Google.MLKit.GenAI.Common.BaseRequest
Google.MLKit.GenAI.Common.BaseRequest.BaseRequest() -> void
Google.MLKit.GenAI.Common.BaseRequest.BaseRequest(nint javaReference, Android.Runtime.JniHandleOwnership transfer) -> void
Google.MLKit.GenAI.Common.BaseRequest.IOverrideRequestKind
Google.MLKit.GenAI.Common.DownloadStatus
Google.MLKit.GenAI.Common.DownloadStatus.DownloadCompleted
Google.MLKit.GenAI.Common.DownloadStatus.DownloadFailed
Google.MLKit.GenAI.Common.DownloadStatus.DownloadFailed.DownloadFailed(Google.MLKit.GenAI.Common.GenAIException! e) -> void
Google.MLKit.GenAI.Common.DownloadStatus.DownloadFailed.Exception.get -> Google.MLKit.GenAI.Common.GenAIException!
Google.MLKit.GenAI.Common.DownloadStatus.DownloadProgress
Google.MLKit.GenAI.Common.DownloadStatus.DownloadProgress.DownloadProgress(long totalBytesDownloaded) -> void
Google.MLKit.GenAI.Common.DownloadStatus.DownloadProgress.TotalBytesDownloaded.get -> long
Google.MLKit.GenAI.Common.DownloadStatus.DownloadStarted
Google.MLKit.GenAI.Common.DownloadStatus.DownloadStarted.BytesToDownload.get -> long
Google.MLKit.GenAI.Common.DownloadStatus.DownloadStarted.DownloadStarted(long bytesToDownload) -> void
Google.MLKit.GenAI.Common.DownloadStatus.DownloadStatus(nint javaReference, Android.Runtime.JniHandleOwnership transfer) -> void
Google.MLKit.GenAI.Common.FeatureStatus
Google.MLKit.GenAI.Common.FeatureStatusAttribute
Google.MLKit.GenAI.Common.FeatureStatusAttribute.FeatureStatusAttribute() -> void
Google.MLKit.GenAI.Common.FeatureStatusConsts
Google.MLKit.GenAI.Common.GenAIErrorCode
Google.MLKit.GenAI.Common.GenAIErrorCode.AICoreIncompatible = -101 -> Google.MLKit.GenAI.Common.GenAIErrorCode
Google.MLKit.GenAI.Common.GenAIErrorCode.BackgroundUseBlocked = 30 -> Google.MLKit.GenAI.Common.GenAIErrorCode
Google.MLKit.GenAI.Common.GenAIErrorCode.Busy = 9 -> Google.MLKit.GenAI.Common.GenAIErrorCode
Google.MLKit.GenAI.Common.GenAIErrorCode.CacheProcessingError = -103 -> Google.MLKit.GenAI.Common.GenAIErrorCode
Google.MLKit.GenAI.Common.GenAIErrorCode.Cancelled = 7 -> Google.MLKit.GenAI.Common.GenAIErrorCode
Google.MLKit.GenAI.Common.GenAIErrorCode.InvalidInputImage = -102 -> Google.MLKit.GenAI.Common.GenAIErrorCode
Google.MLKit.GenAI.Common.GenAIErrorCode.NeedsSystemUpdate = 604 -> Google.MLKit.GenAI.Common.GenAIErrorCode
Google.MLKit.GenAI.Common.GenAIErrorCode.NotAvailable = 8 -> Google.MLKit.GenAI.Common.GenAIErrorCode
Google.MLKit.GenAI.Common.GenAIErrorCode.NotEnoughDiskSpace = 501 -> Google.MLKit.GenAI.Common.GenAIErrorCode
Google.MLKit.GenAI.Common.GenAIErrorCode.PerAppBatteryUseQuotaExceeded = 27 -> Google.MLKit.GenAI.Common.GenAIErrorCode
Google.MLKit.GenAI.Common.GenAIErrorCode.RequestProcessingError = 4 -> Google.MLKit.GenAI.Common.GenAIErrorCode
Google.MLKit.GenAI.Common.GenAIErrorCode.RequestTooLarge = 12 -> Google.MLKit.GenAI.Common.GenAIErrorCode
Google.MLKit.GenAI.Common.GenAIErrorCode.RequestTooSmall = -100 -> Google.MLKit.GenAI.Common.GenAIErrorCode
Google.MLKit.GenAI.Common.GenAIErrorCode.ResponseGenerationError = 15 -> Google.MLKit.GenAI.Common.GenAIErrorCode
Google.MLKit.GenAI.Common.GenAIErrorCode.ResponseProcessingError = 11 -> Google.MLKit.GenAI.Common.GenAIErrorCode
Google.MLKit.GenAI.Common.GenAIErrorCode.Unknown = 0 -> Google.MLKit.GenAI.Common.GenAIErrorCode
Google.MLKit.GenAI.Common.GenAIException
Google.MLKit.GenAI.Common.GenAIException.GenAIException(Java.Lang.Throwable? cause, Google.MLKit.GenAI.Common.GenAIErrorCode errorCode) -> void
Google.MLKit.GenAI.Common.GenAIException.GenAIException(nint javaReference, Android.Runtime.JniHandleOwnership transfer) -> void
Google.MLKit.GenAI.Common.GenAIException.GenAIException(string! message, Java.Lang.Throwable? cause, Google.MLKit.GenAI.Common.GenAIErrorCode errorCode) -> void
Google.MLKit.GenAI.Common.IDownloadCallback
Google.MLKit.GenAI.Common.IDownloadCallback.OnDownloadCompleted() -> void
Google.MLKit.GenAI.Common.IDownloadCallback.OnDownloadFailed(Google.MLKit.GenAI.Common.GenAIException! p0) -> void
Google.MLKit.GenAI.Common.IDownloadCallback.OnDownloadProgress(long p0) -> void
Google.MLKit.GenAI.Common.IDownloadCallback.OnDownloadStarted(long p0) -> void
Google.MLKit.GenAI.Common.IFeatureStatus
Google.MLKit.GenAI.Common.IStreamingCallback
Google.MLKit.GenAI.Common.IStreamingCallback.OnNewText(string! p0) -> void
abstract Google.MLKit.GenAI.Common.BaseOptions.TargetVersion.get -> Java.Lang.Integer?
abstract Google.MLKit.GenAI.Common.BaseRequest.OverrideRequestKind.get -> Java.Lang.Integer?
const Google.MLKit.GenAI.Common.FeatureStatus.Available = 3 -> int
const Google.MLKit.GenAI.Common.FeatureStatus.Downloadable = 1 -> int
const Google.MLKit.GenAI.Common.FeatureStatus.Downloading = 2 -> int
const Google.MLKit.GenAI.Common.FeatureStatus.Unavailable = 0 -> int
override Google.MLKit.GenAI.Common.Audio.AudioSource.JniPeerMembers.get -> Java.Interop.JniPeerMembers!
override Google.MLKit.GenAI.Common.Audio.AudioSource.ThresholdClass.get -> nint
override Google.MLKit.GenAI.Common.Audio.AudioSource.ThresholdType.get -> System.Type!
override Google.MLKit.GenAI.Common.BaseOptions.JniPeerMembers.get -> Java.Interop.JniPeerMembers!
override Google.MLKit.GenAI.Common.BaseOptions.ThresholdClass.get -> nint
override Google.MLKit.GenAI.Common.BaseOptions.ThresholdType.get -> System.Type!
override Google.MLKit.GenAI.Common.BaseRequest.JniPeerMembers.get -> Java.Interop.JniPeerMembers!
override Google.MLKit.GenAI.Common.BaseRequest.ThresholdClass.get -> nint
override Google.MLKit.GenAI.Common.BaseRequest.ThresholdType.get -> System.Type!
override Google.MLKit.GenAI.Common.DownloadStatus.DownloadCompleted.JniPeerMembers.get -> Java.Interop.JniPeerMembers!
override Google.MLKit.GenAI.Common.DownloadStatus.DownloadFailed.JniPeerMembers.get -> Java.Interop.JniPeerMembers!
override Google.MLKit.GenAI.Common.DownloadStatus.DownloadProgress.JniPeerMembers.get -> Java.Interop.JniPeerMembers!
override Google.MLKit.GenAI.Common.DownloadStatus.DownloadStarted.JniPeerMembers.get -> Java.Interop.JniPeerMembers!
override Google.MLKit.GenAI.Common.DownloadStatus.JniPeerMembers.get -> Java.Interop.JniPeerMembers!
override Google.MLKit.GenAI.Common.DownloadStatus.ThresholdClass.get -> nint
override Google.MLKit.GenAI.Common.DownloadStatus.ThresholdType.get -> System.Type!
override Google.MLKit.GenAI.Common.GenAIException.JniPeerMembers.get -> Java.Interop.JniPeerMembers!
override Google.MLKit.GenAI.Common.GenAIException.ThresholdClass.get -> nint
override Google.MLKit.GenAI.Common.GenAIException.ThresholdType.get -> System.Type!
static Google.MLKit.GenAI.Common.Audio.AudioSource.FromMic() -> Google.MLKit.GenAI.Common.Audio.AudioSource!
static Google.MLKit.GenAI.Common.Audio.AudioSource.FromPfd(Android.OS.ParcelFileDescriptor! pfd) -> Google.MLKit.GenAI.Common.Audio.AudioSource!
static Google.MLKit.GenAI.Common.DownloadStatus.DownloadCompleted.Instance.get -> Google.MLKit.GenAI.Common.DownloadStatus.DownloadCompleted!
virtual Google.MLKit.GenAI.Common.Audio.AudioSource.Pfd.get -> Android.OS.ParcelFileDescriptor?
virtual Google.MLKit.GenAI.Common.BaseOptions.TargetVersionOrDefault.get -> int
virtual Google.MLKit.GenAI.Common.BaseRequest.OverrideRequestKindOrDefault.get -> int
virtual Google.MLKit.GenAI.Common.GenAIException.ErrorCode.get -> Google.MLKit.GenAI.Common.GenAIErrorCode
21 changes: 21 additions & 0 deletions source/com.google.mlkit/genai-common/Transforms/EnumFields.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<enum-field-mappings>
<mapping clr-enum-type="Google.MLKit.GenAI.Common.GenAIErrorCode" jni-interface="com/google/mlkit/genai/common/GenAiException$ErrorCode">
<field clr-name="AICoreIncompatible" jni-name="AICORE_INCOMPATIBLE" value="-101" />
<field clr-name="BackgroundUseBlocked" jni-name="BACKGROUND_USE_BLOCKED" value="30" />
<field clr-name="Busy" jni-name="BUSY" value="9" />
<field clr-name="CacheProcessingError" jni-name="CACHE_PROCESSING_ERROR" value="-103" />
<field clr-name="Cancelled" jni-name="CANCELLED" value="7" />
<field clr-name="InvalidInputImage" jni-name="INVALID_INPUT_IMAGE" value="-102" />
<field clr-name="NeedsSystemUpdate" jni-name="NEEDS_SYSTEM_UPDATE" value="604" />
<field clr-name="NotAvailable" jni-name="NOT_AVAILABLE" value="8" />
<field clr-name="NotEnoughDiskSpace" jni-name="NOT_ENOUGH_DISK_SPACE" value="501" />
<field clr-name="PerAppBatteryUseQuotaExceeded" jni-name="PER_APP_BATTERY_USE_QUOTA_EXCEEDED" value="27" />
<field clr-name="RequestProcessingError" jni-name="REQUEST_PROCESSING_ERROR" value="4" />
<field clr-name="RequestTooLarge" jni-name="REQUEST_TOO_LARGE" value="12" />
<field clr-name="RequestTooSmall" jni-name="REQUEST_TOO_SMALL" value="-100" />
<field clr-name="ResponseGenerationError" jni-name="RESPONSE_GENERATION_ERROR" value="15" />
<field clr-name="ResponseProcessingError" jni-name="RESPONSE_PROCESSING_ERROR" value="11" />
<field clr-name="Unknown" jni-name="UNKNOWN" value="0" />
</mapping>
</enum-field-mappings>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<enum-method-mappings>
<mapping jni-class="com/google/mlkit/genai/common/GenAiException">
<method jni-name="getErrorCode" parameter="return" clr-enum-type="Google.MLKit.GenAI.Common.GenAIErrorCode" />
<method jni-name="constructor" parameter="errorCode" clr-enum-type="Google.MLKit.GenAI.Common.GenAIErrorCode" />
</mapping>
</enum-method-mappings>
25 changes: 25 additions & 0 deletions source/com.google.mlkit/genai-common/Transforms/Metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>

<!-- Remove the nested ErrorCode interface to avoid conflict with the ErrorCode property -->
<remove-node path="/api/package[@name='com.google.mlkit.genai.common']/interface[@name='GenAiException.ErrorCode']" />

<!-- Remove unused internal classes -->
<remove-node path="/api/package[@name='com.google.mlkit.genai.common.internal']" />

<!-- Remove Kotlin data class synthetic methods -->
<!-- Remove Kotlin data class synthetic methods -->
<remove-node path="/api/package/class/method[@name='component1']" />
<remove-node path="/api/package/class/method[@name='copy']" />

<!-- Remove obfuscated internal methods -->
<remove-node path="/api/package/interface/method[starts-with(@name,'zz')]" />
<remove-node path="/api/package/class/method[starts-with(@name,'zz')]" />

<!-- Rename getE to a proper property name -->
<attr path="/api/package[@name='com.google.mlkit.genai.common']/class[@name='DownloadStatus.DownloadFailed']/method[@name='getE']" name="managedName">GetException</attr>

<!-- Rename GenAiException to GenAIException for proper AI casing -->
<attr path="/api/package[@name='com.google.mlkit.genai.common']/class[@name='GenAiException']" name="managedName">GenAIException</attr>

</metadata>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#nullable enable
Loading