Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@google/generative-ai

Package Overview
Dependencies
Maintainers
4
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@google/generative-ai - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

5

dist/generative-ai.d.ts

@@ -603,2 +603,7 @@ /**

/**
* Additional attribution information to include in the x-goog-api-client header.
* Used by wrapper SDKs.
*/
apiClient?: string;
/**
* Base endpoint url. Defaults to "https://generativelanguage.googleapis.com"

@@ -605,0 +610,0 @@ */

13

dist/index.js

@@ -203,3 +203,3 @@ 'use strict';

*/
const PACKAGE_VERSION = "0.4.0";
const PACKAGE_VERSION = "0.5.0";
const PACKAGE_LOG_HEADER = "genai-js";

@@ -236,4 +236,9 @@ var Task;

*/
function getClientHeaders() {
return `${PACKAGE_LOG_HEADER}/${PACKAGE_VERSION}`;
function getClientHeaders(requestOptions) {
const clientHeaders = [];
if (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiClient) {
clientHeaders.push(requestOptions.apiClient);
}
clientHeaders.push(`${PACKAGE_LOG_HEADER}/${PACKAGE_VERSION}`);
return clientHeaders.join(" ");
}

@@ -245,3 +250,3 @@ async function makeRequest(url, body, requestOptions) {

"Content-Type": "application/json",
"x-goog-api-client": getClientHeaders(),
"x-goog-api-client": getClientHeaders(requestOptions),
"x-goog-api-key": url.apiKey,

@@ -248,0 +253,0 @@ }, body }));

@@ -36,2 +36,6 @@ /**

}
/**
* Simple, but may become more complex if we add more versions to log.
*/
export declare function getClientHeaders(requestOptions: RequestOptions): string;
export declare function makeRequest(url: RequestUrl, body: string, requestOptions?: RequestOptions): Promise<Response>;

@@ -109,2 +109,7 @@ /**

/**
* Additional attribution information to include in the x-goog-api-client header.
* Used by wrapper SDKs.
*/
apiClient?: string;
/**
* Base endpoint url. Defaults to "https://generativelanguage.googleapis.com"

@@ -111,0 +116,0 @@ */

{
"name": "@google/generative-ai",
"version": "0.4.0",
"version": "0.5.0",
"description": "Google AI JavaScript SDK",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc