@langchain/google-gauth 2.1.26 → 2.1.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/CHANGELOG.md +7 -0
- package/README.md +2 -5
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.js.map +1 -1
- package/dist/chat_models.cjs +1 -1
- package/dist/chat_models.js +1 -1
- package/dist/llms.cjs +1 -1
- package/dist/llms.js +1 -1
- package/package.json +6 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @langchain/google-gauth
|
|
2
2
|
|
|
3
|
+
## 2.1.27
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`c308903`](https://github.com/langchain-ai/langchainjs/commit/c308903ee5046c838af8fb274c45d7ba9baf9ed8)]:
|
|
8
|
+
- @langchain/google-common@2.1.27
|
|
9
|
+
|
|
3
10
|
## 2.1.26
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -8,17 +8,15 @@ Google Cloud Platform environment it is running on.
|
|
|
8
8
|
|
|
9
9
|
If you are running this on a platform where the credentials cannot
|
|
10
10
|
be provided this way, consider using the @langchain/google-webauth
|
|
11
|
-
package
|
|
11
|
+
package _instead_. You do not need to use both packages. See the
|
|
12
12
|
section on **Authorization** below.
|
|
13
13
|
|
|
14
|
-
|
|
15
14
|
## Installation
|
|
16
15
|
|
|
17
16
|
```bash
|
|
18
17
|
$ pnpm install @langchain/google-gauth
|
|
19
18
|
```
|
|
20
19
|
|
|
21
|
-
|
|
22
20
|
## Authorization
|
|
23
21
|
|
|
24
22
|
Authorization is either done through the use of an API Key, if it is
|
|
@@ -34,9 +32,8 @@ credentials from the first of the following that apply:
|
|
|
34
32
|
2. Credentials that are passed to the constructor using the `authInfo` attribute
|
|
35
33
|
3. An API Key that is set in the environment variable `API_KEY`
|
|
36
34
|
4. The Service Account credentials that are saved in a file. The path to
|
|
37
|
-
this file is set in the `GOOGLE_APPLICATION_CREDENTIALS` environment
|
|
35
|
+
this file is set in the `GOOGLE_APPLICATION_CREDENTIALS` environment
|
|
38
36
|
variable.
|
|
39
37
|
5. If you are running on a Google Cloud Platform resource, or if you have
|
|
40
38
|
logged in using `gcloud auth application-default login`, then the
|
|
41
39
|
default credentials.
|
|
42
|
-
|
package/dist/auth.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.cjs","names":["GoogleAbstractedFetchClient","GoogleAuth"],"sources":["../src/auth.ts"],"sourcesContent":["import { Readable } from \"stream\";\nimport {\n AbstractStream,\n ensureAuthOptionScopes,\n GoogleAbstractedClientOps,\n GoogleAbstractedFetchClient,\n GoogleConnectionParams,\n JsonStream,\n SseJsonStream,\n SseStream,\n} from \"@langchain/google-common\";\nimport { GoogleAuth, GoogleAuthOptions } from \"google-auth-library\";\n\nexport class NodeAbstractStream implements AbstractStream {\n private baseStream: AbstractStream;\n\n constructor(baseStream: AbstractStream, data: Readable) {\n this.baseStream = baseStream;\n const decoder = new TextDecoder(\"utf-8\");\n data.on(\"data\", (data) => {\n const text = decoder.decode(data, { stream: true });\n this.appendBuffer(text);\n });\n data.on(\"end\", () => {\n const rest = decoder.decode();\n this.appendBuffer(rest);\n this.closeBuffer();\n });\n }\n\n appendBuffer(data: string): void {\n return this.baseStream.appendBuffer(data);\n }\n\n closeBuffer(): void {\n return this.baseStream.closeBuffer();\n }\n\n //
|
|
1
|
+
{"version":3,"file":"auth.cjs","names":["GoogleAbstractedFetchClient","GoogleAuth"],"sources":["../src/auth.ts"],"sourcesContent":["import { Readable } from \"stream\";\nimport {\n AbstractStream,\n ensureAuthOptionScopes,\n GoogleAbstractedClientOps,\n GoogleAbstractedFetchClient,\n GoogleConnectionParams,\n JsonStream,\n SseJsonStream,\n SseStream,\n} from \"@langchain/google-common\";\nimport { GoogleAuth, GoogleAuthOptions } from \"google-auth-library\";\n\nexport class NodeAbstractStream implements AbstractStream {\n private baseStream: AbstractStream;\n\n constructor(baseStream: AbstractStream, data: Readable) {\n this.baseStream = baseStream;\n const decoder = new TextDecoder(\"utf-8\");\n data.on(\"data\", (data) => {\n const text = decoder.decode(data, { stream: true });\n this.appendBuffer(text);\n });\n data.on(\"end\", () => {\n const rest = decoder.decode();\n this.appendBuffer(rest);\n this.closeBuffer();\n });\n }\n\n appendBuffer(data: string): void {\n return this.baseStream.appendBuffer(data);\n }\n\n closeBuffer(): void {\n return this.baseStream.closeBuffer();\n }\n\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n nextChunk(): Promise<any> {\n return this.baseStream.nextChunk();\n }\n\n get streamDone(): boolean {\n return this.baseStream.streamDone;\n }\n}\n\nexport class NodeJsonStream extends NodeAbstractStream {\n constructor(data: Readable) {\n super(new JsonStream(), data);\n }\n}\n\nexport class NodeSseStream extends NodeAbstractStream {\n constructor(data: Readable) {\n super(new SseStream(), data);\n }\n}\n\nexport class NodeSseJsonStream extends NodeAbstractStream {\n constructor(data: Readable) {\n super(new SseJsonStream(), data);\n }\n}\n\nexport class GAuthClient extends GoogleAbstractedFetchClient {\n gauth: GoogleAuth;\n\n constructor(fields?: GoogleConnectionParams<GoogleAuthOptions>) {\n super();\n const options = ensureAuthOptionScopes<GoogleAuthOptions>(\n fields?.authOptions,\n \"scopes\",\n fields?.platformType\n );\n this.gauth = new GoogleAuth(options);\n this._fetch = async (...args) => {\n const url = args[0];\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n const opts: any = args[1] ?? {};\n opts.responseType = \"stream\";\n return await this.gauth.fetch(url, opts);\n };\n }\n\n get clientType(): string {\n return \"gauth\";\n }\n\n async getProjectId(): Promise<string> {\n return this.gauth.getProjectId();\n }\n\n async request(opts: GoogleAbstractedClientOps): Promise<unknown> {\n return this._request(opts?.url, opts, {});\n }\n}\n"],"mappings":";;;AAkEA,IAAa,cAAb,cAAiCA,yBAAAA,4BAA4B;CAC3D;CAEA,YAAY,QAAoD;AAC9D,SAAO;AAMP,OAAK,QAAQ,IAAIC,oBAAAA,YAAAA,GAAAA,yBAAAA,wBAJf,QAAQ,aACR,UACA,QAAQ,aACT,CACmC;AACpC,OAAK,SAAS,OAAO,GAAG,SAAS;GAC/B,MAAM,MAAM,KAAK;GAEjB,MAAM,OAAY,KAAK,MAAM,EAAE;AAC/B,QAAK,eAAe;AACpB,UAAO,MAAM,KAAK,MAAM,MAAM,KAAK,KAAK;;;CAI5C,IAAI,aAAqB;AACvB,SAAO;;CAGT,MAAM,eAAgC;AACpC,SAAO,KAAK,MAAM,cAAc;;CAGlC,MAAM,QAAQ,MAAmD;AAC/D,SAAO,KAAK,SAAS,MAAM,KAAK,MAAM,EAAE,CAAC"}
|
package/dist/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","names":[],"sources":["../src/auth.ts"],"sourcesContent":["import { Readable } from \"stream\";\nimport {\n AbstractStream,\n ensureAuthOptionScopes,\n GoogleAbstractedClientOps,\n GoogleAbstractedFetchClient,\n GoogleConnectionParams,\n JsonStream,\n SseJsonStream,\n SseStream,\n} from \"@langchain/google-common\";\nimport { GoogleAuth, GoogleAuthOptions } from \"google-auth-library\";\n\nexport class NodeAbstractStream implements AbstractStream {\n private baseStream: AbstractStream;\n\n constructor(baseStream: AbstractStream, data: Readable) {\n this.baseStream = baseStream;\n const decoder = new TextDecoder(\"utf-8\");\n data.on(\"data\", (data) => {\n const text = decoder.decode(data, { stream: true });\n this.appendBuffer(text);\n });\n data.on(\"end\", () => {\n const rest = decoder.decode();\n this.appendBuffer(rest);\n this.closeBuffer();\n });\n }\n\n appendBuffer(data: string): void {\n return this.baseStream.appendBuffer(data);\n }\n\n closeBuffer(): void {\n return this.baseStream.closeBuffer();\n }\n\n //
|
|
1
|
+
{"version":3,"file":"auth.js","names":[],"sources":["../src/auth.ts"],"sourcesContent":["import { Readable } from \"stream\";\nimport {\n AbstractStream,\n ensureAuthOptionScopes,\n GoogleAbstractedClientOps,\n GoogleAbstractedFetchClient,\n GoogleConnectionParams,\n JsonStream,\n SseJsonStream,\n SseStream,\n} from \"@langchain/google-common\";\nimport { GoogleAuth, GoogleAuthOptions } from \"google-auth-library\";\n\nexport class NodeAbstractStream implements AbstractStream {\n private baseStream: AbstractStream;\n\n constructor(baseStream: AbstractStream, data: Readable) {\n this.baseStream = baseStream;\n const decoder = new TextDecoder(\"utf-8\");\n data.on(\"data\", (data) => {\n const text = decoder.decode(data, { stream: true });\n this.appendBuffer(text);\n });\n data.on(\"end\", () => {\n const rest = decoder.decode();\n this.appendBuffer(rest);\n this.closeBuffer();\n });\n }\n\n appendBuffer(data: string): void {\n return this.baseStream.appendBuffer(data);\n }\n\n closeBuffer(): void {\n return this.baseStream.closeBuffer();\n }\n\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n nextChunk(): Promise<any> {\n return this.baseStream.nextChunk();\n }\n\n get streamDone(): boolean {\n return this.baseStream.streamDone;\n }\n}\n\nexport class NodeJsonStream extends NodeAbstractStream {\n constructor(data: Readable) {\n super(new JsonStream(), data);\n }\n}\n\nexport class NodeSseStream extends NodeAbstractStream {\n constructor(data: Readable) {\n super(new SseStream(), data);\n }\n}\n\nexport class NodeSseJsonStream extends NodeAbstractStream {\n constructor(data: Readable) {\n super(new SseJsonStream(), data);\n }\n}\n\nexport class GAuthClient extends GoogleAbstractedFetchClient {\n gauth: GoogleAuth;\n\n constructor(fields?: GoogleConnectionParams<GoogleAuthOptions>) {\n super();\n const options = ensureAuthOptionScopes<GoogleAuthOptions>(\n fields?.authOptions,\n \"scopes\",\n fields?.platformType\n );\n this.gauth = new GoogleAuth(options);\n this._fetch = async (...args) => {\n const url = args[0];\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n const opts: any = args[1] ?? {};\n opts.responseType = \"stream\";\n return await this.gauth.fetch(url, opts);\n };\n }\n\n get clientType(): string {\n return \"gauth\";\n }\n\n async getProjectId(): Promise<string> {\n return this.gauth.getProjectId();\n }\n\n async request(opts: GoogleAbstractedClientOps): Promise<unknown> {\n return this._request(opts?.url, opts, {});\n }\n}\n"],"mappings":";;;AAkEA,IAAa,cAAb,cAAiC,4BAA4B;CAC3D;CAEA,YAAY,QAAoD;AAC9D,SAAO;AAMP,OAAK,QAAQ,IAAI,WALD,uBACd,QAAQ,aACR,UACA,QAAQ,aACT,CACmC;AACpC,OAAK,SAAS,OAAO,GAAG,SAAS;GAC/B,MAAM,MAAM,KAAK;GAEjB,MAAM,OAAY,KAAK,MAAM,EAAE;AAC/B,QAAK,eAAe;AACpB,UAAO,MAAM,KAAK,MAAM,MAAM,KAAK,KAAK;;;CAI5C,IAAI,aAAqB;AACvB,SAAO;;CAGT,MAAM,eAAgC;AACpC,SAAO,KAAK,MAAM,cAAc;;CAGlC,MAAM,QAAQ,MAAmD;AAC/D,SAAO,KAAK,SAAS,MAAM,KAAK,MAAM,EAAE,CAAC"}
|
package/dist/chat_models.cjs
CHANGED
|
@@ -14,7 +14,7 @@ var ChatGoogle = class extends _langchain_google_common.ChatGoogleBase {
|
|
|
14
14
|
model: modelOrFields
|
|
15
15
|
} : modelOrFields ?? {};
|
|
16
16
|
super(fields);
|
|
17
|
-
this._addVersion("@langchain/google-gauth", "2.1.
|
|
17
|
+
this._addVersion("@langchain/google-gauth", "2.1.27");
|
|
18
18
|
}
|
|
19
19
|
buildAbstractedClient(fields) {
|
|
20
20
|
return new require_auth.GAuthClient(fields);
|
package/dist/chat_models.js
CHANGED
|
@@ -14,7 +14,7 @@ var ChatGoogle = class extends ChatGoogleBase {
|
|
|
14
14
|
model: modelOrFields
|
|
15
15
|
} : modelOrFields ?? {};
|
|
16
16
|
super(fields);
|
|
17
|
-
this._addVersion("@langchain/google-gauth", "2.1.
|
|
17
|
+
this._addVersion("@langchain/google-gauth", "2.1.27");
|
|
18
18
|
}
|
|
19
19
|
buildAbstractedClient(fields) {
|
|
20
20
|
return new GAuthClient(fields);
|
package/dist/llms.cjs
CHANGED
|
@@ -11,7 +11,7 @@ var GoogleLLM = class extends _langchain_google_common.GoogleBaseLLM {
|
|
|
11
11
|
lc_serializable = true;
|
|
12
12
|
constructor(fields) {
|
|
13
13
|
super(fields);
|
|
14
|
-
this._addVersion("@langchain/google-gauth", "2.1.
|
|
14
|
+
this._addVersion("@langchain/google-gauth", "2.1.27");
|
|
15
15
|
}
|
|
16
16
|
buildAbstractedClient(fields) {
|
|
17
17
|
return new require_auth.GAuthClient(fields);
|
package/dist/llms.js
CHANGED
|
@@ -11,7 +11,7 @@ var GoogleLLM = class extends GoogleBaseLLM {
|
|
|
11
11
|
lc_serializable = true;
|
|
12
12
|
constructor(fields) {
|
|
13
13
|
super(fields);
|
|
14
|
-
this._addVersion("@langchain/google-gauth", "2.1.
|
|
14
|
+
this._addVersion("@langchain/google-gauth", "2.1.27");
|
|
15
15
|
}
|
|
16
16
|
buildAbstractedClient(fields) {
|
|
17
17
|
return new GAuthClient(fields);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langchain/google-gauth",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.27",
|
|
4
4
|
"description": "Google auth based authentication support for Google services",
|
|
5
5
|
"author": "LangChain",
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,19 +14,16 @@
|
|
|
14
14
|
},
|
|
15
15
|
"homepage": "https://github.com/langchain-ai/langchainjs/tree/main/libs/providers/langchain-google-gauth/",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"google-auth-library": "^10.
|
|
18
|
-
"@langchain/google-common": "2.1.
|
|
17
|
+
"google-auth-library": "^10.6.2",
|
|
18
|
+
"@langchain/google-common": "2.1.27"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@tsconfig/recommended": "^1.0.3",
|
|
22
|
-
"dotenv": "^
|
|
22
|
+
"dotenv": "^17.4.0",
|
|
23
23
|
"dpdm": "^3.14.0",
|
|
24
|
-
"eslint": "^9.34.0",
|
|
25
|
-
"prettier": "^3.5.0",
|
|
26
24
|
"typescript": "~5.8.3",
|
|
27
|
-
"vitest": "^
|
|
25
|
+
"vitest": "^4.1.2",
|
|
28
26
|
"zod": "^3.25.76",
|
|
29
|
-
"@langchain/eslint": "0.1.1",
|
|
30
27
|
"@langchain/tsconfig": "0.0.1"
|
|
31
28
|
},
|
|
32
29
|
"publishConfig": {
|
|
@@ -80,10 +77,6 @@
|
|
|
80
77
|
"scripts": {
|
|
81
78
|
"build": "turbo build:compile --filter @langchain/google-gauth --output-logs new-only",
|
|
82
79
|
"build:compile": "tsdown",
|
|
83
|
-
"lint:eslint": "eslint --cache src/",
|
|
84
|
-
"lint:dpdm": "dpdm --skip-dynamic-imports circular --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts",
|
|
85
|
-
"lint": "pnpm lint:eslint && pnpm lint:dpdm",
|
|
86
|
-
"lint:fix": "pnpm lint:eslint --fix && pnpm lint:dpdm",
|
|
87
80
|
"clean": "rm -rf .turbo dist/",
|
|
88
81
|
"test": "vitest run",
|
|
89
82
|
"test:watch": "vitest",
|
|
@@ -91,8 +84,6 @@
|
|
|
91
84
|
"test:int": "vitest run --mode int",
|
|
92
85
|
"test:standard:unit": "vitest run --mode standard-unit",
|
|
93
86
|
"test:standard:int": "vitest run --mode standard-int",
|
|
94
|
-
"test:standard": "pnpm test:standard:unit && pnpm test:standard:int"
|
|
95
|
-
"format": "prettier --write \"src\"",
|
|
96
|
-
"format:check": "prettier --check \"src\""
|
|
87
|
+
"test:standard": "pnpm test:standard:unit && pnpm test:standard:int"
|
|
97
88
|
}
|
|
98
89
|
}
|