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.11.1 to 0.11.2

2

dist/files/index.js

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

*/
const PACKAGE_VERSION = "0.11.1";
const PACKAGE_VERSION = "0.11.2";
const PACKAGE_LOG_HEADER = "genai-js";

@@ -75,0 +75,0 @@ var Task;

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

*/
const PACKAGE_VERSION = "0.11.1";
const PACKAGE_VERSION = "0.11.2";
const PACKAGE_LOG_HEADER = "genai-js";

@@ -902,11 +902,4 @@ var Task;

};
const VALID_PREVIOUS_CONTENT_ROLES = {
user: ["model"],
function: ["model"],
model: ["user", "function"],
// System instructions shouldn't be in history.
system: [],
};
function validateChatHistory(history) {
let prevContent;
let prevContent = false;
for (const currContent of history) {

@@ -946,9 +939,3 @@ const { role, parts } = currContent;

}
if (prevContent) {
const validPreviousContentRoles = VALID_PREVIOUS_CONTENT_ROLES[role];
if (!validPreviousContentRoles.includes(prevContent.role)) {
throw new GoogleGenerativeAIError(`Content with role '${role}' can't follow '${prevContent.role}'. Valid previous roles: ${JSON.stringify(VALID_PREVIOUS_CONTENT_ROLES)}`);
}
}
prevContent = currContent;
prevContent = true;
}

@@ -955,0 +942,0 @@ }

{
"name": "@google/generative-ai",
"version": "0.11.1",
"version": "0.11.2",
"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

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