@langchain/google-genai
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -23,2 +23,3 @@ import { AIMessage, AIMessageChunk, ChatMessage, isBaseMessage, } from "@langchain/core/messages"; | ||
case "ai": | ||
case "model": // getMessageAuthor returns message.name. code ex.: return message.name ?? type; | ||
return "model"; | ||
@@ -119,3 +120,3 @@ case "system": | ||
const { content, ...generationInfo } = candidate; | ||
const text = content.parts[0]?.text ?? ""; | ||
const text = content?.parts[0]?.text ?? ""; | ||
const generation = { | ||
@@ -125,3 +126,3 @@ text, | ||
content: text, | ||
name: content === null ? undefined : content.role, | ||
name: !content ? undefined : content.role, | ||
additional_kwargs: generationInfo, | ||
@@ -141,3 +142,3 @@ }), | ||
const { content, ...generationInfo } = candidate; | ||
const text = content.parts[0]?.text ?? ""; | ||
const text = content?.parts[0]?.text ?? ""; | ||
return new ChatGenerationChunk({ | ||
@@ -147,3 +148,3 @@ text, | ||
content: text, | ||
name: content === null ? undefined : content.role, | ||
name: !content ? undefined : content.role, | ||
// Each chunk can have unique "generationInfo", and merging strategy is unclear, | ||
@@ -150,0 +151,0 @@ // so leave blank for now. |
{ | ||
"name": "@langchain/google-genai", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "Sample integration for LangChain.js", | ||
@@ -22,4 +22,6 @@ "type": "module", | ||
"build:scripts": "node scripts/create-entrypoints.js && node scripts/check-tree-shaking.js", | ||
"lint": "NODE_OPTIONS=--max-old-space-size=4096 eslint src && dpdm --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts", | ||
"lint:fix": "yarn lint --fix", | ||
"lint:eslint": "NODE_OPTIONS=--max-old-space-size=4096 eslint --cache --ext .ts,.js src/", | ||
"lint:dpdm": "dpdm --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts", | ||
"lint": "yarn lint:eslint && yarn lint:dpdm", | ||
"lint:fix": "yarn lint:eslint --fix && yarn lint:dpdm", | ||
"clean": "rm -rf dist/ && NODE_OPTIONS=--max-old-space-size=4096 node scripts/create-entrypoints.js pre", | ||
@@ -31,4 +33,4 @@ "prepack": "yarn build", | ||
"test:int": "NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.int\\.test.ts --testTimeout 100000 --maxWorkers=50%", | ||
"format": "prettier --write \"src\"", | ||
"format:check": "prettier --check \"src\"" | ||
"format": "prettier --config .prettierrc --write \"src\" \"scripts\"", | ||
"format:check": "prettier --config .prettierrc --check \"src\" \"scripts\"" | ||
}, | ||
@@ -38,3 +40,3 @@ "author": "LangChain", | ||
"dependencies": { | ||
"@google/generative-ai": "^0.1.0", | ||
"@google/generative-ai": "^0.1.3", | ||
"@langchain/core": "~0.1.5" | ||
@@ -41,0 +43,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
56631
1275
Updated@google/generative-ai@^0.1.3