@langchain/google-common 0.0.24 → 0.0.26
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/chat_models.cjs +1 -1
- package/dist/chat_models.d.ts +1 -1
- package/dist/chat_models.js +1 -1
- package/dist/embeddings.cjs +2 -20
- package/dist/embeddings.d.ts +2 -20
- package/dist/embeddings.js +2 -20
- package/dist/utils/stream.cjs +2 -2
- package/dist/utils/stream.js +2 -2
- package/package.json +1 -1
package/dist/chat_models.cjs
CHANGED
|
@@ -98,7 +98,7 @@ class ChatConnection extends connection_js_1.AbstractGoogleLLMConnection {
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
|
-
* Integration with a chat model.
|
|
101
|
+
* Integration with a Google chat model.
|
|
102
102
|
*/
|
|
103
103
|
class ChatGoogleBase extends chat_models_1.BaseChatModel {
|
|
104
104
|
// Used for tracing, replace with the same name as your class
|
package/dist/chat_models.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ declare class ChatConnection<AuthOptions> extends AbstractGoogleLLMConnection<Ba
|
|
|
25
25
|
export interface ChatGoogleBaseInput<AuthOptions> extends BaseChatModelParams, GoogleConnectionParams<AuthOptions>, GoogleAIModelParams, GoogleAISafetyParams, Pick<GoogleAIBaseLanguageModelCallOptions, "streamUsage"> {
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
* Integration with a chat model.
|
|
28
|
+
* Integration with a Google chat model.
|
|
29
29
|
*/
|
|
30
30
|
export declare abstract class ChatGoogleBase<AuthOptions> extends BaseChatModel<GoogleAIBaseLanguageModelCallOptions, AIMessageChunk> implements ChatGoogleBaseInput<AuthOptions> {
|
|
31
31
|
static lc_name(): string;
|
package/dist/chat_models.js
CHANGED
|
@@ -95,7 +95,7 @@ class ChatConnection extends AbstractGoogleLLMConnection {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
/**
|
|
98
|
-
* Integration with a chat model.
|
|
98
|
+
* Integration with a Google chat model.
|
|
99
99
|
*/
|
|
100
100
|
export class ChatGoogleBase extends BaseChatModel {
|
|
101
101
|
// Used for tracing, replace with the same name as your class
|
package/dist/embeddings.cjs
CHANGED
|
@@ -27,26 +27,8 @@ class EmbeddingsConnection extends connection_js_1.GoogleAIConnection {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
|
-
* Enables calls to
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* To use, you will need to have one of the following authentication
|
|
34
|
-
* methods in place:
|
|
35
|
-
* - You are logged into an account permitted to the Google Cloud project
|
|
36
|
-
* using Vertex AI.
|
|
37
|
-
* - You are running this on a machine using a service account permitted to
|
|
38
|
-
* the Google Cloud project using Vertex AI.
|
|
39
|
-
* - The `GOOGLE_APPLICATION_CREDENTIALS` environment variable is set to the
|
|
40
|
-
* path of a credentials file for a service account permitted to the
|
|
41
|
-
* Google Cloud project using Vertex AI.
|
|
42
|
-
* @example
|
|
43
|
-
* ```typescript
|
|
44
|
-
* const model = new GoogleEmbeddings();
|
|
45
|
-
* const res = await model.embedQuery(
|
|
46
|
-
* "What would be a good company name for a company that makes colorful socks?"
|
|
47
|
-
* );
|
|
48
|
-
* console.log({ res });
|
|
49
|
-
* ```
|
|
30
|
+
* Enables calls to Google APIs for generating
|
|
31
|
+
* text embeddings.
|
|
50
32
|
*/
|
|
51
33
|
class BaseGoogleEmbeddings extends embeddings_1.Embeddings {
|
|
52
34
|
constructor(fields) {
|
package/dist/embeddings.d.ts
CHANGED
|
@@ -42,26 +42,8 @@ export interface GoogleEmbeddingsResponse extends GoogleResponse {
|
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
|
-
* Enables calls to
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* To use, you will need to have one of the following authentication
|
|
49
|
-
* methods in place:
|
|
50
|
-
* - You are logged into an account permitted to the Google Cloud project
|
|
51
|
-
* using Vertex AI.
|
|
52
|
-
* - You are running this on a machine using a service account permitted to
|
|
53
|
-
* the Google Cloud project using Vertex AI.
|
|
54
|
-
* - The `GOOGLE_APPLICATION_CREDENTIALS` environment variable is set to the
|
|
55
|
-
* path of a credentials file for a service account permitted to the
|
|
56
|
-
* Google Cloud project using Vertex AI.
|
|
57
|
-
* @example
|
|
58
|
-
* ```typescript
|
|
59
|
-
* const model = new GoogleEmbeddings();
|
|
60
|
-
* const res = await model.embedQuery(
|
|
61
|
-
* "What would be a good company name for a company that makes colorful socks?"
|
|
62
|
-
* );
|
|
63
|
-
* console.log({ res });
|
|
64
|
-
* ```
|
|
45
|
+
* Enables calls to Google APIs for generating
|
|
46
|
+
* text embeddings.
|
|
65
47
|
*/
|
|
66
48
|
export declare abstract class BaseGoogleEmbeddings<AuthOptions> extends Embeddings implements BaseGoogleEmbeddingsParams<AuthOptions> {
|
|
67
49
|
model: string;
|
package/dist/embeddings.js
CHANGED
|
@@ -24,26 +24,8 @@ class EmbeddingsConnection extends GoogleAIConnection {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
|
-
* Enables calls to
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* To use, you will need to have one of the following authentication
|
|
31
|
-
* methods in place:
|
|
32
|
-
* - You are logged into an account permitted to the Google Cloud project
|
|
33
|
-
* using Vertex AI.
|
|
34
|
-
* - You are running this on a machine using a service account permitted to
|
|
35
|
-
* the Google Cloud project using Vertex AI.
|
|
36
|
-
* - The `GOOGLE_APPLICATION_CREDENTIALS` environment variable is set to the
|
|
37
|
-
* path of a credentials file for a service account permitted to the
|
|
38
|
-
* Google Cloud project using Vertex AI.
|
|
39
|
-
* @example
|
|
40
|
-
* ```typescript
|
|
41
|
-
* const model = new GoogleEmbeddings();
|
|
42
|
-
* const res = await model.embedQuery(
|
|
43
|
-
* "What would be a good company name for a company that makes colorful socks?"
|
|
44
|
-
* );
|
|
45
|
-
* console.log({ res });
|
|
46
|
-
* ```
|
|
27
|
+
* Enables calls to Google APIs for generating
|
|
28
|
+
* text embeddings.
|
|
47
29
|
*/
|
|
48
30
|
export class BaseGoogleEmbeddings extends Embeddings {
|
|
49
31
|
constructor(fields) {
|
package/dist/utils/stream.cjs
CHANGED
|
@@ -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 {
|
package/dist/utils/stream.js
CHANGED
|
@@ -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 {
|