@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.
- package/dist/domain/entities/gemini.types.d.ts +2 -7
- package/dist/infrastructure/services/BaseService.d.ts +1 -1
- package/dist/infrastructure/utils/content-mapper.util.d.ts +1 -1
- package/package.json +1 -1
- package/src/index.ts +4 -5
- package/src/infrastructure/services/Streaming.ts +1 -1
- package/src/presentation/hooks/useGemini.ts +3 -2
|
@@ -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
|
-
/**
|
|
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 =
|
|
20
|
-
responseSchema?: GenerationConfig["responseSchema"];
|
|
21
|
-
};
|
|
16
|
+
export type GeminiGenerationConfig = GenerationConfig;
|
|
22
17
|
/**
|
|
23
18
|
* Harm categories for content safety filtering
|
|
24
19
|
*/
|
|
@@ -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
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,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
|
|
5
|
-
import {
|
|
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
|
|