@copilotkit/runtime 1.50.0 → 1.50.1-next.0
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 +8 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/service-adapters/google/google-genai-adapter.ts +19 -4
package/dist/index.mjs
CHANGED
|
@@ -65,7 +65,7 @@ var require_package = __commonJS({
|
|
|
65
65
|
publishConfig: {
|
|
66
66
|
access: "public"
|
|
67
67
|
},
|
|
68
|
-
version: "1.50.0",
|
|
68
|
+
version: "1.50.1-next.0",
|
|
69
69
|
sideEffects: false,
|
|
70
70
|
main: "./dist/index.js",
|
|
71
71
|
module: "./dist/index.mjs",
|
|
@@ -849,11 +849,17 @@ var LangChainAdapter = class {
|
|
|
849
849
|
__name(LangChainAdapter, "LangChainAdapter");
|
|
850
850
|
|
|
851
851
|
// src/service-adapters/google/google-genai-adapter.ts
|
|
852
|
-
var DEFAULT_MODEL2 = "gemini-
|
|
852
|
+
var DEFAULT_MODEL2 = "gemini-2.5-flash";
|
|
853
|
+
var DEFAULT_API_VERSION = "v1";
|
|
854
|
+
var hasWarnedDefaultGoogleModel = false;
|
|
853
855
|
var GoogleGenerativeAIAdapter = class extends LangChainAdapter {
|
|
854
856
|
provider = "google";
|
|
855
857
|
model = DEFAULT_MODEL2;
|
|
856
858
|
constructor(options) {
|
|
859
|
+
if (!hasWarnedDefaultGoogleModel && !(options == null ? void 0 : options.model) && !(options == null ? void 0 : options.apiVersion)) {
|
|
860
|
+
console.warn(`You are using the GoogleGenerativeAIAdapter without explicitly setting a model or apiVersion. CopilotKit will default to apiVersion="v1" and model="${DEFAULT_MODEL2}". To silence this warning, pass model and apiVersion when constructing the adapter.`);
|
|
861
|
+
hasWarnedDefaultGoogleModel = true;
|
|
862
|
+
}
|
|
857
863
|
super({
|
|
858
864
|
chainFn: async ({ messages, tools, threadId }) => {
|
|
859
865
|
const { ChatGoogle } = __require("@langchain/google-gauth");
|
|
@@ -865,11 +871,11 @@ var GoogleGenerativeAIAdapter = class extends LangChainAdapter {
|
|
|
865
871
|
const aiMsg = message;
|
|
866
872
|
return aiMsg.content && String(aiMsg.content).trim().length > 0 || aiMsg.tool_calls && aiMsg.tool_calls.length > 0;
|
|
867
873
|
});
|
|
868
|
-
this.model = (options == null ? void 0 : options.model) ??
|
|
874
|
+
this.model = (options == null ? void 0 : options.model) ?? DEFAULT_MODEL2;
|
|
869
875
|
const model = new ChatGoogle({
|
|
870
876
|
apiKey: (options == null ? void 0 : options.apiKey) ?? process.env.GOOGLE_API_KEY,
|
|
871
877
|
modelName: this.model,
|
|
872
|
-
apiVersion:
|
|
878
|
+
apiVersion: (options == null ? void 0 : options.apiVersion) ?? DEFAULT_API_VERSION
|
|
873
879
|
}).bindTools(tools);
|
|
874
880
|
return model.stream(filteredMessages, {
|
|
875
881
|
metadata: {
|