Skip to content

Commit 5daeace

Browse files
authored
google-genai[patch]: Fix api options which caused requests to hang (#5490)
1 parent 42e9e17 commit 5daeace

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

libs/langchain-google-genai/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
"lint:fix": "yarn lint:eslint --fix && yarn lint:dpdm",
2727
"clean": "rm -rf dist/ && NODE_OPTIONS=--max-old-space-size=4096 yarn lc-build --config ./langchain.config.js --create-entrypoints --pre",
2828
"prepack": "yarn build",
29-
"test": "NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts --testTimeout 30000 --maxWorkers=50%",
30-
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch --testPathIgnorePatterns=\\.int\\.test.ts",
31-
"test:single": "NODE_OPTIONS=--experimental-vm-modules yarn run jest --config jest.config.cjs --testTimeout 100000",
32-
"test:int": "NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.int\\.test.ts --testTimeout 100000 --maxWorkers=50%",
29+
"test": "yarn build:deps && NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts --testTimeout 30000 --maxWorkers=50%",
30+
"test:watch": "yarn build:deps && NODE_OPTIONS=--experimental-vm-modules jest --watch --testPathIgnorePatterns=\\.int\\.test.ts",
31+
"test:single": "yarn build:deps && NODE_OPTIONS=--experimental-vm-modules yarn run jest --config jest.config.cjs --testTimeout 100000",
32+
"test:int": "yarn build:deps && NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.int\\.test.ts --testTimeout 100000 --maxWorkers=50%",
3333
"format": "prettier --config .prettierrc --write \"src\"",
3434
"format:check": "prettier --config .prettierrc --check \"src\"",
3535
"move-cjs-to-dist": "yarn lc-build --config ./langchain.config.js --move-cjs-dist",

libs/langchain-google-genai/src/chat_models.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,6 @@ export class ChatGoogleGenerativeAI
192192

193193
apiKey?: string;
194194

195-
apiVersion?: string = "v1";
196-
197-
baseUrl?: string = "https://generativeai.googleapis.com";
198-
199195
streaming = false;
200196

201197
private client: GenerativeModel;
@@ -278,8 +274,8 @@ export class ChatGoogleGenerativeAI
278274
},
279275
},
280276
{
281-
apiVersion: this.apiVersion,
282-
baseUrl: this.baseUrl,
277+
apiVersion: fields?.apiVersion,
278+
baseUrl: fields?.baseUrl,
283279
}
284280
);
285281
}

0 commit comments

Comments
 (0)