@langchain/google-common 0.0.25 → 0.0.27

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/index.cjs CHANGED
@@ -23,3 +23,4 @@ __exportStar(require("./types.cjs"), exports);
23
23
  __exportStar(require("./utils/stream.cjs"), exports);
24
24
  __exportStar(require("./utils/common.cjs"), exports);
25
25
  __exportStar(require("./utils/zod_to_gemini_parameters.cjs"), exports);
26
+ __exportStar(require("./utils/safety.cjs"), exports);
package/dist/index.d.ts CHANGED
@@ -7,3 +7,4 @@ export * from "./types.js";
7
7
  export * from "./utils/stream.js";
8
8
  export * from "./utils/common.js";
9
9
  export * from "./utils/zod_to_gemini_parameters.js";
10
+ export * from "./utils/safety.js";
package/dist/index.js CHANGED
@@ -7,3 +7,4 @@ export * from "./types.js";
7
7
  export * from "./utils/stream.js";
8
8
  export * from "./utils/common.js";
9
9
  export * from "./utils/zod_to_gemini_parameters.js";
10
+ export * from "./utils/safety.js";
@@ -277,7 +277,7 @@ class ReadableJsonStream extends JsonStream {
277
277
  writable: true,
278
278
  value: void 0
279
279
  });
280
- this.decoder = new TextDecoder();
280
+ this.decoder = new TextDecoder("utf-8");
281
281
  if (body) {
282
282
  void this.run(body);
283
283
  }
@@ -291,7 +291,7 @@ class ReadableJsonStream extends JsonStream {
291
291
  while (!isDone) {
292
292
  const { value, done } = await reader.read();
293
293
  if (!done) {
294
- const svalue = this.decoder.decode(value);
294
+ const svalue = this.decoder.decode(value, { stream: true });
295
295
  this.appendBuffer(svalue);
296
296
  }
297
297
  else {
@@ -270,7 +270,7 @@ export class ReadableJsonStream extends JsonStream {
270
270
  writable: true,
271
271
  value: void 0
272
272
  });
273
- this.decoder = new TextDecoder();
273
+ this.decoder = new TextDecoder("utf-8");
274
274
  if (body) {
275
275
  void this.run(body);
276
276
  }
@@ -284,7 +284,7 @@ export class ReadableJsonStream extends JsonStream {
284
284
  while (!isDone) {
285
285
  const { value, done } = await reader.read();
286
286
  if (!done) {
287
- const svalue = this.decoder.decode(value);
287
+ const svalue = this.decoder.decode(value, { stream: true });
288
288
  this.appendBuffer(svalue);
289
289
  }
290
290
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/google-common",
3
- "version": "0.0.25",
3
+ "version": "0.0.27",
4
4
  "description": "Core types and classes for Google services.",
5
5
  "type": "module",
6
6
  "engines": {
@@ -15,27 +15,19 @@
15
15
  "homepage": "https://github.com/langchain-ai/langchainjs/tree/main/libs/langchain-google-common/",
16
16
  "scripts": {
17
17
  "build": "yarn turbo:command build:internal --filter=@langchain/google-common",
18
- "build:internal": "yarn lc_build_v2 --create-entrypoints --pre --tree-shaking",
19
- "build:deps": "yarn run turbo:command build --filter=@langchain/core",
20
- "build:esm": "NODE_OPTIONS=--max-old-space-size=4096 tsc --outDir dist/ && rm -rf dist/tests dist/**/tests",
21
- "build:cjs": "NODE_OPTIONS=--max-old-space-size=4096 tsc --outDir dist-cjs/ -p tsconfig.cjs.json && yarn move-cjs-to-dist && rm -rf dist-cjs",
22
- "build:watch": "yarn create-entrypoints && tsc --outDir dist/ --watch",
23
- "build:scripts": "yarn create-entrypoints && yarn check-tree-shaking",
18
+ "build:internal": "yarn lc_build --create-entrypoints --pre --tree-shaking",
24
19
  "lint:eslint": "NODE_OPTIONS=--max-old-space-size=4096 eslint --cache --ext .ts,.js src/",
25
20
  "lint:dpdm": "dpdm --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts",
26
21
  "lint": "yarn lint:eslint && yarn lint:dpdm",
27
22
  "lint:fix": "yarn lint:eslint --fix && yarn lint:dpdm",
28
23
  "clean": "rm -rf .turbo dist/",
29
24
  "prepack": "yarn build",
30
- "test": "yarn run build:deps && NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts --testTimeout 30000 --maxWorkers=50%",
31
- "test:watch": "yarn run build:deps && NODE_OPTIONS=--experimental-vm-modules jest --watch --testPathIgnorePatterns=\\.int\\.test.ts",
32
- "test:single": "yarn run build:deps && NODE_OPTIONS=--experimental-vm-modules yarn run jest --config jest.config.cjs --testTimeout 100000",
33
- "test:integration": "NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.int\\.test.ts --testTimeout 100000 --maxWorkers=50%",
25
+ "test": "NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts --testTimeout 30000 --maxWorkers=50%",
26
+ "test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch --testPathIgnorePatterns=\\.int\\.test.ts",
27
+ "test:single": "NODE_OPTIONS=--experimental-vm-modules yarn run jest --config jest.config.cjs --testTimeout 100000",
28
+ "test:int": "NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.int\\.test.ts --testTimeout 100000 --maxWorkers=50%",
34
29
  "format": "prettier --config .prettierrc --write \"src\"",
35
- "format:check": "prettier --config .prettierrc --check \"src\"",
36
- "move-cjs-to-dist": "yarn lc-build --config ./langchain.config.js --move-cjs-dist",
37
- "create-entrypoints": "yarn lc-build --config ./langchain.config.js --create-entrypoints",
38
- "check-tree-shaking": "yarn lc-build --config ./langchain.config.js --tree-shaking"
30
+ "format:check": "prettier --config .prettierrc --check \"src\""
39
31
  },
40
32
  "author": "LangChain",
41
33
  "license": "MIT",
@@ -46,7 +38,7 @@
46
38
  },
47
39
  "devDependencies": {
48
40
  "@jest/globals": "^29.5.0",
49
- "@langchain/scripts": "~0.0.20",
41
+ "@langchain/scripts": ">=0.1.0 <0.2.0",
50
42
  "@swc/core": "^1.3.90",
51
43
  "@swc/jest": "^0.2.29",
52
44
  "@tsconfig/recommended": "^1.0.3",