@google/genai 1.28.0 → 1.29.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 +4 -4
- package/dist/genai.d.ts +747 -47
- package/dist/index.cjs +1286 -196
- package/dist/index.mjs +1280 -197
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +1405 -294
- package/dist/node/index.mjs +1398 -295
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +747 -47
- package/dist/web/index.mjs +1291 -210
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +747 -47
- package/package.json +11 -6
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ TypeScript and JavaScript developers to build applications powered by Gemini. Th
|
|
|
13
13
|
supports both the [Gemini Developer API](https://ai.google.dev/gemini-api/docs)
|
|
14
14
|
and [Vertex AI](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/overview).
|
|
15
15
|
|
|
16
|
-
The Google Gen AI SDK is designed to work with Gemini 2.0 features.
|
|
16
|
+
The Google Gen AI SDK is designed to work with Gemini 2.0+ features.
|
|
17
17
|
|
|
18
18
|
> [!CAUTION]
|
|
19
19
|
> **API Key Security:** Avoid exposing API keys in client-side code.
|
|
@@ -58,7 +58,7 @@ const ai = new GoogleGenAI({apiKey: GEMINI_API_KEY});
|
|
|
58
58
|
|
|
59
59
|
async function main() {
|
|
60
60
|
const response = await ai.models.generateContent({
|
|
61
|
-
model: 'gemini-2.
|
|
61
|
+
model: 'gemini-2.5-flash',
|
|
62
62
|
contents: 'Why is the sky blue?',
|
|
63
63
|
});
|
|
64
64
|
console.log(response.text);
|
|
@@ -205,7 +205,7 @@ const ai = new GoogleGenAI({apiKey: GEMINI_API_KEY});
|
|
|
205
205
|
|
|
206
206
|
async function main() {
|
|
207
207
|
const response = await ai.models.generateContentStream({
|
|
208
|
-
model: 'gemini-2.
|
|
208
|
+
model: 'gemini-2.5-flash',
|
|
209
209
|
contents: 'Write a 100-word poem.',
|
|
210
210
|
});
|
|
211
211
|
for await (const chunk of response) {
|
|
@@ -250,7 +250,7 @@ async function main() {
|
|
|
250
250
|
|
|
251
251
|
const ai = new GoogleGenAI({apiKey: GEMINI_API_KEY});
|
|
252
252
|
const response = await ai.models.generateContent({
|
|
253
|
-
model: 'gemini-2.
|
|
253
|
+
model: 'gemini-2.5-flash',
|
|
254
254
|
contents: 'Dim the lights so the room feels cozy and warm.',
|
|
255
255
|
config: {
|
|
256
256
|
toolConfig: {
|