@zhivex-ai/gemini 0.5.0 → 0.7.0-next.0

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/README.md CHANGED
@@ -2,6 +2,94 @@
2
2
 
3
3
  Gemini adapter for Zhivex AI SDK.
4
4
 
5
+ Supports Gemini text, embeddings, speech, realtime sessions, grounded generation, Files API, File Search stores, URL Context, Context Caching, Batch API, Interactions, raw prediction calls, and Google generative media models exposed through Gemini API endpoints such as Gemini Image / Nano Banana, Veo, and Lyria 3.
6
+
7
+ | Surface | Support |
8
+ | --- | --- |
9
+ | Text, tools, structured output, embeddings | high-level |
10
+ | Files API, File Search stores, Context Caching, Batch API, Interactions | high-level |
11
+ | Google Search, URL Context, File Search, Code Execution, Computer Use | hosted tool helpers |
12
+ | Image, video, music generation | high-level |
13
+ | Other Gemini model endpoints | `predictionModel()` raw/prediction |
14
+
15
+ ```ts
16
+ import {
17
+ createBatch,
18
+ createContextCache,
19
+ createFileSearchStore,
20
+ createInteraction,
21
+ generateImage,
22
+ generateMusic,
23
+ generateText,
24
+ generateVideo,
25
+ googleFileSearchTool,
26
+ googleUrlContextTool,
27
+ predictRaw,
28
+ uploadFile
29
+ } from "@zhivex-ai/core";
30
+ import { createGemini } from "@zhivex-ai/gemini";
31
+
32
+ const gemini = createGemini({ apiKey: process.env.GEMINI_API_KEY });
33
+
34
+ await generateImage({
35
+ model: gemini.imageGenerationModel!("gemini-3.1-flash-image-preview"),
36
+ prompt: "Create a product photo"
37
+ });
38
+
39
+ await generateVideo({
40
+ model: gemini.videoGenerationModel!("veo-3.1-generate-preview"),
41
+ prompt: "Create a cinematic establishing shot"
42
+ });
43
+
44
+ await generateMusic({
45
+ model: gemini.musicGenerationModel!("lyria-3-clip-preview"),
46
+ prompt: "Create a short acoustic intro"
47
+ });
48
+
49
+ const file = await uploadFile({
50
+ provider: gemini,
51
+ data: "Gemini notes",
52
+ mediaType: "text/plain",
53
+ displayName: "notes.txt"
54
+ });
55
+
56
+ const store = await createFileSearchStore({ provider: gemini, displayName: "Docs" });
57
+
58
+ await generateText({
59
+ model: gemini("gemini-2.5-flash"),
60
+ prompt: "Use the indexed docs and URL context.",
61
+ tools: {
62
+ docs: googleFileSearchTool([store.name]),
63
+ urls: googleUrlContextTool()
64
+ }
65
+ });
66
+
67
+ await createContextCache({
68
+ provider: gemini,
69
+ modelId: "gemini-2.5-flash",
70
+ contents: [{ role: "user", parts: [{ type: "file", data: file.uri ?? file.name, mediaType: "text/plain" }] }]
71
+ });
72
+
73
+ await createBatch({
74
+ provider: gemini,
75
+ modelId: "gemini-2.5-flash",
76
+ requests: [{ request: { contents: [{ parts: [{ text: "Summarize this." }] }] } }]
77
+ });
78
+
79
+ await createInteraction({
80
+ provider: gemini,
81
+ modelId: "gemini-3-flash-preview",
82
+ input: "Run a deep research style interaction."
83
+ });
84
+
85
+ await predictRaw({
86
+ model: gemini.predictionModel!("custom-gemini-endpoint"),
87
+ instances: [{ prompt: "provider-specific request" }]
88
+ });
89
+ ```
90
+
91
+ Model Garden-style coverage is intentionally raw/prediction based. The adapter does not add a dedicated wrapper for every Google model family.
92
+
5
93
  ## Install
6
94
 
7
95
  ```bash
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAmBL,KAAK,uBAAuB,EAY5B,KAAK,eAAe,EAEpB,KAAK,yBAAyB,EAS/B,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yBAAyB,CAAC,EAAE,yBAAyB,CAAC;CACvD;AAED,MAAM,WAAW,0BAA0B;IACzC,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