@umituz/react-native-ai-gemini-provider 3.0.27 → 3.0.28

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.
@@ -5,20 +5,15 @@ import type { GenerationConfig } from "@google/generative-ai";
5
5
  export interface GeminiConfig {
6
6
  /** API key for authentication */
7
7
  apiKey: string;
8
- /** Optional base URL for API requests */
9
- baseUrl?: string;
10
- /** Default timeout in milliseconds */
8
+ /** Default timeout in milliseconds (used by external consumers for timeout logic) */
11
9
  defaultTimeoutMs?: number;
12
10
  /** Default model to use for text generation */
13
11
  textModel?: string;
14
12
  }
15
13
  /**
16
14
  * Generation configuration for AI requests
17
- * Extends the SDK's GenerationConfig with proper schema typing
18
15
  */
19
- export type GeminiGenerationConfig = Omit<GenerationConfig, "responseSchema"> & {
20
- responseSchema?: GenerationConfig["responseSchema"];
21
- };
16
+ export type GeminiGenerationConfig = GenerationConfig;
22
17
  /**
23
18
  * Harm categories for content safety filtering
24
19
  */
@@ -29,6 +29,6 @@ export declare abstract class BaseGeminiService {
29
29
  text: string;
30
30
  }>;
31
31
  }[];
32
- generationConfig: GeminiGenerationConfig | undefined;
32
+ generationConfig: import("@google/generative-ai").GenerationConfig | undefined;
33
33
  };
34
34
  }
@@ -42,4 +42,4 @@ export declare function transformResponse(response: {
42
42
  /**
43
43
  * Extract text from content parts
44
44
  */
45
- export declare function extractTextFromParts(parts: GeminiPart[]): string;
45
+ export declare function extractTextFromParts(parts: GeminiPart[] | undefined): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-ai-gemini-provider",
3
- "version": "3.0.27",
3
+ "version": "3.0.28",
4
4
  "description": "Google Gemini AI text generation provider for React Native applications",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./dist/index.d.ts",
package/src/index.ts CHANGED
@@ -48,15 +48,14 @@ export {
48
48
  export { textGeneration } from "./infrastructure/services/TextGeneration";
49
49
  export { structuredText } from "./infrastructure/services/StructuredText";
50
50
  export { streaming } from "./infrastructure/services/Streaming";
51
- export { geminiProvider, GeminiProvider } from "./infrastructure/services/GeminiProvider";
52
51
 
53
52
  // React Hook
54
- export { useGemini } from "./presentation/hooks";
55
- export type { UseGeminiOptions, UseGeminiReturn } from "./presentation/hooks";
53
+ export { useGemini } from "./presentation/hooks/useGemini";
54
+ export type { UseGeminiOptions, UseGeminiReturn } from "./presentation/hooks/useGemini";
56
55
 
57
56
  // Provider Configuration & Factory
58
- export { ConfigBuilder, providerFactory } from "./providers";
57
+ export { ConfigBuilder, providerFactory } from "./providers/ProviderFactory";
59
58
  export type {
60
59
  ProviderConfig,
61
60
  ProviderFactoryOptions,
62
- } from "./providers";
61
+ } from "./providers/ProviderFactory";
@@ -1,5 +1,5 @@
1
1
  import { BaseGeminiService } from "./BaseService";
2
- import { telemetryHooks } from "../telemetry";
2
+ import { telemetryHooks } from "../telemetry/TelemetryHooks";
3
3
  import { processStream } from "../utils/stream-processor.util";
4
4
  import type {
5
5
  GeminiContent,
@@ -1,8 +1,9 @@
1
1
  import { useState, useCallback, useMemo } from "react";
2
2
  import type { GeminiGenerationConfig } from "../../domain/entities";
3
3
  import { DEFAULT_MODELS } from "../../domain/entities";
4
- import { textGeneration, structuredText } from "../../infrastructure/services";
5
- import { executeWithState, type AsyncStateSetters } from "../../infrastructure/utils/async";
4
+ import { textGeneration } from "../../infrastructure/services/TextGeneration";
5
+ import { structuredText } from "../../infrastructure/services/StructuredText";
6
+ import { executeWithState, type AsyncStateSetters } from "../../infrastructure/utils/async/execute-state.util";
6
7
  import { parseJsonResponse } from "../../infrastructure/utils/json-parser.util";
7
8
  import { useOperationManager } from "./useOperationManager";
8
9