@umituz/react-native-ai-gemini-provider 1.14.14 → 1.14.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-ai-gemini-provider",
3
- "version": "1.14.14",
3
+ "version": "1.14.16",
4
4
  "description": "Google Gemini AI provider for React Native applications",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -40,7 +40,7 @@
40
40
  "@types/react": "~19.1.10",
41
41
  "@typescript-eslint/eslint-plugin": "^7.0.0",
42
42
  "@typescript-eslint/parser": "^7.0.0",
43
- "@umituz/react-native-ai-generation-content": "^1.17.26",
43
+ "@umituz/react-native-ai-generation-content": "latest",
44
44
  "eslint": "^8.57.0",
45
45
  "react": "19.1.0",
46
46
  "react-native": "0.81.5",
@@ -14,8 +14,9 @@ import type {
14
14
  VideoFeatureType,
15
15
  ImageFeatureInputData,
16
16
  VideoFeatureInputData,
17
+ ProviderCapabilities,
18
+ RunOptions,
17
19
  } from "@umituz/react-native-ai-generation-content";
18
- import type { ExecutionOptions } from "./generation-executor";
19
20
  import type {
20
21
  GeminiImageInput,
21
22
  GeminiImageGenerationResult,
@@ -43,6 +44,27 @@ import {
43
44
 
44
45
  export type { GeminiProviderConfig };
45
46
 
47
+ /**
48
+ * Gemini provider capabilities
49
+ */
50
+ const GEMINI_CAPABILITIES: ProviderCapabilities = {
51
+ imageFeatures: [
52
+ "upscale",
53
+ "photo-restore",
54
+ "face-swap",
55
+ "anime-selfie",
56
+ "remove-background",
57
+ "remove-object",
58
+ "hd-touch-up",
59
+ "replace-background",
60
+ ] as const,
61
+ videoFeatures: ["ai-hug", "ai-kiss"] as const,
62
+ textToImage: true,
63
+ textToVideo: true,
64
+ imageToVideo: true,
65
+ textToVoice: false,
66
+ };
67
+
46
68
  export class GeminiProvider implements IAIProvider {
47
69
  readonly providerId = "gemini";
48
70
  readonly providerName = "Google Gemini";
@@ -55,6 +77,18 @@ export class GeminiProvider implements IAIProvider {
55
77
  return providerInitializer.isInitialized();
56
78
  }
57
79
 
80
+ getCapabilities(): ProviderCapabilities {
81
+ return GEMINI_CAPABILITIES;
82
+ }
83
+
84
+ isFeatureSupported(feature: ImageFeatureType | VideoFeatureType): boolean {
85
+ const capabilities = this.getCapabilities();
86
+ return (
87
+ capabilities.imageFeatures.includes(feature as ImageFeatureType) ||
88
+ capabilities.videoFeatures.includes(feature as VideoFeatureType)
89
+ );
90
+ }
91
+
58
92
  submitJob(model: string, input: Record<string, unknown>): Promise<JobSubmission> {
59
93
  return jobProcessor.submitJob(model, input);
60
94
  }
@@ -75,10 +109,12 @@ export class GeminiProvider implements IAIProvider {
75
109
  options?.onQueueUpdate?.({ status: "IN_QUEUE" });
76
110
 
77
111
  const result = await generationExecutor.executeGeneration<T>(model, input, {
78
- onProgress: options?.onProgress,
112
+ onProgress: (progress: number) => {
113
+ options?.onProgress?.({ progress, status: "IN_PROGRESS" });
114
+ },
79
115
  });
80
116
 
81
- options?.onProgress?.(100);
117
+ options?.onProgress?.({ progress: 100, status: "COMPLETED" });
82
118
  options?.onQueueUpdate?.({ status: "COMPLETED" });
83
119
  options?.onResult?.(result);
84
120
 
@@ -88,9 +124,13 @@ export class GeminiProvider implements IAIProvider {
88
124
  async run<T = unknown>(
89
125
  model: string,
90
126
  input: Record<string, unknown>,
91
- options?: ExecutionOptions,
127
+ options?: RunOptions,
92
128
  ): Promise<T> {
93
- return generationExecutor.executeGeneration<T>(model, input, options);
129
+ return generationExecutor.executeGeneration<T>(model, input, {
130
+ onProgress: (progress: number) => {
131
+ options?.onProgress?.({ progress, status: "IN_PROGRESS" });
132
+ },
133
+ });
94
134
  }
95
135
 
96
136
  async generateImage(prompt: string): Promise<GeminiImageGenerationResult> {
@@ -32,9 +32,9 @@ export class ProviderInitializer {
32
32
  baseDelay: config.baseDelay,
33
33
  maxDelay: config.maxDelay,
34
34
  defaultTimeoutMs: config.defaultTimeoutMs,
35
- textModel: config.textModel as string | undefined,
36
- textToImageModel: config.textToImageModel as string | undefined,
37
- imageEditModel: config.imageEditModel as string | undefined,
35
+ textModel: config.textModel,
36
+ textToImageModel: config.textToImageModel,
37
+ imageEditModel: config.imageEditModel,
38
38
  };
39
39
 
40
40
  geminiClientCoreService.initialize(geminiConfig);