@google/genai 1.48.0 → 1.49.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/dist/genai.d.ts +114 -80
- package/dist/index.cjs +8 -24
- package/dist/index.mjs +8 -24
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +8 -21
- package/dist/node/index.mjs +8 -21
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +114 -80
- package/dist/vertex_internal/index.cjs +1 -1
- package/dist/vertex_internal/index.cjs.map +1 -1
- package/dist/vertex_internal/index.js +1 -1
- package/dist/vertex_internal/index.js.map +1 -1
- package/dist/web/index.mjs +8 -21
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +114 -80
- package/package.json +1 -1
package/dist/web/index.mjs
CHANGED
|
@@ -12744,7 +12744,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
12744
12744
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
12745
12745
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
12746
12746
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
12747
|
-
const SDK_VERSION = '1.
|
|
12747
|
+
const SDK_VERSION = '1.49.0'; // x-release-please-version
|
|
12748
12748
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
12749
12749
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
12750
12750
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -15309,29 +15309,15 @@ class Models extends BaseModule {
|
|
|
15309
15309
|
/**
|
|
15310
15310
|
* Recontextualizes an image.
|
|
15311
15311
|
*
|
|
15312
|
-
* There
|
|
15313
|
-
* 1)
|
|
15314
|
-
* and contexts.
|
|
15315
|
-
* 2) Virtual Try-On: Generate images of persons modeling fashion products.
|
|
15312
|
+
* There is one type of recontextualization currently supported:
|
|
15313
|
+
* 1) Virtual Try-On: Generate images of persons modeling fashion products.
|
|
15316
15314
|
*
|
|
15317
15315
|
* @param params - The parameters for recontextualizing an image.
|
|
15318
15316
|
* @return The response from the API.
|
|
15319
15317
|
*
|
|
15320
15318
|
* @example
|
|
15321
15319
|
* ```ts
|
|
15322
|
-
* const
|
|
15323
|
-
* model: 'imagen-product-recontext-preview-06-30',
|
|
15324
|
-
* source: {
|
|
15325
|
-
* prompt: 'In a modern kitchen setting.',
|
|
15326
|
-
* productImages: [productImage],
|
|
15327
|
-
* },
|
|
15328
|
-
* config: {
|
|
15329
|
-
* numberOfImages: 1,
|
|
15330
|
-
* },
|
|
15331
|
-
* });
|
|
15332
|
-
* console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
|
|
15333
|
-
*
|
|
15334
|
-
* const response2 = await ai.models.recontextImage({
|
|
15320
|
+
* const response = await ai.models.recontextImage({
|
|
15335
15321
|
* model: 'virtual-try-on-001',
|
|
15336
15322
|
* source: {
|
|
15337
15323
|
* personImage: personImage,
|
|
@@ -15341,7 +15327,7 @@ class Models extends BaseModule {
|
|
|
15341
15327
|
* numberOfImages: 1,
|
|
15342
15328
|
* },
|
|
15343
15329
|
* });
|
|
15344
|
-
* console.log(
|
|
15330
|
+
* console.log(response?.generatedImages?.[0]?.image?.imageBytes);
|
|
15345
15331
|
* ```
|
|
15346
15332
|
*/
|
|
15347
15333
|
async recontextImage(params) {
|
|
@@ -17921,7 +17907,8 @@ class BaseInteractions extends APIResource {
|
|
|
17921
17907
|
return this._client.delete(path `/${api_version}/interactions/${id}`, options);
|
|
17922
17908
|
}
|
|
17923
17909
|
/**
|
|
17924
|
-
* Cancels an interaction by id. This only applies to background interactions that
|
|
17910
|
+
* Cancels an interaction by id. This only applies to background interactions that
|
|
17911
|
+
* are still running.
|
|
17925
17912
|
*
|
|
17926
17913
|
* @example
|
|
17927
17914
|
* ```ts
|
|
@@ -18777,7 +18764,7 @@ class BaseGeminiNextGenAPIClient {
|
|
|
18777
18764
|
if (this.apiKey) {
|
|
18778
18765
|
return buildHeaders([{ 'x-goog-api-key': this.apiKey }]);
|
|
18779
18766
|
}
|
|
18780
|
-
if (this.clientAdapter.isVertexAI()) {
|
|
18767
|
+
if (this.clientAdapter && this.clientAdapter.isVertexAI()) {
|
|
18781
18768
|
return buildHeaders([await this.clientAdapter.getAuthHeaders()]);
|
|
18782
18769
|
}
|
|
18783
18770
|
return undefined;
|