@langchain/google-common 0.1.4 → 0.1.5
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 -0
- package/dist/chat_models.js +1 -0
- package/dist/embeddings.cjs +4 -0
- package/dist/embeddings.js +4 -0
- package/dist/utils/gemini.cjs +11 -2
- package/dist/utils/gemini.js +11 -2
- package/package.json +1 -1
package/dist/chat_models.cjs
CHANGED
package/dist/chat_models.js
CHANGED
package/dist/embeddings.cjs
CHANGED
|
@@ -19,6 +19,10 @@ class EmbeddingsConnection extends connection_js_1.GoogleAIConnection {
|
|
|
19
19
|
async buildUrlMethod() {
|
|
20
20
|
return "predict";
|
|
21
21
|
}
|
|
22
|
+
get modelPublisher() {
|
|
23
|
+
// All the embedding models are currently published by "google"
|
|
24
|
+
return "google";
|
|
25
|
+
}
|
|
22
26
|
async formatData(input, parameters) {
|
|
23
27
|
return {
|
|
24
28
|
instances: input,
|
package/dist/embeddings.js
CHANGED
|
@@ -16,6 +16,10 @@ class EmbeddingsConnection extends GoogleAIConnection {
|
|
|
16
16
|
async buildUrlMethod() {
|
|
17
17
|
return "predict";
|
|
18
18
|
}
|
|
19
|
+
get modelPublisher() {
|
|
20
|
+
// All the embedding models are currently published by "google"
|
|
21
|
+
return "google";
|
|
22
|
+
}
|
|
19
23
|
async formatData(input, parameters) {
|
|
20
24
|
return {
|
|
21
25
|
instances: input,
|
package/dist/utils/gemini.cjs
CHANGED
|
@@ -808,10 +808,19 @@ function getGeminiAPI(config) {
|
|
|
808
808
|
if (!parameters.tool_choice || typeof parameters.tool_choice !== "string") {
|
|
809
809
|
return undefined;
|
|
810
810
|
}
|
|
811
|
+
if (["auto", "any", "none"].includes(parameters.tool_choice)) {
|
|
812
|
+
return {
|
|
813
|
+
functionCallingConfig: {
|
|
814
|
+
mode: parameters.tool_choice,
|
|
815
|
+
allowedFunctionNames: parameters.allowed_function_names,
|
|
816
|
+
},
|
|
817
|
+
};
|
|
818
|
+
}
|
|
819
|
+
// force tool choice to be a single function name in case of structured output
|
|
811
820
|
return {
|
|
812
821
|
functionCallingConfig: {
|
|
813
|
-
mode:
|
|
814
|
-
allowedFunctionNames: parameters.
|
|
822
|
+
mode: "any",
|
|
823
|
+
allowedFunctionNames: [parameters.tool_choice],
|
|
815
824
|
},
|
|
816
825
|
};
|
|
817
826
|
}
|
package/dist/utils/gemini.js
CHANGED
|
@@ -803,10 +803,19 @@ export function getGeminiAPI(config) {
|
|
|
803
803
|
if (!parameters.tool_choice || typeof parameters.tool_choice !== "string") {
|
|
804
804
|
return undefined;
|
|
805
805
|
}
|
|
806
|
+
if (["auto", "any", "none"].includes(parameters.tool_choice)) {
|
|
807
|
+
return {
|
|
808
|
+
functionCallingConfig: {
|
|
809
|
+
mode: parameters.tool_choice,
|
|
810
|
+
allowedFunctionNames: parameters.allowed_function_names,
|
|
811
|
+
},
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
// force tool choice to be a single function name in case of structured output
|
|
806
815
|
return {
|
|
807
816
|
functionCallingConfig: {
|
|
808
|
-
mode:
|
|
809
|
-
allowedFunctionNames: parameters.
|
|
817
|
+
mode: "any",
|
|
818
|
+
allowedFunctionNames: [parameters.tool_choice],
|
|
810
819
|
},
|
|
811
820
|
};
|
|
812
821
|
}
|