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

@langchain/google-genai

Package Overview
Dependencies
Maintainers
8
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@langchain/google-genai - npm Package Compare versions

Comparing version 0.0.18 to 0.0.19

1

dist/utils/zod_to_genai_parameters.d.ts

@@ -11,2 +11,3 @@ import type { z } from "zod";

}
export declare function removeAdditionalProperties(obj: Record<string, any>): GenerativeAIJsonSchema;
export declare function zodToGenerativeAIParameters(zodObj: z.ZodType<any>): GenerativeAIFunctionDeclarationSchema;

39

dist/utils/zod_to_genai_parameters.js
/* eslint-disable @typescript-eslint/no-unused-vars */
import { zodToJsonSchema } from "zod-to-json-schema";
function removeAdditionalProperties(schema) {
const updatedSchema = { ...schema };
if (Object.hasOwn(updatedSchema, "additionalProperties")) {
delete updatedSchema.additionalProperties;
export function removeAdditionalProperties(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
obj) {
if (typeof obj === "object" && obj !== null) {
const newObj = { ...obj };
if ("additionalProperties" in newObj &&
typeof newObj.additionalProperties === "boolean") {
delete newObj.additionalProperties;
}
for (const key in newObj) {
if (key in newObj) {
if (Array.isArray(newObj[key])) {
newObj[key] = newObj[key].map(removeAdditionalProperties);
}
else if (typeof newObj[key] === "object" && newObj[key] !== null) {
newObj[key] = removeAdditionalProperties(newObj[key]);
}
}
}
return newObj;
}
if (updatedSchema.properties) {
const keys = Object.keys(updatedSchema.properties);
removeProperties(updatedSchema.properties, keys, 0);
}
return updatedSchema;
return obj;
}
function removeProperties(properties, keys, index) {
if (index >= keys.length || !properties) {
return;
}
const key = keys[index];
// eslint-disable-next-line no-param-reassign
properties[key] = removeAdditionalProperties(properties[key]);
removeProperties(properties, keys, index + 1);
}
export function zodToGenerativeAIParameters(

@@ -24,0 +27,0 @@ // eslint-disable-next-line @typescript-eslint/no-explicit-any

{
"name": "@langchain/google-genai",
"version": "0.0.18",
"version": "0.0.19",
"description": "Sample integration for LangChain.js",

@@ -5,0 +5,0 @@ "type": "module",

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