@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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @copilotkit/runtime
2
2
 
3
+ ## 1.50.1-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated the default model and API version for the Google GenAI adapter
8
+ - Updated dependencies
9
+ - @copilotkit/shared@1.50.1-next.0
10
+
3
11
  ## 1.50.0
4
12
 
5
13
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -573,7 +573,7 @@ declare class LangChainAdapter implements CopilotServiceAdapter {
573
573
  *
574
574
  * const copilotKit = new CopilotRuntime();
575
575
  *
576
- * return new GoogleGenerativeAIAdapter({ model: "gemini-1.5-pro" });
576
+ * return new GoogleGenerativeAIAdapter({ model: "gemini-2.5-flash", apiVersion: "v1" });
577
577
  * ```
578
578
  */
579
579
 
@@ -582,6 +582,10 @@ interface GoogleGenerativeAIAdapterOptions {
582
582
  * A custom Google Generative AI model to use.
583
583
  */
584
584
  model?: string;
585
+ /**
586
+ * The API version to use (e.g. "v1" or "v1beta"). Defaults to "v1".
587
+ */
588
+ apiVersion?: "v1" | "v1beta";
585
589
  /**
586
590
  * The API key to use.
587
591
  */
package/dist/index.js CHANGED
@@ -72,7 +72,7 @@ var require_package = __commonJS({
72
72
  publishConfig: {
73
73
  access: "public"
74
74
  },
75
- version: "1.50.0",
75
+ version: "1.50.1-next.0",
76
76
  sideEffects: false,
77
77
  main: "./dist/index.js",
78
78
  module: "./dist/index.mjs",
@@ -856,11 +856,17 @@ var LangChainAdapter = class {
856
856
  __name(LangChainAdapter, "LangChainAdapter");
857
857
 
858
858
  // src/service-adapters/google/google-genai-adapter.ts
859
- var DEFAULT_MODEL2 = "gemini-1.5-pro";
859
+ var DEFAULT_MODEL2 = "gemini-2.5-flash";
860
+ var DEFAULT_API_VERSION = "v1";
861
+ var hasWarnedDefaultGoogleModel = false;
860
862
  var GoogleGenerativeAIAdapter = class extends LangChainAdapter {
861
863
  provider = "google";
862
864
  model = DEFAULT_MODEL2;
863
865
  constructor(options) {
866
+ if (!hasWarnedDefaultGoogleModel && !(options == null ? void 0 : options.model) && !(options == null ? void 0 : options.apiVersion)) {
867
+ 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.`);
868
+ hasWarnedDefaultGoogleModel = true;
869
+ }
864
870
  super({
865
871
  chainFn: async ({ messages, tools, threadId }) => {
866
872
  const { ChatGoogle } = __require("@langchain/google-gauth");
@@ -872,11 +878,11 @@ var GoogleGenerativeAIAdapter = class extends LangChainAdapter {
872
878
  const aiMsg = message;
873
879
  return aiMsg.content && String(aiMsg.content).trim().length > 0 || aiMsg.tool_calls && aiMsg.tool_calls.length > 0;
874
880
  });
875
- this.model = (options == null ? void 0 : options.model) ?? "gemini-1.5-pro";
881
+ this.model = (options == null ? void 0 : options.model) ?? DEFAULT_MODEL2;
876
882
  const model = new ChatGoogle({
877
883
  apiKey: (options == null ? void 0 : options.apiKey) ?? process.env.GOOGLE_API_KEY,
878
884
  modelName: this.model,
879
- apiVersion: "v1beta"
885
+ apiVersion: (options == null ? void 0 : options.apiVersion) ?? DEFAULT_API_VERSION
880
886
  }).bindTools(tools);
881
887
  return model.stream(filteredMessages, {
882
888
  metadata: {