@umituz/react-native-ai-gemini-provider 2.0.7 → 2.0.9
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
|
@@ -32,7 +32,7 @@ export class GeminiProvider {
|
|
|
32
32
|
/**
|
|
33
33
|
* Generate text from prompt
|
|
34
34
|
*/
|
|
35
|
-
async generateText(prompt: string, model
|
|
35
|
+
async generateText(prompt: string, model: string): Promise<string> {
|
|
36
36
|
return generationExecutor.executeTextGeneration(prompt, model);
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -43,10 +43,10 @@ export class GeminiProvider {
|
|
|
43
43
|
async generateTextWithImages(
|
|
44
44
|
prompt: string,
|
|
45
45
|
images: GeminiImageInput[],
|
|
46
|
-
model
|
|
46
|
+
model: string,
|
|
47
47
|
): Promise<string> {
|
|
48
48
|
const result = await generationExecutor.generateWithImages(
|
|
49
|
-
model
|
|
49
|
+
model,
|
|
50
50
|
prompt,
|
|
51
51
|
images,
|
|
52
52
|
);
|
|
@@ -59,7 +59,7 @@ export class GeminiProvider {
|
|
|
59
59
|
async generateStructuredText<T>(
|
|
60
60
|
prompt: string,
|
|
61
61
|
schema: Record<string, unknown>,
|
|
62
|
-
model
|
|
62
|
+
model: string,
|
|
63
63
|
): Promise<T> {
|
|
64
64
|
return generationExecutor.executeStructuredGeneration<T>(prompt, schema, model);
|
|
65
65
|
}
|
|
@@ -25,13 +25,13 @@ export class GenerationExecutor {
|
|
|
25
25
|
/**
|
|
26
26
|
* Execute text generation
|
|
27
27
|
*/
|
|
28
|
-
async executeTextGeneration(prompt: string, model
|
|
28
|
+
async executeTextGeneration(prompt: string, model: string): Promise<string> {
|
|
29
29
|
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
30
30
|
console.log("[GenerationExecutor] executeTextGeneration() called", { model });
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
const response = await geminiTextGenerationService.generateContent(
|
|
34
|
-
model
|
|
34
|
+
model,
|
|
35
35
|
[{ parts: [{ text: prompt }], role: "user" }],
|
|
36
36
|
);
|
|
37
37
|
|
|
@@ -44,14 +44,14 @@ export class GenerationExecutor {
|
|
|
44
44
|
async executeStructuredGeneration<T>(
|
|
45
45
|
prompt: string,
|
|
46
46
|
schema: Record<string, unknown>,
|
|
47
|
-
model
|
|
47
|
+
model: string,
|
|
48
48
|
): Promise<T> {
|
|
49
49
|
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
50
50
|
console.log("[GenerationExecutor] executeStructuredGeneration() called", { model });
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
return geminiStructuredTextService.generateStructuredText<T>(
|
|
54
|
-
model
|
|
54
|
+
model,
|
|
55
55
|
prompt,
|
|
56
56
|
schema,
|
|
57
57
|
);
|