@misterscan/sesi 1.1.2 → 1.2.1

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.
Files changed (79) hide show
  1. package/README.md +29 -8
  2. package/bin/sesi.js +35 -34
  3. package/dist/ai-runtime.d.ts +5 -0
  4. package/dist/ai-runtime.d.ts.map +1 -1
  5. package/dist/ai-runtime.js +157 -7
  6. package/dist/ai-runtime.js.map +1 -1
  7. package/dist/builtins.d.ts +1 -1
  8. package/dist/builtins.d.ts.map +1 -1
  9. package/dist/builtins.js +114 -1
  10. package/dist/builtins.js.map +1 -1
  11. package/dist/interpreter.d.ts +6 -1
  12. package/dist/interpreter.d.ts.map +1 -1
  13. package/dist/interpreter.js +210 -36
  14. package/dist/interpreter.js.map +1 -1
  15. package/dist/parser.d.ts.map +1 -1
  16. package/dist/parser.js +2 -0
  17. package/dist/parser.js.map +1 -1
  18. package/dist/sesi.bundled.js +1029 -489
  19. package/dist/types.d.ts +9 -1
  20. package/dist/types.d.ts.map +1 -1
  21. package/dist/types.js.map +1 -1
  22. package/docs/ARCHITECTURE.md +9 -9
  23. package/docs/BUILTINS.md +87 -8
  24. package/docs/DISTRIBUTED_SYSTEMS.md +1 -1
  25. package/docs/IMAGE_GENERATION.md +82 -1
  26. package/docs/IMPLEMENTATION_SUMMARY.md +544 -533
  27. package/docs/QUICKSTART.md +41 -1
  28. package/docs/README.md +20 -14
  29. package/docs/ROADMAP.md +10 -11
  30. package/docs/SPECIFICATION.md +37 -14
  31. package/docs/SYSTEMS_REASONING.md +35 -11
  32. package/docs/bakery_logo.png +0 -0
  33. package/docs/coffee_mug.png +0 -0
  34. package/docs/desk_lamp.png +0 -0
  35. package/docs/favicon.ico +0 -0
  36. package/docs/logo.png +0 -0
  37. package/docs/notebook.png +0 -0
  38. package/docs/sesi_ai_chronicles.md +209 -0
  39. package/examples/16_modules.sesi +28 -0
  40. package/examples/17_http_client.sesi +29 -0
  41. package/examples/18_parallel_requests.sesi +37 -0
  42. package/main/chatbot.sesi +36 -0
  43. package/main/conversational_classifier_weights.json +45 -0
  44. package/main/conversational_sentences.json +304 -0
  45. package/main/epochs.sesi +94 -0
  46. package/main/gpu_orchestrator.sesi +36 -0
  47. package/main/hardware_diagnostics.sesi +118 -0
  48. package/main/inference.sesi +54 -0
  49. package/main/native_chatbot.sesi +180 -0
  50. package/main/native_synthesizer.sesi +83 -0
  51. package/main/nn_personas_trainer.sesi +302 -0
  52. package/main/nn_responses_trainer.sesi +269 -0
  53. package/main/nn_sentences_trainer.sesi +330 -0
  54. package/main/personas.json +124 -0
  55. package/main/personas_classifier_weights.json +45 -0
  56. package/main/playground.sesi +3 -1
  57. package/main/predictive_typing.sesi +127 -0
  58. package/main/query_brain.sesi +45 -0
  59. package/main/response_classifier_weights.json +45 -0
  60. package/main/retro_chat.html +239 -0
  61. package/main/retro_chat_generator.sesi +745 -0
  62. package/main/sesi_ai.sesi +158 -0
  63. package/main/sesi_db_chatbot.sesi +252 -0
  64. package/main/terminal.log +56 -0
  65. package/main/terminal_chat.py +385 -0
  66. package/main/tests/temp_math_mod.sesi +3 -0
  67. package/main/tests/test_image_input.sesi +40 -0
  68. package/main/tests/test_v2_features.sesi +48 -0
  69. package/main/unified_sesi_ai.sesi +334 -0
  70. package/main/varied_responses.json +304 -0
  71. package/package.json +27 -15
  72. package/main/atm_deposit.sesi +0 -37
  73. package/main/atm_withdraw.sesi +0 -37
  74. package/main/data.txt +0 -1
  75. package/main/math_aggregator.sesi +0 -15
  76. package/main/math_generator.sesi +0 -7
  77. package/main/math_processor.sesi +0 -23
  78. package/main/tax_calculator.sesi +0 -15
  79. package/main/vault.sesi +0 -15
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  "use strict";
2
3
  var __create = Object.create;
3
4
  var __defProp = Object.defineProperty;
@@ -12552,6 +12553,7 @@ var require_parser = __commonJS({
12552
12553
  modelName,
12553
12554
  config,
12554
12555
  prompt,
12556
+ images: config?.images,
12555
12557
  line
12556
12558
  };
12557
12559
  }
@@ -12633,6 +12635,7 @@ var require_parser = __commonJS({
12633
12635
  modelName,
12634
12636
  config,
12635
12637
  prompt,
12638
+ images: config?.images,
12636
12639
  line
12637
12640
  };
12638
12641
  }
@@ -12910,7 +12913,7 @@ var require_builtins = __commonJS({
12910
12913
  var fs3 = __importStar(require("fs"));
12911
12914
  var path2 = __importStar(require("path"));
12912
12915
  var child_process_1 = require("child_process");
12913
- function getBuiltins() {
12916
+ function getBuiltins(interpreter) {
12914
12917
  const builtins = /* @__PURE__ */ new Map();
12915
12918
  builtins.set("print", {
12916
12919
  type: "function",
@@ -12990,6 +12993,36 @@ var require_builtins = __commonJS({
12990
12993
  }
12991
12994
  }
12992
12995
  });
12996
+ builtins.set("from_json", {
12997
+ type: "function",
12998
+ name: "from_json",
12999
+ params: [{ name: "string" }],
13000
+ body: {},
13001
+ closure: {},
13002
+ isBuiltin: true,
13003
+ builtin: (str) => {
13004
+ if (typeof str !== "string")
13005
+ return null;
13006
+ try {
13007
+ return JSON.parse(str);
13008
+ } catch (e2) {
13009
+ return null;
13010
+ }
13011
+ }
13012
+ });
13013
+ builtins.set("exp", {
13014
+ type: "function",
13015
+ name: "exp",
13016
+ params: [{ name: "x" }],
13017
+ body: {},
13018
+ closure: {},
13019
+ isBuiltin: true,
13020
+ builtin: (x2) => {
13021
+ if (typeof x2 !== "number")
13022
+ return null;
13023
+ return Math.exp(x2);
13024
+ }
13025
+ });
12993
13026
  builtins.set("num", {
12994
13027
  type: "function",
12995
13028
  name: "num",
@@ -13121,14 +13154,14 @@ var require_builtins = __commonJS({
13121
13154
  body: {},
13122
13155
  closure: {},
13123
13156
  isBuiltin: true,
13124
- builtin: (filePath2) => {
13125
- if (typeof filePath2 !== "string")
13157
+ builtin: (filePath) => {
13158
+ if (typeof filePath !== "string")
13126
13159
  return null;
13127
13160
  try {
13128
- const absolutePath = path2.resolve(process.cwd(), filePath2);
13161
+ const absolutePath = path2.resolve(process.cwd(), filePath);
13129
13162
  return fs3.readFileSync(absolutePath, "utf-8");
13130
13163
  } catch (e2) {
13131
- throw new Error(`Failed to read file: ${filePath2}`);
13164
+ throw new Error(`Failed to read file: ${filePath}`);
13132
13165
  }
13133
13166
  }
13134
13167
  });
@@ -13139,15 +13172,15 @@ var require_builtins = __commonJS({
13139
13172
  body: {},
13140
13173
  closure: {},
13141
13174
  isBuiltin: true,
13142
- builtin: (filePath2, content) => {
13143
- if (typeof filePath2 !== "string" || typeof content !== "string")
13175
+ builtin: (filePath, content) => {
13176
+ if (typeof filePath !== "string" || typeof content !== "string")
13144
13177
  return null;
13145
13178
  try {
13146
- const absolutePath = path2.resolve(process.cwd(), filePath2);
13179
+ const absolutePath = path2.resolve(process.cwd(), filePath);
13147
13180
  fs3.writeFileSync(absolutePath, content, "utf-8");
13148
13181
  return true;
13149
13182
  } catch (e2) {
13150
- throw new Error(`Failed to write file: ${filePath2}`);
13183
+ throw new Error(`Failed to write file: ${filePath}`);
13151
13184
  }
13152
13185
  }
13153
13186
  });
@@ -13158,16 +13191,16 @@ var require_builtins = __commonJS({
13158
13191
  body: {},
13159
13192
  closure: {},
13160
13193
  isBuiltin: true,
13161
- builtin: (filePath2, content) => {
13162
- if (typeof filePath2 !== "string" || typeof content !== "string")
13194
+ builtin: (filePath, content) => {
13195
+ if (typeof filePath !== "string" || typeof content !== "string")
13163
13196
  return null;
13164
13197
  try {
13165
- const absolutePath = path2.resolve(process.cwd(), filePath2);
13198
+ const absolutePath = path2.resolve(process.cwd(), filePath);
13166
13199
  const buffer = Buffer.from(content, "base64");
13167
13200
  fs3.writeFileSync(absolutePath, buffer);
13168
13201
  return true;
13169
13202
  } catch (e2) {
13170
- throw new Error(`Failed to write image: ${filePath2}`);
13203
+ throw new Error(`Failed to write image: ${filePath}`);
13171
13204
  }
13172
13205
  }
13173
13206
  });
@@ -13220,11 +13253,11 @@ var require_builtins = __commonJS({
13220
13253
  body: {},
13221
13254
  closure: {},
13222
13255
  isBuiltin: true,
13223
- builtin: (filePath2) => {
13224
- if (typeof filePath2 !== "string")
13256
+ builtin: (filePath) => {
13257
+ if (typeof filePath !== "string")
13225
13258
  return null;
13226
13259
  try {
13227
- const absolutePath = path2.resolve(process.cwd(), filePath2);
13260
+ const absolutePath = path2.resolve(process.cwd(), filePath);
13228
13261
  const sesiBin = path2.resolve(__dirname, "../bin/sesi.js");
13229
13262
  const child = (0, child_process_1.spawn)("node", [sesiBin, absolutePath], {
13230
13263
  detached: true,
@@ -13234,7 +13267,7 @@ var require_builtins = __commonJS({
13234
13267
  child.unref();
13235
13268
  return child.pid || true;
13236
13269
  } catch (e2) {
13237
- throw new Error(`Failed to spawn process: ${filePath2}`);
13270
+ throw new Error(`Failed to spawn process: ${filePath}`);
13238
13271
  }
13239
13272
  }
13240
13273
  });
@@ -13273,6 +13306,86 @@ var require_builtins = __commonJS({
13273
13306
  isBuiltin: true,
13274
13307
  builtin: () => Math.random()
13275
13308
  });
13309
+ builtins.set("web_get", {
13310
+ type: "function",
13311
+ name: "web_get",
13312
+ params: [{ name: "url" }, { name: "headers", defaultValue: {} }],
13313
+ body: {},
13314
+ closure: {},
13315
+ isBuiltin: true,
13316
+ builtin: async (...args2) => {
13317
+ const [urlVal, headersVal] = args2;
13318
+ const url = typeof urlVal === "string" ? urlVal : "";
13319
+ const headersObj = {};
13320
+ if (headersVal && typeof headersVal === "object" && !Array.isArray(headersVal)) {
13321
+ for (const [k, v] of Object.entries(headersVal)) {
13322
+ headersObj[k] = String(v);
13323
+ }
13324
+ }
13325
+ try {
13326
+ const response = await fetch(url, {
13327
+ method: "GET",
13328
+ headers: headersObj
13329
+ });
13330
+ return await response.text();
13331
+ } catch (e2) {
13332
+ throw new Error(`web_get failed: ${e2.message}`);
13333
+ }
13334
+ }
13335
+ });
13336
+ builtins.set("web_send", {
13337
+ type: "function",
13338
+ name: "web_send",
13339
+ params: [{ name: "url" }, { name: "body" }, { name: "headers", defaultValue: {} }],
13340
+ body: {},
13341
+ closure: {},
13342
+ isBuiltin: true,
13343
+ builtin: async (...args2) => {
13344
+ const [urlVal, bodyVal, headersVal] = args2;
13345
+ const url = typeof urlVal === "string" ? urlVal : "";
13346
+ const body = typeof bodyVal === "string" ? bodyVal : JSON.stringify(bodyVal);
13347
+ const headersObj = { "Content-Type": "application/json" };
13348
+ if (headersVal && typeof headersVal === "object" && !Array.isArray(headersVal)) {
13349
+ for (const [k, v] of Object.entries(headersVal)) {
13350
+ headersObj[k] = String(v);
13351
+ }
13352
+ }
13353
+ try {
13354
+ const response = await fetch(url, {
13355
+ method: "POST",
13356
+ headers: headersObj,
13357
+ body
13358
+ });
13359
+ return await response.text();
13360
+ } catch (e2) {
13361
+ throw new Error(`web_send failed: ${e2.message}`);
13362
+ }
13363
+ }
13364
+ });
13365
+ builtins.set("multi_req", {
13366
+ type: "function",
13367
+ name: "multi_req",
13368
+ params: [{ name: "fns" }],
13369
+ body: {},
13370
+ closure: {},
13371
+ isBuiltin: true,
13372
+ builtin: async (...args2) => {
13373
+ const [fnsVal] = args2;
13374
+ if (!Array.isArray(fnsVal)) {
13375
+ throw new Error("multi_req expects an array of functions");
13376
+ }
13377
+ if (!interpreter) {
13378
+ throw new Error("multi_req interpreter reference is missing");
13379
+ }
13380
+ const promises = fnsVal.map(async (fn) => {
13381
+ if (typeof fn !== "object" || fn === null || fn.type !== "function") {
13382
+ throw new Error("multi_req elements must be functions");
13383
+ }
13384
+ return await interpreter.callSesiFunction(fn, []);
13385
+ });
13386
+ return await Promise.all(promises);
13387
+ }
13388
+ });
13276
13389
  return builtins;
13277
13390
  }
13278
13391
  function isTruthy(value) {
@@ -25413,9 +25526,9 @@ var require_util2 = __commonJS({
25413
25526
  });
25414
25527
  return object;
25415
25528
  }
25416
- async function isValidFile(filePath2) {
25529
+ async function isValidFile(filePath) {
25417
25530
  try {
25418
- const stats = await fs3.promises.lstat(filePath2);
25531
+ const stats = await fs3.promises.lstat(filePath);
25419
25532
  return stats.isFile();
25420
25533
  } catch (e2) {
25421
25534
  return false;
@@ -30105,16 +30218,16 @@ var require_pluggable_auth_handler = __commonJS({
30105
30218
  if (!this.outputFile || this.outputFile.length === 0) {
30106
30219
  return void 0;
30107
30220
  }
30108
- let filePath2;
30221
+ let filePath;
30109
30222
  try {
30110
- filePath2 = await fs3.promises.realpath(this.outputFile);
30223
+ filePath = await fs3.promises.realpath(this.outputFile);
30111
30224
  } catch {
30112
30225
  return void 0;
30113
30226
  }
30114
- if (!(await fs3.promises.lstat(filePath2)).isFile()) {
30227
+ if (!(await fs3.promises.lstat(filePath)).isFile()) {
30115
30228
  return void 0;
30116
30229
  }
30117
- const responseString = await fs3.promises.readFile(filePath2, {
30230
+ const responseString = await fs3.promises.readFile(filePath, {
30118
30231
  encoding: "utf8"
30119
30232
  });
30120
30233
  if (responseString === "") {
@@ -30836,22 +30949,22 @@ var require_googleauth = __commonJS({
30836
30949
  * @returns Promise that resolves with the OAuth2Client
30837
30950
  * @api private
30838
30951
  */
30839
- async _getApplicationCredentialsFromFilePath(filePath2, options = {}) {
30840
- if (!filePath2 || filePath2.length === 0) {
30952
+ async _getApplicationCredentialsFromFilePath(filePath, options = {}) {
30953
+ if (!filePath || filePath.length === 0) {
30841
30954
  throw new Error("The file path is invalid.");
30842
30955
  }
30843
30956
  try {
30844
- filePath2 = fs3.realpathSync(filePath2);
30845
- if (!fs3.lstatSync(filePath2).isFile()) {
30957
+ filePath = fs3.realpathSync(filePath);
30958
+ if (!fs3.lstatSync(filePath).isFile()) {
30846
30959
  throw new Error();
30847
30960
  }
30848
30961
  } catch (err) {
30849
30962
  if (err instanceof Error) {
30850
- err.message = `The file at ${filePath2} does not exist, or it is not a file. ${err.message}`;
30963
+ err.message = `The file at ${filePath} does not exist, or it is not a file. ${err.message}`;
30851
30964
  }
30852
30965
  throw err;
30853
30966
  }
30854
- const readStream = fs3.createReadStream(filePath2);
30967
+ const readStream = fs3.createReadStream(filePath);
30855
30968
  return this.fromStream(readStream, options);
30856
30969
  }
30857
30970
  /**
@@ -31163,8 +31276,8 @@ var require_googleauth = __commonJS({
31163
31276
  if (this.jsonContent) {
31164
31277
  return this._cacheClientFromJSON(this.jsonContent, this.clientOptions);
31165
31278
  } else if (this.keyFilename) {
31166
- const filePath2 = path2.resolve(this.keyFilename);
31167
- const stream = fs3.createReadStream(filePath2);
31279
+ const filePath = path2.resolve(this.keyFilename);
31280
+ const stream = fs3.createReadStream(filePath);
31168
31281
  return await this.fromStreamAsync(stream, this.clientOptions);
31169
31282
  } else if (this.apiKey) {
31170
31283
  const client = await this.fromAPIKey(this.apiKey, this.clientOptions);
@@ -37615,22 +37728,22 @@ var require_node4 = __commonJS({
37615
37728
  setValueByPath(toObject, ["apiKey"], fromApiKey);
37616
37729
  }
37617
37730
  if (getValueByPath(fromObject, ["apiKeyConfig"]) !== void 0) {
37618
- throw new Error("apiKeyConfig parameter is not supported in Gemini API.");
37731
+ throw new Error("apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
37619
37732
  }
37620
37733
  if (getValueByPath(fromObject, ["authType"]) !== void 0) {
37621
- throw new Error("authType parameter is not supported in Gemini API.");
37734
+ throw new Error("authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
37622
37735
  }
37623
37736
  if (getValueByPath(fromObject, ["googleServiceAccountConfig"]) !== void 0) {
37624
- throw new Error("googleServiceAccountConfig parameter is not supported in Gemini API.");
37737
+ throw new Error("googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
37625
37738
  }
37626
37739
  if (getValueByPath(fromObject, ["httpBasicAuthConfig"]) !== void 0) {
37627
- throw new Error("httpBasicAuthConfig parameter is not supported in Gemini API.");
37740
+ throw new Error("httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
37628
37741
  }
37629
37742
  if (getValueByPath(fromObject, ["oauthConfig"]) !== void 0) {
37630
- throw new Error("oauthConfig parameter is not supported in Gemini API.");
37743
+ throw new Error("oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
37631
37744
  }
37632
37745
  if (getValueByPath(fromObject, ["oidcConfig"]) !== void 0) {
37633
- throw new Error("oidcConfig parameter is not supported in Gemini API.");
37746
+ throw new Error("oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
37634
37747
  }
37635
37748
  return toObject;
37636
37749
  }
@@ -37711,13 +37824,13 @@ var require_node4 = __commonJS({
37711
37824
  setValueByPath(toObject, ["bigqueryDestination", "outputUri"], fromBigqueryUri);
37712
37825
  }
37713
37826
  if (getValueByPath(fromObject, ["fileName"]) !== void 0) {
37714
- throw new Error("fileName parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
37827
+ throw new Error("fileName parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
37715
37828
  }
37716
37829
  if (getValueByPath(fromObject, ["inlinedResponses"]) !== void 0) {
37717
- throw new Error("inlinedResponses parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
37830
+ throw new Error("inlinedResponses parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
37718
37831
  }
37719
37832
  if (getValueByPath(fromObject, ["inlinedEmbedContentResponses"]) !== void 0) {
37720
- throw new Error("inlinedEmbedContentResponses parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
37833
+ throw new Error("inlinedEmbedContentResponses parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
37721
37834
  }
37722
37835
  const fromVertexDataset = getValueByPath(fromObject, [
37723
37836
  "vertexDataset"
@@ -37862,13 +37975,13 @@ var require_node4 = __commonJS({
37862
37975
  function batchJobSourceToMldev(apiClient, fromObject) {
37863
37976
  const toObject = {};
37864
37977
  if (getValueByPath(fromObject, ["format"]) !== void 0) {
37865
- throw new Error("format parameter is not supported in Gemini API.");
37978
+ throw new Error("format parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
37866
37979
  }
37867
37980
  if (getValueByPath(fromObject, ["gcsUri"]) !== void 0) {
37868
- throw new Error("gcsUri parameter is not supported in Gemini API.");
37981
+ throw new Error("gcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
37869
37982
  }
37870
37983
  if (getValueByPath(fromObject, ["bigqueryUri"]) !== void 0) {
37871
- throw new Error("bigqueryUri parameter is not supported in Gemini API.");
37984
+ throw new Error("bigqueryUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
37872
37985
  }
37873
37986
  const fromFileName = getValueByPath(fromObject, ["fileName"]);
37874
37987
  if (fromFileName != null) {
@@ -37887,7 +38000,7 @@ var require_node4 = __commonJS({
37887
38000
  setValueByPath(toObject, ["requests", "requests"], transformedList);
37888
38001
  }
37889
38002
  if (getValueByPath(fromObject, ["vertexDatasetName"]) !== void 0) {
37890
- throw new Error("vertexDatasetName parameter is not supported in Gemini API.");
38003
+ throw new Error("vertexDatasetName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
37891
38004
  }
37892
38005
  return toObject;
37893
38006
  }
@@ -37906,10 +38019,10 @@ var require_node4 = __commonJS({
37906
38019
  setValueByPath(toObject, ["bigquerySource", "inputUri"], fromBigqueryUri);
37907
38020
  }
37908
38021
  if (getValueByPath(fromObject, ["fileName"]) !== void 0) {
37909
- throw new Error("fileName parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
38022
+ throw new Error("fileName parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
37910
38023
  }
37911
38024
  if (getValueByPath(fromObject, ["inlinedRequests"]) !== void 0) {
37912
- throw new Error("inlinedRequests parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
38025
+ throw new Error("inlinedRequests parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
37913
38026
  }
37914
38027
  const fromVertexDatasetName = getValueByPath(fromObject, [
37915
38028
  "vertexDatasetName"
@@ -37926,7 +38039,7 @@ var require_node4 = __commonJS({
37926
38039
  setValueByPath(toObject, ["data"], fromData);
37927
38040
  }
37928
38041
  if (getValueByPath(fromObject, ["displayName"]) !== void 0) {
37929
- throw new Error("displayName parameter is not supported in Gemini API.");
38042
+ throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
37930
38043
  }
37931
38044
  const fromMimeType = getValueByPath(fromObject, ["mimeType"]);
37932
38045
  if (fromMimeType != null) {
@@ -38049,7 +38162,7 @@ var require_node4 = __commonJS({
38049
38162
  setValueByPath(parentObject, ["batch", "displayName"], fromDisplayName);
38050
38163
  }
38051
38164
  if (getValueByPath(fromObject, ["dest"]) !== void 0) {
38052
- throw new Error("dest parameter is not supported in Gemini API.");
38165
+ throw new Error("dest parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
38053
38166
  }
38054
38167
  const fromWebhookConfig = getValueByPath(fromObject, [
38055
38168
  "webhookConfig"
@@ -38070,7 +38183,7 @@ var require_node4 = __commonJS({
38070
38183
  setValueByPath(parentObject, ["outputConfig"], batchJobDestinationToVertex(tBatchJobDestination(fromDest)));
38071
38184
  }
38072
38185
  if (getValueByPath(fromObject, ["webhookConfig"]) !== void 0) {
38073
- throw new Error("webhookConfig parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
38186
+ throw new Error("webhookConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
38074
38187
  }
38075
38188
  return toObject;
38076
38189
  }
@@ -38226,16 +38339,16 @@ var require_node4 = __commonJS({
38226
38339
  setValueByPath(parentObject, ["requests[]", "outputDimensionality"], fromOutputDimensionality);
38227
38340
  }
38228
38341
  if (getValueByPath(fromObject, ["mimeType"]) !== void 0) {
38229
- throw new Error("mimeType parameter is not supported in Gemini API.");
38342
+ throw new Error("mimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
38230
38343
  }
38231
38344
  if (getValueByPath(fromObject, ["autoTruncate"]) !== void 0) {
38232
- throw new Error("autoTruncate parameter is not supported in Gemini API.");
38345
+ throw new Error("autoTruncate parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
38233
38346
  }
38234
38347
  if (getValueByPath(fromObject, ["documentOcr"]) !== void 0) {
38235
- throw new Error("documentOcr parameter is not supported in Gemini API.");
38348
+ throw new Error("documentOcr parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
38236
38349
  }
38237
38350
  if (getValueByPath(fromObject, ["audioTrackExtraction"]) !== void 0) {
38238
- throw new Error("audioTrackExtraction parameter is not supported in Gemini API.");
38351
+ throw new Error("audioTrackExtraction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
38239
38352
  }
38240
38353
  return toObject;
38241
38354
  }
@@ -38256,7 +38369,7 @@ var require_node4 = __commonJS({
38256
38369
  function fileDataToMldev$4(fromObject) {
38257
38370
  const toObject = {};
38258
38371
  if (getValueByPath(fromObject, ["displayName"]) !== void 0) {
38259
- throw new Error("displayName parameter is not supported in Gemini API.");
38372
+ throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
38260
38373
  }
38261
38374
  const fromFileUri = getValueByPath(fromObject, ["fileUri"]);
38262
38375
  if (fromFileUri != null) {
@@ -38283,10 +38396,10 @@ var require_node4 = __commonJS({
38283
38396
  setValueByPath(toObject, ["name"], fromName);
38284
38397
  }
38285
38398
  if (getValueByPath(fromObject, ["partialArgs"]) !== void 0) {
38286
- throw new Error("partialArgs parameter is not supported in Gemini API.");
38399
+ throw new Error("partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
38287
38400
  }
38288
38401
  if (getValueByPath(fromObject, ["willContinue"]) !== void 0) {
38289
- throw new Error("willContinue parameter is not supported in Gemini API.");
38402
+ throw new Error("willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
38290
38403
  }
38291
38404
  return toObject;
38292
38405
  }
@@ -38303,7 +38416,7 @@ var require_node4 = __commonJS({
38303
38416
  setValueByPath(toObject, ["mode"], fromMode);
38304
38417
  }
38305
38418
  if (getValueByPath(fromObject, ["streamFunctionCallArguments"]) !== void 0) {
38306
- throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");
38419
+ throw new Error("streamFunctionCallArguments parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
38307
38420
  }
38308
38421
  return toObject;
38309
38422
  }
@@ -38390,10 +38503,10 @@ var require_node4 = __commonJS({
38390
38503
  setValueByPath(toObject, ["responseJsonSchema"], fromResponseJsonSchema);
38391
38504
  }
38392
38505
  if (getValueByPath(fromObject, ["routingConfig"]) !== void 0) {
38393
- throw new Error("routingConfig parameter is not supported in Gemini API.");
38506
+ throw new Error("routingConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
38394
38507
  }
38395
38508
  if (getValueByPath(fromObject, ["modelSelectionConfig"]) !== void 0) {
38396
- throw new Error("modelSelectionConfig parameter is not supported in Gemini API.");
38509
+ throw new Error("modelSelectionConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
38397
38510
  }
38398
38511
  const fromSafetySettings = getValueByPath(fromObject, [
38399
38512
  "safetySettings"
@@ -38422,7 +38535,7 @@ var require_node4 = __commonJS({
38422
38535
  setValueByPath(parentObject, ["toolConfig"], toolConfigToMldev$2(fromToolConfig));
38423
38536
  }
38424
38537
  if (getValueByPath(fromObject, ["labels"]) !== void 0) {
38425
- throw new Error("labels parameter is not supported in Gemini API.");
38538
+ throw new Error("labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
38426
38539
  }
38427
38540
  const fromCachedContent = getValueByPath(fromObject, [
38428
38541
  "cachedContent"
@@ -38447,7 +38560,7 @@ var require_node4 = __commonJS({
38447
38560
  setValueByPath(toObject, ["speechConfig"], tSpeechConfig(fromSpeechConfig));
38448
38561
  }
38449
38562
  if (getValueByPath(fromObject, ["audioTimestamp"]) !== void 0) {
38450
- throw new Error("audioTimestamp parameter is not supported in Gemini API.");
38563
+ throw new Error("audioTimestamp parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
38451
38564
  }
38452
38565
  const fromThinkingConfig = getValueByPath(fromObject, [
38453
38566
  "thinkingConfig"
@@ -38466,7 +38579,7 @@ var require_node4 = __commonJS({
38466
38579
  setValueByPath(toObject, ["enableEnhancedCivicAnswers"], fromEnableEnhancedCivicAnswers);
38467
38580
  }
38468
38581
  if (getValueByPath(fromObject, ["modelArmorConfig"]) !== void 0) {
38469
- throw new Error("modelArmorConfig parameter is not supported in Gemini API.");
38582
+ throw new Error("modelArmorConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
38470
38583
  }
38471
38584
  const fromServiceTier = getValueByPath(fromObject, ["serviceTier"]);
38472
38585
  if (parentObject !== void 0 && fromServiceTier != null) {
@@ -38553,10 +38666,10 @@ var require_node4 = __commonJS({
38553
38666
  setValueByPath(toObject, ["searchTypes"], fromSearchTypes);
38554
38667
  }
38555
38668
  if (getValueByPath(fromObject, ["blockingConfidence"]) !== void 0) {
38556
- throw new Error("blockingConfidence parameter is not supported in Gemini API.");
38669
+ throw new Error("blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
38557
38670
  }
38558
38671
  if (getValueByPath(fromObject, ["excludeDomains"]) !== void 0) {
38559
- throw new Error("excludeDomains parameter is not supported in Gemini API.");
38672
+ throw new Error("excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
38560
38673
  }
38561
38674
  const fromTimeRangeFilter = getValueByPath(fromObject, [
38562
38675
  "timeRangeFilter"
@@ -38577,19 +38690,19 @@ var require_node4 = __commonJS({
38577
38690
  setValueByPath(toObject, ["imageSize"], fromImageSize);
38578
38691
  }
38579
38692
  if (getValueByPath(fromObject, ["personGeneration"]) !== void 0) {
38580
- throw new Error("personGeneration parameter is not supported in Gemini API.");
38693
+ throw new Error("personGeneration parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
38581
38694
  }
38582
38695
  if (getValueByPath(fromObject, ["prominentPeople"]) !== void 0) {
38583
- throw new Error("prominentPeople parameter is not supported in Gemini API.");
38696
+ throw new Error("prominentPeople parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
38584
38697
  }
38585
38698
  if (getValueByPath(fromObject, ["outputMimeType"]) !== void 0) {
38586
- throw new Error("outputMimeType parameter is not supported in Gemini API.");
38699
+ throw new Error("outputMimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
38587
38700
  }
38588
38701
  if (getValueByPath(fromObject, ["outputCompressionQuality"]) !== void 0) {
38589
- throw new Error("outputCompressionQuality parameter is not supported in Gemini API.");
38702
+ throw new Error("outputCompressionQuality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
38590
38703
  }
38591
38704
  if (getValueByPath(fromObject, ["imageOutputOptions"]) !== void 0) {
38592
- throw new Error("imageOutputOptions parameter is not supported in Gemini API.");
38705
+ throw new Error("imageOutputOptions parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
38593
38706
  }
38594
38707
  return toObject;
38595
38708
  }
@@ -38646,7 +38759,7 @@ var require_node4 = __commonJS({
38646
38759
  setValueByPath(parentObject, ["_query", "pageToken"], fromPageToken);
38647
38760
  }
38648
38761
  if (getValueByPath(fromObject, ["filter"]) !== void 0) {
38649
- throw new Error("filter parameter is not supported in Gemini API.");
38762
+ throw new Error("filter parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
38650
38763
  }
38651
38764
  return toObject;
38652
38765
  }
@@ -38815,7 +38928,7 @@ var require_node4 = __commonJS({
38815
38928
  setValueByPath(toObject, ["category"], fromCategory);
38816
38929
  }
38817
38930
  if (getValueByPath(fromObject, ["method"]) !== void 0) {
38818
- throw new Error("method parameter is not supported in Gemini API.");
38931
+ throw new Error("method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
38819
38932
  }
38820
38933
  const fromThreshold = getValueByPath(fromObject, ["threshold"]);
38821
38934
  if (fromThreshold != null) {
@@ -38846,7 +38959,7 @@ var require_node4 = __commonJS({
38846
38959
  function toolToMldev$4(fromObject) {
38847
38960
  const toObject = {};
38848
38961
  if (getValueByPath(fromObject, ["retrieval"]) !== void 0) {
38849
- throw new Error("retrieval parameter is not supported in Gemini API.");
38962
+ throw new Error("retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
38850
38963
  }
38851
38964
  const fromComputerUse = getValueByPath(fromObject, ["computerUse"]);
38852
38965
  if (fromComputerUse != null) {
@@ -38871,7 +38984,7 @@ var require_node4 = __commonJS({
38871
38984
  setValueByPath(toObject, ["codeExecution"], fromCodeExecution);
38872
38985
  }
38873
38986
  if (getValueByPath(fromObject, ["enterpriseWebSearch"]) !== void 0) {
38874
- throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");
38987
+ throw new Error("enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
38875
38988
  }
38876
38989
  const fromFunctionDeclarations = getValueByPath(fromObject, [
38877
38990
  "functionDeclarations"
@@ -38892,7 +39005,7 @@ var require_node4 = __commonJS({
38892
39005
  setValueByPath(toObject, ["googleSearchRetrieval"], fromGoogleSearchRetrieval);
38893
39006
  }
38894
39007
  if (getValueByPath(fromObject, ["parallelAiSearch"]) !== void 0) {
38895
- throw new Error("parallelAiSearch parameter is not supported in Gemini API.");
39008
+ throw new Error("parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
38896
39009
  }
38897
39010
  const fromUrlContext = getValueByPath(fromObject, ["urlContext"]);
38898
39011
  if (fromUrlContext != null) {
@@ -39539,22 +39652,22 @@ var require_node4 = __commonJS({
39539
39652
  setValueByPath(toObject, ["apiKey"], fromApiKey);
39540
39653
  }
39541
39654
  if (getValueByPath(fromObject, ["apiKeyConfig"]) !== void 0) {
39542
- throw new Error("apiKeyConfig parameter is not supported in Gemini API.");
39655
+ throw new Error("apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
39543
39656
  }
39544
39657
  if (getValueByPath(fromObject, ["authType"]) !== void 0) {
39545
- throw new Error("authType parameter is not supported in Gemini API.");
39658
+ throw new Error("authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
39546
39659
  }
39547
39660
  if (getValueByPath(fromObject, ["googleServiceAccountConfig"]) !== void 0) {
39548
- throw new Error("googleServiceAccountConfig parameter is not supported in Gemini API.");
39661
+ throw new Error("googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
39549
39662
  }
39550
39663
  if (getValueByPath(fromObject, ["httpBasicAuthConfig"]) !== void 0) {
39551
- throw new Error("httpBasicAuthConfig parameter is not supported in Gemini API.");
39664
+ throw new Error("httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
39552
39665
  }
39553
39666
  if (getValueByPath(fromObject, ["oauthConfig"]) !== void 0) {
39554
- throw new Error("oauthConfig parameter is not supported in Gemini API.");
39667
+ throw new Error("oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
39555
39668
  }
39556
39669
  if (getValueByPath(fromObject, ["oidcConfig"]) !== void 0) {
39557
- throw new Error("oidcConfig parameter is not supported in Gemini API.");
39670
+ throw new Error("oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
39558
39671
  }
39559
39672
  return toObject;
39560
39673
  }
@@ -39565,7 +39678,7 @@ var require_node4 = __commonJS({
39565
39678
  setValueByPath(toObject, ["data"], fromData);
39566
39679
  }
39567
39680
  if (getValueByPath(fromObject, ["displayName"]) !== void 0) {
39568
- throw new Error("displayName parameter is not supported in Gemini API.");
39681
+ throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
39569
39682
  }
39570
39683
  const fromMimeType = getValueByPath(fromObject, ["mimeType"]);
39571
39684
  if (fromMimeType != null) {
@@ -39654,7 +39767,7 @@ var require_node4 = __commonJS({
39654
39767
  setValueByPath(parentObject, ["toolConfig"], toolConfigToMldev$1(fromToolConfig));
39655
39768
  }
39656
39769
  if (getValueByPath(fromObject, ["kmsKeyName"]) !== void 0) {
39657
- throw new Error("kmsKeyName parameter is not supported in Gemini API.");
39770
+ throw new Error("kmsKeyName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
39658
39771
  }
39659
39772
  return toObject;
39660
39773
  }
@@ -39771,7 +39884,7 @@ var require_node4 = __commonJS({
39771
39884
  function fileDataToMldev$3(fromObject) {
39772
39885
  const toObject = {};
39773
39886
  if (getValueByPath(fromObject, ["displayName"]) !== void 0) {
39774
- throw new Error("displayName parameter is not supported in Gemini API.");
39887
+ throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
39775
39888
  }
39776
39889
  const fromFileUri = getValueByPath(fromObject, ["fileUri"]);
39777
39890
  if (fromFileUri != null) {
@@ -39798,10 +39911,10 @@ var require_node4 = __commonJS({
39798
39911
  setValueByPath(toObject, ["name"], fromName);
39799
39912
  }
39800
39913
  if (getValueByPath(fromObject, ["partialArgs"]) !== void 0) {
39801
- throw new Error("partialArgs parameter is not supported in Gemini API.");
39914
+ throw new Error("partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
39802
39915
  }
39803
39916
  if (getValueByPath(fromObject, ["willContinue"]) !== void 0) {
39804
- throw new Error("willContinue parameter is not supported in Gemini API.");
39917
+ throw new Error("willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
39805
39918
  }
39806
39919
  return toObject;
39807
39920
  }
@@ -39818,42 +39931,7 @@ var require_node4 = __commonJS({
39818
39931
  setValueByPath(toObject, ["mode"], fromMode);
39819
39932
  }
39820
39933
  if (getValueByPath(fromObject, ["streamFunctionCallArguments"]) !== void 0) {
39821
- throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");
39822
- }
39823
- return toObject;
39824
- }
39825
- function functionDeclarationToVertex$2(fromObject) {
39826
- const toObject = {};
39827
- const fromDescription = getValueByPath(fromObject, ["description"]);
39828
- if (fromDescription != null) {
39829
- setValueByPath(toObject, ["description"], fromDescription);
39830
- }
39831
- const fromName = getValueByPath(fromObject, ["name"]);
39832
- if (fromName != null) {
39833
- setValueByPath(toObject, ["name"], fromName);
39834
- }
39835
- const fromParameters = getValueByPath(fromObject, ["parameters"]);
39836
- if (fromParameters != null) {
39837
- setValueByPath(toObject, ["parameters"], fromParameters);
39838
- }
39839
- const fromParametersJsonSchema = getValueByPath(fromObject, [
39840
- "parametersJsonSchema"
39841
- ]);
39842
- if (fromParametersJsonSchema != null) {
39843
- setValueByPath(toObject, ["parametersJsonSchema"], fromParametersJsonSchema);
39844
- }
39845
- const fromResponse = getValueByPath(fromObject, ["response"]);
39846
- if (fromResponse != null) {
39847
- setValueByPath(toObject, ["response"], fromResponse);
39848
- }
39849
- const fromResponseJsonSchema = getValueByPath(fromObject, [
39850
- "responseJsonSchema"
39851
- ]);
39852
- if (fromResponseJsonSchema != null) {
39853
- setValueByPath(toObject, ["responseJsonSchema"], fromResponseJsonSchema);
39854
- }
39855
- if (getValueByPath(fromObject, ["behavior"]) !== void 0) {
39856
- throw new Error("behavior parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
39934
+ throw new Error("streamFunctionCallArguments parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
39857
39935
  }
39858
39936
  return toObject;
39859
39937
  }
@@ -39892,10 +39970,10 @@ var require_node4 = __commonJS({
39892
39970
  setValueByPath(toObject, ["searchTypes"], fromSearchTypes);
39893
39971
  }
39894
39972
  if (getValueByPath(fromObject, ["blockingConfidence"]) !== void 0) {
39895
- throw new Error("blockingConfidence parameter is not supported in Gemini API.");
39973
+ throw new Error("blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
39896
39974
  }
39897
39975
  if (getValueByPath(fromObject, ["excludeDomains"]) !== void 0) {
39898
- throw new Error("excludeDomains parameter is not supported in Gemini API.");
39976
+ throw new Error("excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
39899
39977
  }
39900
39978
  const fromTimeRangeFilter = getValueByPath(fromObject, [
39901
39979
  "timeRangeFilter"
@@ -40132,13 +40210,13 @@ var require_node4 = __commonJS({
40132
40210
  setValueByPath(toObject, ["videoMetadata"], fromVideoMetadata);
40133
40211
  }
40134
40212
  if (getValueByPath(fromObject, ["toolCall"]) !== void 0) {
40135
- throw new Error("toolCall parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
40213
+ throw new Error("toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
40136
40214
  }
40137
40215
  if (getValueByPath(fromObject, ["toolResponse"]) !== void 0) {
40138
- throw new Error("toolResponse parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
40216
+ throw new Error("toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
40139
40217
  }
40140
40218
  if (getValueByPath(fromObject, ["partMetadata"]) !== void 0) {
40141
- throw new Error("partMetadata parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
40219
+ throw new Error("partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
40142
40220
  }
40143
40221
  return toObject;
40144
40222
  }
@@ -40177,14 +40255,14 @@ var require_node4 = __commonJS({
40177
40255
  setValueByPath(toObject, ["functionCallingConfig"], fromFunctionCallingConfig);
40178
40256
  }
40179
40257
  if (getValueByPath(fromObject, ["includeServerSideToolInvocations"]) !== void 0) {
40180
- throw new Error("includeServerSideToolInvocations parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
40258
+ throw new Error("includeServerSideToolInvocations parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
40181
40259
  }
40182
40260
  return toObject;
40183
40261
  }
40184
40262
  function toolToMldev$3(fromObject) {
40185
40263
  const toObject = {};
40186
40264
  if (getValueByPath(fromObject, ["retrieval"]) !== void 0) {
40187
- throw new Error("retrieval parameter is not supported in Gemini API.");
40265
+ throw new Error("retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
40188
40266
  }
40189
40267
  const fromComputerUse = getValueByPath(fromObject, ["computerUse"]);
40190
40268
  if (fromComputerUse != null) {
@@ -40209,7 +40287,7 @@ var require_node4 = __commonJS({
40209
40287
  setValueByPath(toObject, ["codeExecution"], fromCodeExecution);
40210
40288
  }
40211
40289
  if (getValueByPath(fromObject, ["enterpriseWebSearch"]) !== void 0) {
40212
- throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");
40290
+ throw new Error("enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
40213
40291
  }
40214
40292
  const fromFunctionDeclarations = getValueByPath(fromObject, [
40215
40293
  "functionDeclarations"
@@ -40230,7 +40308,7 @@ var require_node4 = __commonJS({
40230
40308
  setValueByPath(toObject, ["googleSearchRetrieval"], fromGoogleSearchRetrieval);
40231
40309
  }
40232
40310
  if (getValueByPath(fromObject, ["parallelAiSearch"]) !== void 0) {
40233
- throw new Error("parallelAiSearch parameter is not supported in Gemini API.");
40311
+ throw new Error("parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
40234
40312
  }
40235
40313
  const fromUrlContext = getValueByPath(fromObject, ["urlContext"]);
40236
40314
  if (fromUrlContext != null) {
@@ -40259,7 +40337,7 @@ var require_node4 = __commonJS({
40259
40337
  setValueByPath(toObject, ["computerUse"], fromComputerUse);
40260
40338
  }
40261
40339
  if (getValueByPath(fromObject, ["fileSearch"]) !== void 0) {
40262
- throw new Error("fileSearch parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
40340
+ throw new Error("fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
40263
40341
  }
40264
40342
  const fromGoogleSearch = getValueByPath(fromObject, ["googleSearch"]);
40265
40343
  if (fromGoogleSearch != null) {
@@ -40288,7 +40366,7 @@ var require_node4 = __commonJS({
40288
40366
  let transformedList = fromFunctionDeclarations;
40289
40367
  if (Array.isArray(transformedList)) {
40290
40368
  transformedList = transformedList.map((item) => {
40291
- return functionDeclarationToVertex$2(item);
40369
+ return item;
40292
40370
  });
40293
40371
  }
40294
40372
  setValueByPath(toObject, ["functionDeclarations"], transformedList);
@@ -40310,7 +40388,7 @@ var require_node4 = __commonJS({
40310
40388
  setValueByPath(toObject, ["urlContext"], fromUrlContext);
40311
40389
  }
40312
40390
  if (getValueByPath(fromObject, ["mcpServers"]) !== void 0) {
40313
- throw new Error("mcpServers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
40391
+ throw new Error("mcpServers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
40314
40392
  }
40315
40393
  return toObject;
40316
40394
  }
@@ -41459,7 +41537,7 @@ var require_node4 = __commonJS({
41459
41537
  function audioTranscriptionConfigToMldev$1(fromObject) {
41460
41538
  const toObject = {};
41461
41539
  if (getValueByPath(fromObject, ["languageCodes"]) !== void 0) {
41462
- throw new Error("languageCodes parameter is not supported in Gemini API.");
41540
+ throw new Error("languageCodes parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
41463
41541
  }
41464
41542
  return toObject;
41465
41543
  }
@@ -41470,22 +41548,22 @@ var require_node4 = __commonJS({
41470
41548
  setValueByPath(toObject, ["apiKey"], fromApiKey);
41471
41549
  }
41472
41550
  if (getValueByPath(fromObject, ["apiKeyConfig"]) !== void 0) {
41473
- throw new Error("apiKeyConfig parameter is not supported in Gemini API.");
41551
+ throw new Error("apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
41474
41552
  }
41475
41553
  if (getValueByPath(fromObject, ["authType"]) !== void 0) {
41476
- throw new Error("authType parameter is not supported in Gemini API.");
41554
+ throw new Error("authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
41477
41555
  }
41478
41556
  if (getValueByPath(fromObject, ["googleServiceAccountConfig"]) !== void 0) {
41479
- throw new Error("googleServiceAccountConfig parameter is not supported in Gemini API.");
41557
+ throw new Error("googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
41480
41558
  }
41481
41559
  if (getValueByPath(fromObject, ["httpBasicAuthConfig"]) !== void 0) {
41482
- throw new Error("httpBasicAuthConfig parameter is not supported in Gemini API.");
41560
+ throw new Error("httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
41483
41561
  }
41484
41562
  if (getValueByPath(fromObject, ["oauthConfig"]) !== void 0) {
41485
- throw new Error("oauthConfig parameter is not supported in Gemini API.");
41563
+ throw new Error("oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
41486
41564
  }
41487
41565
  if (getValueByPath(fromObject, ["oidcConfig"]) !== void 0) {
41488
- throw new Error("oidcConfig parameter is not supported in Gemini API.");
41566
+ throw new Error("oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
41489
41567
  }
41490
41568
  return toObject;
41491
41569
  }
@@ -41496,7 +41574,7 @@ var require_node4 = __commonJS({
41496
41574
  setValueByPath(toObject, ["data"], fromData);
41497
41575
  }
41498
41576
  if (getValueByPath(fromObject, ["displayName"]) !== void 0) {
41499
- throw new Error("displayName parameter is not supported in Gemini API.");
41577
+ throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
41500
41578
  }
41501
41579
  const fromMimeType = getValueByPath(fromObject, ["mimeType"]);
41502
41580
  if (fromMimeType != null) {
@@ -41543,7 +41621,7 @@ var require_node4 = __commonJS({
41543
41621
  function fileDataToMldev$2(fromObject) {
41544
41622
  const toObject = {};
41545
41623
  if (getValueByPath(fromObject, ["displayName"]) !== void 0) {
41546
- throw new Error("displayName parameter is not supported in Gemini API.");
41624
+ throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
41547
41625
  }
41548
41626
  const fromFileUri = getValueByPath(fromObject, ["fileUri"]);
41549
41627
  if (fromFileUri != null) {
@@ -41570,45 +41648,10 @@ var require_node4 = __commonJS({
41570
41648
  setValueByPath(toObject, ["name"], fromName);
41571
41649
  }
41572
41650
  if (getValueByPath(fromObject, ["partialArgs"]) !== void 0) {
41573
- throw new Error("partialArgs parameter is not supported in Gemini API.");
41651
+ throw new Error("partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
41574
41652
  }
41575
41653
  if (getValueByPath(fromObject, ["willContinue"]) !== void 0) {
41576
- throw new Error("willContinue parameter is not supported in Gemini API.");
41577
- }
41578
- return toObject;
41579
- }
41580
- function functionDeclarationToVertex$1(fromObject) {
41581
- const toObject = {};
41582
- const fromDescription = getValueByPath(fromObject, ["description"]);
41583
- if (fromDescription != null) {
41584
- setValueByPath(toObject, ["description"], fromDescription);
41585
- }
41586
- const fromName = getValueByPath(fromObject, ["name"]);
41587
- if (fromName != null) {
41588
- setValueByPath(toObject, ["name"], fromName);
41589
- }
41590
- const fromParameters = getValueByPath(fromObject, ["parameters"]);
41591
- if (fromParameters != null) {
41592
- setValueByPath(toObject, ["parameters"], fromParameters);
41593
- }
41594
- const fromParametersJsonSchema = getValueByPath(fromObject, [
41595
- "parametersJsonSchema"
41596
- ]);
41597
- if (fromParametersJsonSchema != null) {
41598
- setValueByPath(toObject, ["parametersJsonSchema"], fromParametersJsonSchema);
41599
- }
41600
- const fromResponse = getValueByPath(fromObject, ["response"]);
41601
- if (fromResponse != null) {
41602
- setValueByPath(toObject, ["response"], fromResponse);
41603
- }
41604
- const fromResponseJsonSchema = getValueByPath(fromObject, [
41605
- "responseJsonSchema"
41606
- ]);
41607
- if (fromResponseJsonSchema != null) {
41608
- setValueByPath(toObject, ["responseJsonSchema"], fromResponseJsonSchema);
41609
- }
41610
- if (getValueByPath(fromObject, ["behavior"]) !== void 0) {
41611
- throw new Error("behavior parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
41654
+ throw new Error("willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
41612
41655
  }
41613
41656
  return toObject;
41614
41657
  }
@@ -41735,7 +41778,7 @@ var require_node4 = __commonJS({
41735
41778
  setValueByPath(toObject, ["topP"], fromTopP);
41736
41779
  }
41737
41780
  if (getValueByPath(fromObject, ["enableEnhancedCivicAnswers"]) !== void 0) {
41738
- throw new Error("enableEnhancedCivicAnswers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
41781
+ throw new Error("enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
41739
41782
  }
41740
41783
  return toObject;
41741
41784
  }
@@ -41758,10 +41801,10 @@ var require_node4 = __commonJS({
41758
41801
  setValueByPath(toObject, ["searchTypes"], fromSearchTypes);
41759
41802
  }
41760
41803
  if (getValueByPath(fromObject, ["blockingConfidence"]) !== void 0) {
41761
- throw new Error("blockingConfidence parameter is not supported in Gemini API.");
41804
+ throw new Error("blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
41762
41805
  }
41763
41806
  if (getValueByPath(fromObject, ["excludeDomains"]) !== void 0) {
41764
- throw new Error("excludeDomains parameter is not supported in Gemini API.");
41807
+ throw new Error("excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
41765
41808
  }
41766
41809
  const fromTimeRangeFilter = getValueByPath(fromObject, [
41767
41810
  "timeRangeFilter"
@@ -41880,7 +41923,7 @@ var require_node4 = __commonJS({
41880
41923
  setValueByPath(parentObject, ["setup", "proactivity"], fromProactivity);
41881
41924
  }
41882
41925
  if (getValueByPath(fromObject, ["explicitVadSignal"]) !== void 0) {
41883
- throw new Error("explicitVadSignal parameter is not supported in Gemini API.");
41926
+ throw new Error("explicitVadSignal parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
41884
41927
  }
41885
41928
  const fromAvatarConfig = getValueByPath(fromObject, ["avatarConfig"]);
41886
41929
  if (parentObject !== void 0 && fromAvatarConfig != null) {
@@ -41898,6 +41941,12 @@ var require_node4 = __commonJS({
41898
41941
  }
41899
41942
  setValueByPath(parentObject, ["setup", "safetySettings"], transformedList);
41900
41943
  }
41944
+ const fromStreamTranslationConfig = getValueByPath(fromObject, [
41945
+ "streamTranslationConfig"
41946
+ ]);
41947
+ if (parentObject !== void 0 && fromStreamTranslationConfig != null) {
41948
+ setValueByPath(parentObject, ["setup", "generationConfig", "streamTranslationConfig"], fromStreamTranslationConfig);
41949
+ }
41901
41950
  return toObject;
41902
41951
  }
41903
41952
  function liveConnectConfigToVertex(fromObject, parentObject) {
@@ -42030,6 +42079,9 @@ var require_node4 = __commonJS({
42030
42079
  }
42031
42080
  setValueByPath(parentObject, ["setup", "safetySettings"], transformedList);
42032
42081
  }
42082
+ if (getValueByPath(fromObject, ["streamTranslationConfig"]) !== void 0) {
42083
+ throw new Error("streamTranslationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
42084
+ }
42033
42085
  return toObject;
42034
42086
  }
42035
42087
  function liveConnectParametersToMldev(apiClient, fromObject) {
@@ -42351,13 +42403,13 @@ var require_node4 = __commonJS({
42351
42403
  setValueByPath(toObject, ["videoMetadata"], fromVideoMetadata);
42352
42404
  }
42353
42405
  if (getValueByPath(fromObject, ["toolCall"]) !== void 0) {
42354
- throw new Error("toolCall parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
42406
+ throw new Error("toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
42355
42407
  }
42356
42408
  if (getValueByPath(fromObject, ["toolResponse"]) !== void 0) {
42357
- throw new Error("toolResponse parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
42409
+ throw new Error("toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
42358
42410
  }
42359
42411
  if (getValueByPath(fromObject, ["partMetadata"]) !== void 0) {
42360
- throw new Error("partMetadata parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
42412
+ throw new Error("partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
42361
42413
  }
42362
42414
  return toObject;
42363
42415
  }
@@ -42368,7 +42420,7 @@ var require_node4 = __commonJS({
42368
42420
  setValueByPath(toObject, ["category"], fromCategory);
42369
42421
  }
42370
42422
  if (getValueByPath(fromObject, ["method"]) !== void 0) {
42371
- throw new Error("method parameter is not supported in Gemini API.");
42423
+ throw new Error("method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
42372
42424
  }
42373
42425
  const fromThreshold = getValueByPath(fromObject, ["threshold"]);
42374
42426
  if (fromThreshold != null) {
@@ -42383,14 +42435,14 @@ var require_node4 = __commonJS({
42383
42435
  setValueByPath(toObject, ["handle"], fromHandle);
42384
42436
  }
42385
42437
  if (getValueByPath(fromObject, ["transparent"]) !== void 0) {
42386
- throw new Error("transparent parameter is not supported in Gemini API.");
42438
+ throw new Error("transparent parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
42387
42439
  }
42388
42440
  return toObject;
42389
42441
  }
42390
42442
  function toolToMldev$2(fromObject) {
42391
42443
  const toObject = {};
42392
42444
  if (getValueByPath(fromObject, ["retrieval"]) !== void 0) {
42393
- throw new Error("retrieval parameter is not supported in Gemini API.");
42445
+ throw new Error("retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
42394
42446
  }
42395
42447
  const fromComputerUse = getValueByPath(fromObject, ["computerUse"]);
42396
42448
  if (fromComputerUse != null) {
@@ -42415,7 +42467,7 @@ var require_node4 = __commonJS({
42415
42467
  setValueByPath(toObject, ["codeExecution"], fromCodeExecution);
42416
42468
  }
42417
42469
  if (getValueByPath(fromObject, ["enterpriseWebSearch"]) !== void 0) {
42418
- throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");
42470
+ throw new Error("enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
42419
42471
  }
42420
42472
  const fromFunctionDeclarations = getValueByPath(fromObject, [
42421
42473
  "functionDeclarations"
@@ -42436,7 +42488,7 @@ var require_node4 = __commonJS({
42436
42488
  setValueByPath(toObject, ["googleSearchRetrieval"], fromGoogleSearchRetrieval);
42437
42489
  }
42438
42490
  if (getValueByPath(fromObject, ["parallelAiSearch"]) !== void 0) {
42439
- throw new Error("parallelAiSearch parameter is not supported in Gemini API.");
42491
+ throw new Error("parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
42440
42492
  }
42441
42493
  const fromUrlContext = getValueByPath(fromObject, ["urlContext"]);
42442
42494
  if (fromUrlContext != null) {
@@ -42465,7 +42517,7 @@ var require_node4 = __commonJS({
42465
42517
  setValueByPath(toObject, ["computerUse"], fromComputerUse);
42466
42518
  }
42467
42519
  if (getValueByPath(fromObject, ["fileSearch"]) !== void 0) {
42468
- throw new Error("fileSearch parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
42520
+ throw new Error("fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
42469
42521
  }
42470
42522
  const fromGoogleSearch = getValueByPath(fromObject, ["googleSearch"]);
42471
42523
  if (fromGoogleSearch != null) {
@@ -42494,7 +42546,7 @@ var require_node4 = __commonJS({
42494
42546
  let transformedList = fromFunctionDeclarations;
42495
42547
  if (Array.isArray(transformedList)) {
42496
42548
  transformedList = transformedList.map((item) => {
42497
- return functionDeclarationToVertex$1(item);
42549
+ return item;
42498
42550
  });
42499
42551
  }
42500
42552
  setValueByPath(toObject, ["functionDeclarations"], transformedList);
@@ -42516,7 +42568,7 @@ var require_node4 = __commonJS({
42516
42568
  setValueByPath(toObject, ["urlContext"], fromUrlContext);
42517
42569
  }
42518
42570
  if (getValueByPath(fromObject, ["mcpServers"]) !== void 0) {
42519
- throw new Error("mcpServers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
42571
+ throw new Error("mcpServers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
42520
42572
  }
42521
42573
  return toObject;
42522
42574
  }
@@ -42627,22 +42679,22 @@ var require_node4 = __commonJS({
42627
42679
  setValueByPath(toObject, ["apiKey"], fromApiKey);
42628
42680
  }
42629
42681
  if (getValueByPath(fromObject, ["apiKeyConfig"]) !== void 0) {
42630
- throw new Error("apiKeyConfig parameter is not supported in Gemini API.");
42682
+ throw new Error("apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
42631
42683
  }
42632
42684
  if (getValueByPath(fromObject, ["authType"]) !== void 0) {
42633
- throw new Error("authType parameter is not supported in Gemini API.");
42685
+ throw new Error("authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
42634
42686
  }
42635
42687
  if (getValueByPath(fromObject, ["googleServiceAccountConfig"]) !== void 0) {
42636
- throw new Error("googleServiceAccountConfig parameter is not supported in Gemini API.");
42688
+ throw new Error("googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
42637
42689
  }
42638
42690
  if (getValueByPath(fromObject, ["httpBasicAuthConfig"]) !== void 0) {
42639
- throw new Error("httpBasicAuthConfig parameter is not supported in Gemini API.");
42691
+ throw new Error("httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
42640
42692
  }
42641
42693
  if (getValueByPath(fromObject, ["oauthConfig"]) !== void 0) {
42642
- throw new Error("oauthConfig parameter is not supported in Gemini API.");
42694
+ throw new Error("oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
42643
42695
  }
42644
42696
  if (getValueByPath(fromObject, ["oidcConfig"]) !== void 0) {
42645
- throw new Error("oidcConfig parameter is not supported in Gemini API.");
42697
+ throw new Error("oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
42646
42698
  }
42647
42699
  return toObject;
42648
42700
  }
@@ -42653,7 +42705,7 @@ var require_node4 = __commonJS({
42653
42705
  setValueByPath(toObject, ["data"], fromData);
42654
42706
  }
42655
42707
  if (getValueByPath(fromObject, ["displayName"]) !== void 0) {
42656
- throw new Error("displayName parameter is not supported in Gemini API.");
42708
+ throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
42657
42709
  }
42658
42710
  const fromMimeType = getValueByPath(fromObject, ["mimeType"]);
42659
42711
  if (fromMimeType != null) {
@@ -42850,13 +42902,13 @@ var require_node4 = __commonJS({
42850
42902
  function countTokensConfigToMldev(fromObject, _rootObject) {
42851
42903
  const toObject = {};
42852
42904
  if (getValueByPath(fromObject, ["systemInstruction"]) !== void 0) {
42853
- throw new Error("systemInstruction parameter is not supported in Gemini API.");
42905
+ throw new Error("systemInstruction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
42854
42906
  }
42855
42907
  if (getValueByPath(fromObject, ["tools"]) !== void 0) {
42856
- throw new Error("tools parameter is not supported in Gemini API.");
42908
+ throw new Error("tools parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
42857
42909
  }
42858
42910
  if (getValueByPath(fromObject, ["generationConfig"]) !== void 0) {
42859
- throw new Error("generationConfig parameter is not supported in Gemini API.");
42911
+ throw new Error("generationConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
42860
42912
  }
42861
42913
  return toObject;
42862
42914
  }
@@ -43157,16 +43209,16 @@ var require_node4 = __commonJS({
43157
43209
  setValueByPath(parentObject, ["requests[]", "outputDimensionality"], fromOutputDimensionality);
43158
43210
  }
43159
43211
  if (getValueByPath(fromObject, ["mimeType"]) !== void 0) {
43160
- throw new Error("mimeType parameter is not supported in Gemini API.");
43212
+ throw new Error("mimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
43161
43213
  }
43162
43214
  if (getValueByPath(fromObject, ["autoTruncate"]) !== void 0) {
43163
- throw new Error("autoTruncate parameter is not supported in Gemini API.");
43215
+ throw new Error("autoTruncate parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
43164
43216
  }
43165
43217
  if (getValueByPath(fromObject, ["documentOcr"]) !== void 0) {
43166
- throw new Error("documentOcr parameter is not supported in Gemini API.");
43218
+ throw new Error("documentOcr parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
43167
43219
  }
43168
43220
  if (getValueByPath(fromObject, ["audioTrackExtraction"]) !== void 0) {
43169
- throw new Error("audioTrackExtraction parameter is not supported in Gemini API.");
43221
+ throw new Error("audioTrackExtraction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
43170
43222
  }
43171
43223
  return toObject;
43172
43224
  }
@@ -43444,7 +43496,7 @@ var require_node4 = __commonJS({
43444
43496
  function fileDataToMldev$1(fromObject, _rootObject) {
43445
43497
  const toObject = {};
43446
43498
  if (getValueByPath(fromObject, ["displayName"]) !== void 0) {
43447
- throw new Error("displayName parameter is not supported in Gemini API.");
43499
+ throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
43448
43500
  }
43449
43501
  const fromFileUri = getValueByPath(fromObject, ["fileUri"]);
43450
43502
  if (fromFileUri != null) {
@@ -43471,10 +43523,10 @@ var require_node4 = __commonJS({
43471
43523
  setValueByPath(toObject, ["name"], fromName);
43472
43524
  }
43473
43525
  if (getValueByPath(fromObject, ["partialArgs"]) !== void 0) {
43474
- throw new Error("partialArgs parameter is not supported in Gemini API.");
43526
+ throw new Error("partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
43475
43527
  }
43476
43528
  if (getValueByPath(fromObject, ["willContinue"]) !== void 0) {
43477
- throw new Error("willContinue parameter is not supported in Gemini API.");
43529
+ throw new Error("willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
43478
43530
  }
43479
43531
  return toObject;
43480
43532
  }
@@ -43491,42 +43543,7 @@ var require_node4 = __commonJS({
43491
43543
  setValueByPath(toObject, ["mode"], fromMode);
43492
43544
  }
43493
43545
  if (getValueByPath(fromObject, ["streamFunctionCallArguments"]) !== void 0) {
43494
- throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");
43495
- }
43496
- return toObject;
43497
- }
43498
- function functionDeclarationToVertex(fromObject, _rootObject) {
43499
- const toObject = {};
43500
- const fromDescription = getValueByPath(fromObject, ["description"]);
43501
- if (fromDescription != null) {
43502
- setValueByPath(toObject, ["description"], fromDescription);
43503
- }
43504
- const fromName = getValueByPath(fromObject, ["name"]);
43505
- if (fromName != null) {
43506
- setValueByPath(toObject, ["name"], fromName);
43507
- }
43508
- const fromParameters = getValueByPath(fromObject, ["parameters"]);
43509
- if (fromParameters != null) {
43510
- setValueByPath(toObject, ["parameters"], fromParameters);
43511
- }
43512
- const fromParametersJsonSchema = getValueByPath(fromObject, [
43513
- "parametersJsonSchema"
43514
- ]);
43515
- if (fromParametersJsonSchema != null) {
43516
- setValueByPath(toObject, ["parametersJsonSchema"], fromParametersJsonSchema);
43517
- }
43518
- const fromResponse = getValueByPath(fromObject, ["response"]);
43519
- if (fromResponse != null) {
43520
- setValueByPath(toObject, ["response"], fromResponse);
43521
- }
43522
- const fromResponseJsonSchema = getValueByPath(fromObject, [
43523
- "responseJsonSchema"
43524
- ]);
43525
- if (fromResponseJsonSchema != null) {
43526
- setValueByPath(toObject, ["responseJsonSchema"], fromResponseJsonSchema);
43527
- }
43528
- if (getValueByPath(fromObject, ["behavior"]) !== void 0) {
43529
- throw new Error("behavior parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
43546
+ throw new Error("streamFunctionCallArguments parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
43530
43547
  }
43531
43548
  return toObject;
43532
43549
  }
@@ -43613,10 +43630,10 @@ var require_node4 = __commonJS({
43613
43630
  setValueByPath(toObject, ["responseJsonSchema"], fromResponseJsonSchema);
43614
43631
  }
43615
43632
  if (getValueByPath(fromObject, ["routingConfig"]) !== void 0) {
43616
- throw new Error("routingConfig parameter is not supported in Gemini API.");
43633
+ throw new Error("routingConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
43617
43634
  }
43618
43635
  if (getValueByPath(fromObject, ["modelSelectionConfig"]) !== void 0) {
43619
- throw new Error("modelSelectionConfig parameter is not supported in Gemini API.");
43636
+ throw new Error("modelSelectionConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
43620
43637
  }
43621
43638
  const fromSafetySettings = getValueByPath(fromObject, [
43622
43639
  "safetySettings"
@@ -43645,7 +43662,7 @@ var require_node4 = __commonJS({
43645
43662
  setValueByPath(parentObject, ["toolConfig"], toolConfigToMldev(fromToolConfig));
43646
43663
  }
43647
43664
  if (getValueByPath(fromObject, ["labels"]) !== void 0) {
43648
- throw new Error("labels parameter is not supported in Gemini API.");
43665
+ throw new Error("labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
43649
43666
  }
43650
43667
  const fromCachedContent = getValueByPath(fromObject, [
43651
43668
  "cachedContent"
@@ -43670,7 +43687,7 @@ var require_node4 = __commonJS({
43670
43687
  setValueByPath(toObject, ["speechConfig"], tSpeechConfig(fromSpeechConfig));
43671
43688
  }
43672
43689
  if (getValueByPath(fromObject, ["audioTimestamp"]) !== void 0) {
43673
- throw new Error("audioTimestamp parameter is not supported in Gemini API.");
43690
+ throw new Error("audioTimestamp parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
43674
43691
  }
43675
43692
  const fromThinkingConfig = getValueByPath(fromObject, [
43676
43693
  "thinkingConfig"
@@ -43689,7 +43706,7 @@ var require_node4 = __commonJS({
43689
43706
  setValueByPath(toObject, ["enableEnhancedCivicAnswers"], fromEnableEnhancedCivicAnswers);
43690
43707
  }
43691
43708
  if (getValueByPath(fromObject, ["modelArmorConfig"]) !== void 0) {
43692
- throw new Error("modelArmorConfig parameter is not supported in Gemini API.");
43709
+ throw new Error("modelArmorConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
43693
43710
  }
43694
43711
  const fromServiceTier = getValueByPath(fromObject, ["serviceTier"]);
43695
43712
  if (parentObject !== void 0 && fromServiceTier != null) {
@@ -43860,7 +43877,7 @@ var require_node4 = __commonJS({
43860
43877
  setValueByPath(toObject, ["imageConfig"], imageConfigToVertex(fromImageConfig));
43861
43878
  }
43862
43879
  if (getValueByPath(fromObject, ["enableEnhancedCivicAnswers"]) !== void 0) {
43863
- throw new Error("enableEnhancedCivicAnswers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
43880
+ throw new Error("enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
43864
43881
  }
43865
43882
  const fromModelArmorConfig = getValueByPath(fromObject, [
43866
43883
  "modelArmorConfig"
@@ -44009,10 +44026,10 @@ var require_node4 = __commonJS({
44009
44026
  function generateImagesConfigToMldev(fromObject, parentObject, _rootObject) {
44010
44027
  const toObject = {};
44011
44028
  if (getValueByPath(fromObject, ["outputGcsUri"]) !== void 0) {
44012
- throw new Error("outputGcsUri parameter is not supported in Gemini API.");
44029
+ throw new Error("outputGcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
44013
44030
  }
44014
44031
  if (getValueByPath(fromObject, ["negativePrompt"]) !== void 0) {
44015
- throw new Error("negativePrompt parameter is not supported in Gemini API.");
44032
+ throw new Error("negativePrompt parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
44016
44033
  }
44017
44034
  const fromNumberOfImages = getValueByPath(fromObject, [
44018
44035
  "numberOfImages"
@@ -44031,7 +44048,7 @@ var require_node4 = __commonJS({
44031
44048
  setValueByPath(parentObject, ["parameters", "guidanceScale"], fromGuidanceScale);
44032
44049
  }
44033
44050
  if (getValueByPath(fromObject, ["seed"]) !== void 0) {
44034
- throw new Error("seed parameter is not supported in Gemini API.");
44051
+ throw new Error("seed parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
44035
44052
  }
44036
44053
  const fromSafetyFilterLevel = getValueByPath(fromObject, [
44037
44054
  "safetyFilterLevel"
@@ -44074,17 +44091,17 @@ var require_node4 = __commonJS({
44074
44091
  setValueByPath(parentObject, ["parameters", "outputOptions", "compressionQuality"], fromOutputCompressionQuality);
44075
44092
  }
44076
44093
  if (getValueByPath(fromObject, ["addWatermark"]) !== void 0) {
44077
- throw new Error("addWatermark parameter is not supported in Gemini API.");
44094
+ throw new Error("addWatermark parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
44078
44095
  }
44079
44096
  if (getValueByPath(fromObject, ["labels"]) !== void 0) {
44080
- throw new Error("labels parameter is not supported in Gemini API.");
44097
+ throw new Error("labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
44081
44098
  }
44082
44099
  const fromImageSize = getValueByPath(fromObject, ["imageSize"]);
44083
44100
  if (parentObject !== void 0 && fromImageSize != null) {
44084
44101
  setValueByPath(parentObject, ["parameters", "sampleImageSize"], fromImageSize);
44085
44102
  }
44086
44103
  if (getValueByPath(fromObject, ["enhancePrompt"]) !== void 0) {
44087
- throw new Error("enhancePrompt parameter is not supported in Gemini API.");
44104
+ throw new Error("enhancePrompt parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
44088
44105
  }
44089
44106
  return toObject;
44090
44107
  }
@@ -44277,10 +44294,10 @@ var require_node4 = __commonJS({
44277
44294
  setValueByPath(parentObject, ["parameters", "sampleCount"], fromNumberOfVideos);
44278
44295
  }
44279
44296
  if (getValueByPath(fromObject, ["outputGcsUri"]) !== void 0) {
44280
- throw new Error("outputGcsUri parameter is not supported in Gemini API.");
44297
+ throw new Error("outputGcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
44281
44298
  }
44282
44299
  if (getValueByPath(fromObject, ["fps"]) !== void 0) {
44283
- throw new Error("fps parameter is not supported in Gemini API.");
44300
+ throw new Error("fps parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
44284
44301
  }
44285
44302
  const fromDurationSeconds = getValueByPath(fromObject, [
44286
44303
  "durationSeconds"
@@ -44289,7 +44306,7 @@ var require_node4 = __commonJS({
44289
44306
  setValueByPath(parentObject, ["parameters", "durationSeconds"], fromDurationSeconds);
44290
44307
  }
44291
44308
  if (getValueByPath(fromObject, ["seed"]) !== void 0) {
44292
- throw new Error("seed parameter is not supported in Gemini API.");
44309
+ throw new Error("seed parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
44293
44310
  }
44294
44311
  const fromAspectRatio = getValueByPath(fromObject, ["aspectRatio"]);
44295
44312
  if (parentObject !== void 0 && fromAspectRatio != null) {
@@ -44306,7 +44323,7 @@ var require_node4 = __commonJS({
44306
44323
  setValueByPath(parentObject, ["parameters", "personGeneration"], fromPersonGeneration);
44307
44324
  }
44308
44325
  if (getValueByPath(fromObject, ["pubsubTopic"]) !== void 0) {
44309
- throw new Error("pubsubTopic parameter is not supported in Gemini API.");
44326
+ throw new Error("pubsubTopic parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
44310
44327
  }
44311
44328
  const fromNegativePrompt = getValueByPath(fromObject, [
44312
44329
  "negativePrompt"
@@ -44321,7 +44338,7 @@ var require_node4 = __commonJS({
44321
44338
  setValueByPath(parentObject, ["parameters", "enhancePrompt"], fromEnhancePrompt);
44322
44339
  }
44323
44340
  if (getValueByPath(fromObject, ["generateAudio"]) !== void 0) {
44324
- throw new Error("generateAudio parameter is not supported in Gemini API.");
44341
+ throw new Error("generateAudio parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
44325
44342
  }
44326
44343
  const fromLastFrame = getValueByPath(fromObject, ["lastFrame"]);
44327
44344
  if (parentObject !== void 0 && fromLastFrame != null) {
@@ -44340,13 +44357,13 @@ var require_node4 = __commonJS({
44340
44357
  setValueByPath(parentObject, ["instances[0]", "referenceImages"], transformedList);
44341
44358
  }
44342
44359
  if (getValueByPath(fromObject, ["mask"]) !== void 0) {
44343
- throw new Error("mask parameter is not supported in Gemini API.");
44360
+ throw new Error("mask parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
44344
44361
  }
44345
44362
  if (getValueByPath(fromObject, ["compressionQuality"]) !== void 0) {
44346
- throw new Error("compressionQuality parameter is not supported in Gemini API.");
44363
+ throw new Error("compressionQuality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
44347
44364
  }
44348
44365
  if (getValueByPath(fromObject, ["labels"]) !== void 0) {
44349
- throw new Error("labels parameter is not supported in Gemini API.");
44366
+ throw new Error("labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
44350
44367
  }
44351
44368
  const fromWebhookConfig = getValueByPath(fromObject, [
44352
44369
  "webhookConfig"
@@ -44355,7 +44372,7 @@ var require_node4 = __commonJS({
44355
44372
  setValueByPath(parentObject, ["webhookConfig"], fromWebhookConfig);
44356
44373
  }
44357
44374
  if (getValueByPath(fromObject, ["resizeMode"]) !== void 0) {
44358
- throw new Error("resizeMode parameter is not supported in Gemini API.");
44375
+ throw new Error("resizeMode parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
44359
44376
  }
44360
44377
  return toObject;
44361
44378
  }
@@ -44452,7 +44469,7 @@ var require_node4 = __commonJS({
44452
44469
  setValueByPath(parentObject, ["labels"], fromLabels);
44453
44470
  }
44454
44471
  if (getValueByPath(fromObject, ["webhookConfig"]) !== void 0) {
44455
- throw new Error("webhookConfig parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
44472
+ throw new Error("webhookConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
44456
44473
  }
44457
44474
  const fromResizeMode = getValueByPath(fromObject, ["resizeMode"]);
44458
44475
  if (parentObject !== void 0 && fromResizeMode != null) {
@@ -44850,7 +44867,7 @@ var require_node4 = __commonJS({
44850
44867
  setValueByPath(toObject, ["topP"], fromTopP);
44851
44868
  }
44852
44869
  if (getValueByPath(fromObject, ["enableEnhancedCivicAnswers"]) !== void 0) {
44853
- throw new Error("enableEnhancedCivicAnswers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
44870
+ throw new Error("enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
44854
44871
  }
44855
44872
  return toObject;
44856
44873
  }
@@ -44889,10 +44906,10 @@ var require_node4 = __commonJS({
44889
44906
  setValueByPath(toObject, ["searchTypes"], fromSearchTypes);
44890
44907
  }
44891
44908
  if (getValueByPath(fromObject, ["blockingConfidence"]) !== void 0) {
44892
- throw new Error("blockingConfidence parameter is not supported in Gemini API.");
44909
+ throw new Error("blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
44893
44910
  }
44894
44911
  if (getValueByPath(fromObject, ["excludeDomains"]) !== void 0) {
44895
- throw new Error("excludeDomains parameter is not supported in Gemini API.");
44912
+ throw new Error("excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
44896
44913
  }
44897
44914
  const fromTimeRangeFilter = getValueByPath(fromObject, [
44898
44915
  "timeRangeFilter"
@@ -44913,19 +44930,19 @@ var require_node4 = __commonJS({
44913
44930
  setValueByPath(toObject, ["imageSize"], fromImageSize);
44914
44931
  }
44915
44932
  if (getValueByPath(fromObject, ["personGeneration"]) !== void 0) {
44916
- throw new Error("personGeneration parameter is not supported in Gemini API.");
44933
+ throw new Error("personGeneration parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
44917
44934
  }
44918
44935
  if (getValueByPath(fromObject, ["prominentPeople"]) !== void 0) {
44919
- throw new Error("prominentPeople parameter is not supported in Gemini API.");
44936
+ throw new Error("prominentPeople parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
44920
44937
  }
44921
44938
  if (getValueByPath(fromObject, ["outputMimeType"]) !== void 0) {
44922
- throw new Error("outputMimeType parameter is not supported in Gemini API.");
44939
+ throw new Error("outputMimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
44923
44940
  }
44924
44941
  if (getValueByPath(fromObject, ["outputCompressionQuality"]) !== void 0) {
44925
- throw new Error("outputCompressionQuality parameter is not supported in Gemini API.");
44942
+ throw new Error("outputCompressionQuality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
44926
44943
  }
44927
44944
  if (getValueByPath(fromObject, ["imageOutputOptions"]) !== void 0) {
44928
- throw new Error("imageOutputOptions parameter is not supported in Gemini API.");
44945
+ throw new Error("imageOutputOptions parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
44929
44946
  }
44930
44947
  return toObject;
44931
44948
  }
@@ -45006,7 +45023,7 @@ var require_node4 = __commonJS({
45006
45023
  function imageToMldev(fromObject, _rootObject) {
45007
45024
  const toObject = {};
45008
45025
  if (getValueByPath(fromObject, ["gcsUri"]) !== void 0) {
45009
- throw new Error("gcsUri parameter is not supported in Gemini API.");
45026
+ throw new Error("gcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
45010
45027
  }
45011
45028
  const fromImageBytes = getValueByPath(fromObject, ["imageBytes"]);
45012
45029
  if (fromImageBytes != null) {
@@ -45409,13 +45426,13 @@ var require_node4 = __commonJS({
45409
45426
  setValueByPath(toObject, ["videoMetadata"], fromVideoMetadata);
45410
45427
  }
45411
45428
  if (getValueByPath(fromObject, ["toolCall"]) !== void 0) {
45412
- throw new Error("toolCall parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
45429
+ throw new Error("toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
45413
45430
  }
45414
45431
  if (getValueByPath(fromObject, ["toolResponse"]) !== void 0) {
45415
- throw new Error("toolResponse parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
45432
+ throw new Error("toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
45416
45433
  }
45417
45434
  if (getValueByPath(fromObject, ["partMetadata"]) !== void 0) {
45418
- throw new Error("partMetadata parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
45435
+ throw new Error("partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
45419
45436
  }
45420
45437
  return toObject;
45421
45438
  }
@@ -45638,7 +45655,7 @@ var require_node4 = __commonJS({
45638
45655
  setValueByPath(toObject, ["category"], fromCategory);
45639
45656
  }
45640
45657
  if (getValueByPath(fromObject, ["method"]) !== void 0) {
45641
- throw new Error("method parameter is not supported in Gemini API.");
45658
+ throw new Error("method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
45642
45659
  }
45643
45660
  const fromThreshold = getValueByPath(fromObject, ["threshold"]);
45644
45661
  if (fromThreshold != null) {
@@ -45771,14 +45788,14 @@ var require_node4 = __commonJS({
45771
45788
  setValueByPath(toObject, ["functionCallingConfig"], fromFunctionCallingConfig);
45772
45789
  }
45773
45790
  if (getValueByPath(fromObject, ["includeServerSideToolInvocations"]) !== void 0) {
45774
- throw new Error("includeServerSideToolInvocations parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
45791
+ throw new Error("includeServerSideToolInvocations parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
45775
45792
  }
45776
45793
  return toObject;
45777
45794
  }
45778
45795
  function toolToMldev$1(fromObject, rootObject) {
45779
45796
  const toObject = {};
45780
45797
  if (getValueByPath(fromObject, ["retrieval"]) !== void 0) {
45781
- throw new Error("retrieval parameter is not supported in Gemini API.");
45798
+ throw new Error("retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
45782
45799
  }
45783
45800
  const fromComputerUse = getValueByPath(fromObject, ["computerUse"]);
45784
45801
  if (fromComputerUse != null) {
@@ -45803,7 +45820,7 @@ var require_node4 = __commonJS({
45803
45820
  setValueByPath(toObject, ["codeExecution"], fromCodeExecution);
45804
45821
  }
45805
45822
  if (getValueByPath(fromObject, ["enterpriseWebSearch"]) !== void 0) {
45806
- throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");
45823
+ throw new Error("enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
45807
45824
  }
45808
45825
  const fromFunctionDeclarations = getValueByPath(fromObject, [
45809
45826
  "functionDeclarations"
@@ -45824,7 +45841,7 @@ var require_node4 = __commonJS({
45824
45841
  setValueByPath(toObject, ["googleSearchRetrieval"], fromGoogleSearchRetrieval);
45825
45842
  }
45826
45843
  if (getValueByPath(fromObject, ["parallelAiSearch"]) !== void 0) {
45827
- throw new Error("parallelAiSearch parameter is not supported in Gemini API.");
45844
+ throw new Error("parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
45828
45845
  }
45829
45846
  const fromUrlContext = getValueByPath(fromObject, ["urlContext"]);
45830
45847
  if (fromUrlContext != null) {
@@ -45842,7 +45859,7 @@ var require_node4 = __commonJS({
45842
45859
  }
45843
45860
  return toObject;
45844
45861
  }
45845
- function toolToVertex(fromObject, rootObject) {
45862
+ function toolToVertex(fromObject, _rootObject) {
45846
45863
  const toObject = {};
45847
45864
  const fromRetrieval = getValueByPath(fromObject, ["retrieval"]);
45848
45865
  if (fromRetrieval != null) {
@@ -45853,7 +45870,7 @@ var require_node4 = __commonJS({
45853
45870
  setValueByPath(toObject, ["computerUse"], fromComputerUse);
45854
45871
  }
45855
45872
  if (getValueByPath(fromObject, ["fileSearch"]) !== void 0) {
45856
- throw new Error("fileSearch parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
45873
+ throw new Error("fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
45857
45874
  }
45858
45875
  const fromGoogleSearch = getValueByPath(fromObject, ["googleSearch"]);
45859
45876
  if (fromGoogleSearch != null) {
@@ -45882,7 +45899,7 @@ var require_node4 = __commonJS({
45882
45899
  let transformedList = fromFunctionDeclarations;
45883
45900
  if (Array.isArray(transformedList)) {
45884
45901
  transformedList = transformedList.map((item) => {
45885
- return functionDeclarationToVertex(item);
45902
+ return item;
45886
45903
  });
45887
45904
  }
45888
45905
  setValueByPath(toObject, ["functionDeclarations"], transformedList);
@@ -45904,7 +45921,7 @@ var require_node4 = __commonJS({
45904
45921
  setValueByPath(toObject, ["urlContext"], fromUrlContext);
45905
45922
  }
45906
45923
  if (getValueByPath(fromObject, ["mcpServers"]) !== void 0) {
45907
- throw new Error("mcpServers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
45924
+ throw new Error("mcpServers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
45908
45925
  }
45909
45926
  return toObject;
45910
45927
  }
@@ -46455,7 +46472,7 @@ var require_node4 = __commonJS({
46455
46472
  var SERVER_TIMEOUT_HEADER = "X-Server-Timeout";
46456
46473
  var USER_AGENT_HEADER = "User-Agent";
46457
46474
  var GOOGLE_API_CLIENT_HEADER = "x-goog-api-client";
46458
- var SDK_VERSION = "2.0.1";
46475
+ var SDK_VERSION = "2.4.0";
46459
46476
  var LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
46460
46477
  var VERTEX_AI_API_DEFAULT_VERSION = "v1beta1";
46461
46478
  var GOOGLE_AI_API_DEFAULT_VERSION = "v1beta";
@@ -47951,7 +47968,7 @@ var require_node4 = __commonJS({
47951
47968
  if (this.apiClient.isVertexAI()) {
47952
47969
  if (!actualParams.config.queryBase) {
47953
47970
  if ((_a2 = actualParams.config) === null || _a2 === void 0 ? void 0 : _a2.filter) {
47954
- throw new Error("Filtering tuned models list for Gemini Enterprise Agent Platform (previously known as Vertex AI) is not currently supported");
47971
+ throw new Error("Filtering tuned models list is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
47955
47972
  } else {
47956
47973
  actualParams.config.filter = "labels.tune-type:*";
47957
47974
  }
@@ -49250,7 +49267,7 @@ var require_node4 = __commonJS({
49250
49267
  function audioTranscriptionConfigToMldev(fromObject) {
49251
49268
  const toObject = {};
49252
49269
  if (getValueByPath(fromObject, ["languageCodes"]) !== void 0) {
49253
- throw new Error("languageCodes parameter is not supported in Gemini API.");
49270
+ throw new Error("languageCodes parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
49254
49271
  }
49255
49272
  return toObject;
49256
49273
  }
@@ -49261,22 +49278,22 @@ var require_node4 = __commonJS({
49261
49278
  setValueByPath(toObject, ["apiKey"], fromApiKey);
49262
49279
  }
49263
49280
  if (getValueByPath(fromObject, ["apiKeyConfig"]) !== void 0) {
49264
- throw new Error("apiKeyConfig parameter is not supported in Gemini API.");
49281
+ throw new Error("apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
49265
49282
  }
49266
49283
  if (getValueByPath(fromObject, ["authType"]) !== void 0) {
49267
- throw new Error("authType parameter is not supported in Gemini API.");
49284
+ throw new Error("authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
49268
49285
  }
49269
49286
  if (getValueByPath(fromObject, ["googleServiceAccountConfig"]) !== void 0) {
49270
- throw new Error("googleServiceAccountConfig parameter is not supported in Gemini API.");
49287
+ throw new Error("googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
49271
49288
  }
49272
49289
  if (getValueByPath(fromObject, ["httpBasicAuthConfig"]) !== void 0) {
49273
- throw new Error("httpBasicAuthConfig parameter is not supported in Gemini API.");
49290
+ throw new Error("httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
49274
49291
  }
49275
49292
  if (getValueByPath(fromObject, ["oauthConfig"]) !== void 0) {
49276
- throw new Error("oauthConfig parameter is not supported in Gemini API.");
49293
+ throw new Error("oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
49277
49294
  }
49278
49295
  if (getValueByPath(fromObject, ["oidcConfig"]) !== void 0) {
49279
- throw new Error("oidcConfig parameter is not supported in Gemini API.");
49296
+ throw new Error("oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
49280
49297
  }
49281
49298
  return toObject;
49282
49299
  }
@@ -49287,7 +49304,7 @@ var require_node4 = __commonJS({
49287
49304
  setValueByPath(toObject, ["data"], fromData);
49288
49305
  }
49289
49306
  if (getValueByPath(fromObject, ["displayName"]) !== void 0) {
49290
- throw new Error("displayName parameter is not supported in Gemini API.");
49307
+ throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
49291
49308
  }
49292
49309
  const fromMimeType = getValueByPath(fromObject, ["mimeType"]);
49293
49310
  if (fromMimeType != null) {
@@ -49354,7 +49371,7 @@ var require_node4 = __commonJS({
49354
49371
  function fileDataToMldev(fromObject) {
49355
49372
  const toObject = {};
49356
49373
  if (getValueByPath(fromObject, ["displayName"]) !== void 0) {
49357
- throw new Error("displayName parameter is not supported in Gemini API.");
49374
+ throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
49358
49375
  }
49359
49376
  const fromFileUri = getValueByPath(fromObject, ["fileUri"]);
49360
49377
  if (fromFileUri != null) {
@@ -49381,10 +49398,10 @@ var require_node4 = __commonJS({
49381
49398
  setValueByPath(toObject, ["name"], fromName);
49382
49399
  }
49383
49400
  if (getValueByPath(fromObject, ["partialArgs"]) !== void 0) {
49384
- throw new Error("partialArgs parameter is not supported in Gemini API.");
49401
+ throw new Error("partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
49385
49402
  }
49386
49403
  if (getValueByPath(fromObject, ["willContinue"]) !== void 0) {
49387
- throw new Error("willContinue parameter is not supported in Gemini API.");
49404
+ throw new Error("willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
49388
49405
  }
49389
49406
  return toObject;
49390
49407
  }
@@ -49407,10 +49424,10 @@ var require_node4 = __commonJS({
49407
49424
  setValueByPath(toObject, ["searchTypes"], fromSearchTypes);
49408
49425
  }
49409
49426
  if (getValueByPath(fromObject, ["blockingConfidence"]) !== void 0) {
49410
- throw new Error("blockingConfidence parameter is not supported in Gemini API.");
49427
+ throw new Error("blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
49411
49428
  }
49412
49429
  if (getValueByPath(fromObject, ["excludeDomains"]) !== void 0) {
49413
- throw new Error("excludeDomains parameter is not supported in Gemini API.");
49430
+ throw new Error("excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
49414
49431
  }
49415
49432
  const fromTimeRangeFilter = getValueByPath(fromObject, [
49416
49433
  "timeRangeFilter"
@@ -49529,7 +49546,7 @@ var require_node4 = __commonJS({
49529
49546
  setValueByPath(parentObject, ["setup", "proactivity"], fromProactivity);
49530
49547
  }
49531
49548
  if (getValueByPath(fromObject, ["explicitVadSignal"]) !== void 0) {
49532
- throw new Error("explicitVadSignal parameter is not supported in Gemini API.");
49549
+ throw new Error("explicitVadSignal parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
49533
49550
  }
49534
49551
  const fromAvatarConfig = getValueByPath(fromObject, ["avatarConfig"]);
49535
49552
  if (parentObject !== void 0 && fromAvatarConfig != null) {
@@ -49547,6 +49564,12 @@ var require_node4 = __commonJS({
49547
49564
  }
49548
49565
  setValueByPath(parentObject, ["setup", "safetySettings"], transformedList);
49549
49566
  }
49567
+ const fromStreamTranslationConfig = getValueByPath(fromObject, [
49568
+ "streamTranslationConfig"
49569
+ ]);
49570
+ if (parentObject !== void 0 && fromStreamTranslationConfig != null) {
49571
+ setValueByPath(parentObject, ["setup", "generationConfig", "streamTranslationConfig"], fromStreamTranslationConfig);
49572
+ }
49550
49573
  return toObject;
49551
49574
  }
49552
49575
  function liveConnectConstraintsToMldev(apiClient, fromObject) {
@@ -49640,7 +49663,7 @@ var require_node4 = __commonJS({
49640
49663
  setValueByPath(toObject, ["category"], fromCategory);
49641
49664
  }
49642
49665
  if (getValueByPath(fromObject, ["method"]) !== void 0) {
49643
- throw new Error("method parameter is not supported in Gemini API.");
49666
+ throw new Error("method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
49644
49667
  }
49645
49668
  const fromThreshold = getValueByPath(fromObject, ["threshold"]);
49646
49669
  if (fromThreshold != null) {
@@ -49655,14 +49678,14 @@ var require_node4 = __commonJS({
49655
49678
  setValueByPath(toObject, ["handle"], fromHandle);
49656
49679
  }
49657
49680
  if (getValueByPath(fromObject, ["transparent"]) !== void 0) {
49658
- throw new Error("transparent parameter is not supported in Gemini API.");
49681
+ throw new Error("transparent parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
49659
49682
  }
49660
49683
  return toObject;
49661
49684
  }
49662
49685
  function toolToMldev(fromObject) {
49663
49686
  const toObject = {};
49664
49687
  if (getValueByPath(fromObject, ["retrieval"]) !== void 0) {
49665
- throw new Error("retrieval parameter is not supported in Gemini API.");
49688
+ throw new Error("retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
49666
49689
  }
49667
49690
  const fromComputerUse = getValueByPath(fromObject, ["computerUse"]);
49668
49691
  if (fromComputerUse != null) {
@@ -49687,7 +49710,7 @@ var require_node4 = __commonJS({
49687
49710
  setValueByPath(toObject, ["codeExecution"], fromCodeExecution);
49688
49711
  }
49689
49712
  if (getValueByPath(fromObject, ["enterpriseWebSearch"]) !== void 0) {
49690
- throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");
49713
+ throw new Error("enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
49691
49714
  }
49692
49715
  const fromFunctionDeclarations = getValueByPath(fromObject, [
49693
49716
  "functionDeclarations"
@@ -49708,7 +49731,7 @@ var require_node4 = __commonJS({
49708
49731
  setValueByPath(toObject, ["googleSearchRetrieval"], fromGoogleSearchRetrieval);
49709
49732
  }
49710
49733
  if (getValueByPath(fromObject, ["parallelAiSearch"]) !== void 0) {
49711
- throw new Error("parallelAiSearch parameter is not supported in Gemini API.");
49734
+ throw new Error("parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
49712
49735
  }
49713
49736
  const fromUrlContext = getValueByPath(fromObject, ["urlContext"]);
49714
49737
  if (fromUrlContext != null) {
@@ -50500,7 +50523,9 @@ var require_node4 = __commonJS({
50500
50523
  };
50501
50524
  var APIConnectionTimeoutError = class extends APIConnectionError {
50502
50525
  constructor({ message } = {}) {
50503
- super({ message: message !== null && message !== void 0 ? message : "Request timed out." });
50526
+ super({
50527
+ message: message !== null && message !== void 0 ? message : "Request timed out. This is a client-side timeout. You can increase the timeout by setting the `timeout` argument in your request or client http options."
50528
+ });
50504
50529
  }
50505
50530
  };
50506
50531
  var BadRequestError = class extends APIError {
@@ -50790,109 +50815,38 @@ ${underline}`);
50790
50815
  return path4;
50791
50816
  });
50792
50817
  var path2 = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
50793
- var BaseInteractions = class extends APIResource {
50794
- create(params, options) {
50795
- var _a2;
50796
- const { api_version = this._client.apiVersion } = params, body = __rest(params, ["api_version"]);
50797
- if ("model" in body && "agent_config" in body) {
50798
- throw new GeminiNextGenAPIClientError(`Invalid request: specified \`model\` and \`agent_config\`. If specifying \`model\`, use \`generation_config\`.`);
50799
- }
50800
- if ("agent" in body && "generation_config" in body) {
50801
- throw new GeminiNextGenAPIClientError(`Invalid request: specified \`agent\` and \`generation_config\`. If specifying \`agent\`, use \`agent_config\`.`);
50802
- }
50803
- return this._client.post(path2`/${api_version}/interactions`, Object.assign(Object.assign({ body }, options), { stream: (_a2 = params.stream) !== null && _a2 !== void 0 ? _a2 : false }));
50804
- }
50805
- /**
50806
- * Deletes the interaction by id.
50807
- *
50808
- * @example
50809
- * ```ts
50810
- * const interaction = await client.interactions.delete('id', {
50811
- * api_version: 'api_version',
50812
- * });
50813
- * ```
50814
- */
50815
- delete(id, params = {}, options) {
50816
- const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
50817
- return this._client.delete(path2`/${api_version}/interactions/${id}`, options);
50818
- }
50819
- /**
50820
- * Cancels an interaction by id. This only applies to background interactions that
50821
- * are still running.
50822
- *
50823
- * @example
50824
- * ```ts
50825
- * const interaction = await client.interactions.cancel('id', {
50826
- * api_version: 'api_version',
50827
- * });
50828
- * ```
50829
- */
50830
- cancel(id, params = {}, options) {
50831
- const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
50832
- return this._client.post(path2`/${api_version}/interactions/${id}/cancel`, options);
50833
- }
50834
- get(id, params = {}, options) {
50835
- var _a2;
50836
- const _b = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _b, query = __rest(_b, ["api_version"]);
50837
- return this._client.get(path2`/${api_version}/interactions/${id}`, Object.assign(Object.assign({ query }, options), { stream: (_a2 = params === null || params === void 0 ? void 0 : params.stream) !== null && _a2 !== void 0 ? _a2 : false }));
50838
- }
50839
- };
50840
- BaseInteractions._key = Object.freeze(["interactions"]);
50841
- var Interactions = class extends BaseInteractions {
50842
- };
50843
- var BaseWebhooks = class extends APIResource {
50844
- /**
50845
- * Creates a new Webhook.
50846
- */
50847
- create(params, options) {
50848
- const { api_version = this._client.apiVersion } = params, body = __rest(params, ["api_version"]);
50849
- return this._client.post(path2`/${api_version}/webhooks`, Object.assign({ body }, options));
50850
- }
50818
+ var BaseAgents = class extends APIResource {
50851
50819
  /**
50852
- * Updates an existing Webhook.
50820
+ * Creates a new Agent (Typed version for SDK).
50853
50821
  */
50854
- update(id, params = {}, options) {
50855
- const _a2 = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion, update_mask } = _a2, body = __rest(_a2, ["api_version", "update_mask"]);
50856
- return this._client.patch(path2`/${api_version}/webhooks/${id}`, Object.assign({ query: { update_mask }, body }, options));
50822
+ create(params = {}, options) {
50823
+ const _a2 = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _a2, body = __rest(_a2, ["api_version"]);
50824
+ return this._client.post(path2`/${api_version}/agents`, Object.assign({ body }, options));
50857
50825
  }
50858
50826
  /**
50859
- * Lists all Webhooks.
50827
+ * Lists all Agents.
50860
50828
  */
50861
50829
  list(params = {}, options) {
50862
50830
  const _a2 = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _a2, query = __rest(_a2, ["api_version"]);
50863
- return this._client.get(path2`/${api_version}/webhooks`, Object.assign({ query }, options));
50831
+ return this._client.get(path2`/${api_version}/agents`, Object.assign({ query }, options));
50864
50832
  }
50865
50833
  /**
50866
- * Deletes a Webhook.
50834
+ * Deletes an Agent.
50867
50835
  */
50868
50836
  delete(id, params = {}, options) {
50869
50837
  const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
50870
- return this._client.delete(path2`/${api_version}/webhooks/${id}`, options);
50838
+ return this._client.delete(path2`/${api_version}/agents/${id}`, options);
50871
50839
  }
50872
50840
  /**
50873
- * Gets a specific Webhook.
50841
+ * Gets a specific Agent.
50874
50842
  */
50875
50843
  get(id, params = {}, options) {
50876
50844
  const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
50877
- return this._client.get(path2`/${api_version}/webhooks/${id}`, options);
50878
- }
50879
- /**
50880
- * Sends a ping event to a Webhook.
50881
- */
50882
- ping(id, params = void 0, options) {
50883
- const { api_version = this._client.apiVersion, body } = params !== null && params !== void 0 ? params : {};
50884
- return this._client.post(path2`/${api_version}/webhooks/${id}:ping`, Object.assign({ body }, options));
50885
- }
50886
- /**
50887
- * Generates a new signing secret for a Webhook.
50888
- */
50889
- rotateSigningSecret(id, params = {}, options) {
50890
- const _a2 = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _a2, body = __rest(_a2, ["api_version"]);
50891
- return this._client.post(path2`/${api_version}/webhooks/${id}:rotateSigningSecret`, Object.assign({ body }, options));
50845
+ return this._client.get(path2`/${api_version}/agents/${id}`, options);
50892
50846
  }
50893
50847
  };
50894
- BaseWebhooks._key = Object.freeze(["webhooks"]);
50895
- var Webhooks = class extends BaseWebhooks {
50848
+ BaseAgents._key = Object.freeze(["agents"]);
50849
+ var Agents = class extends BaseAgents {
50896
50850
  };
50897
50851
  function concatBytes(buffers) {
50898
50852
  let length = 0;
@@ -51359,6 +51313,267 @@ ${underline}`);
51359
51313
  }
51360
51314
  return [str, "", ""];
51361
51315
  }
51316
+ var LEGACY_LYRIA_MODELS = /* @__PURE__ */ new Set([
51317
+ "lyria-3-pro-preview",
51318
+ "lyria-3-clip-preview"
51319
+ ]);
51320
+ var LEGACY_EVENT_TYPE_RENAMES = {
51321
+ "interaction.start": "interaction.created",
51322
+ "content.start": "step.start",
51323
+ "content.delta": "step.delta",
51324
+ "content.stop": "step.stop",
51325
+ "interaction.complete": "interaction.completed"
51326
+ };
51327
+ function isLegacyLyriaRequest({ isVertex, model }) {
51328
+ return Boolean(isVertex) && typeof model === "string" && LEGACY_LYRIA_MODELS.has(model);
51329
+ }
51330
+ function isVertexClient(client) {
51331
+ const adapter = client.clientAdapter;
51332
+ return Boolean(adapter && adapter.isVertexAI());
51333
+ }
51334
+ function isPlainObject(value) {
51335
+ return typeof value === "object" && value !== null && !Array.isArray(value);
51336
+ }
51337
+ function wrapOutputsAsSteps(data) {
51338
+ if (!("outputs" in data) || "steps" in data) {
51339
+ return data;
51340
+ }
51341
+ const { outputs } = data, rest = __rest(data, ["outputs"]);
51342
+ return Object.assign(Object.assign({}, rest), { steps: [{ type: "model_output", content: outputs }] });
51343
+ }
51344
+ function coerceLegacyInteractionResponse(data) {
51345
+ if (!isPlainObject(data))
51346
+ return data;
51347
+ return wrapOutputsAsSteps(data);
51348
+ }
51349
+ function maybeRemapLegacyStreamEvent(data) {
51350
+ if (!isPlainObject(data))
51351
+ return data;
51352
+ const eventType = data["event_type"];
51353
+ if (typeof eventType !== "string" || !(eventType in LEGACY_EVENT_TYPE_RENAMES)) {
51354
+ return data;
51355
+ }
51356
+ const renamed = Object.assign(Object.assign({}, data), { event_type: LEGACY_EVENT_TYPE_RENAMES[eventType] });
51357
+ if (eventType === "content.start") {
51358
+ const { content } = renamed, rest = __rest(renamed, ["content"]);
51359
+ let stepContent;
51360
+ if (content == null) {
51361
+ stepContent = [];
51362
+ } else if (Array.isArray(content)) {
51363
+ stepContent = content;
51364
+ } else {
51365
+ stepContent = [content];
51366
+ }
51367
+ return Object.assign(Object.assign({}, rest), { step: { type: "model_output", content: stepContent } });
51368
+ }
51369
+ if (eventType === "interaction.start" || eventType === "interaction.complete") {
51370
+ const inner = renamed["interaction"];
51371
+ if (isPlainObject(inner)) {
51372
+ renamed["interaction"] = wrapOutputsAsSteps(inner);
51373
+ }
51374
+ }
51375
+ return renamed;
51376
+ }
51377
+ var LegacyLyriaStream = class _LegacyLyriaStream extends Stream3 {
51378
+ static fromSSEResponse(response, controller, client) {
51379
+ const base = Stream3.fromSSEResponse(response, controller, client);
51380
+ function wrappedIterator() {
51381
+ return __asyncGenerator(this, arguments, function* wrappedIterator_1() {
51382
+ var _a2, e_1, _b, _c;
51383
+ try {
51384
+ for (var _d = true, base_1 = __asyncValues(base), base_1_1; base_1_1 = yield __await(base_1.next()), _a2 = base_1_1.done, !_a2; _d = true) {
51385
+ _c = base_1_1.value;
51386
+ _d = false;
51387
+ const item = _c;
51388
+ yield yield __await(maybeRemapLegacyStreamEvent(item));
51389
+ }
51390
+ } catch (e_1_1) {
51391
+ e_1 = { error: e_1_1 };
51392
+ } finally {
51393
+ try {
51394
+ if (!_d && !_a2 && (_b = base_1.return)) yield __await(_b.call(base_1));
51395
+ } finally {
51396
+ if (e_1) throw e_1.error;
51397
+ }
51398
+ }
51399
+ });
51400
+ }
51401
+ return new _LegacyLyriaStream(wrappedIterator, controller, client);
51402
+ }
51403
+ };
51404
+ var BaseInteractions = class extends APIResource {
51405
+ create(params, options) {
51406
+ var _a2;
51407
+ const { api_version = this._client.apiVersion } = params, body = __rest(params, ["api_version"]);
51408
+ if ("model" in body && "agent_config" in body) {
51409
+ throw new GeminiNextGenAPIClientError(`Invalid request: specified \`model\` and \`agent_config\`. If specifying \`model\`, use \`generation_config\`.`);
51410
+ }
51411
+ if ("agent" in body && "generation_config" in body) {
51412
+ throw new GeminiNextGenAPIClientError(`Invalid request: specified \`agent\` and \`generation_config\`. If specifying \`agent\`, use \`agent_config\`.`);
51413
+ }
51414
+ const needsLegacyLyriaShim = isLegacyLyriaRequest({
51415
+ isVertex: isVertexClient(this._client),
51416
+ model: "model" in body ? body.model : void 0
51417
+ });
51418
+ const isStreaming = (_a2 = params.stream) !== null && _a2 !== void 0 ? _a2 : false;
51419
+ const promise = this._client.post(path2`/${api_version}/interactions`, Object.assign(Object.assign(Object.assign({ body }, options), { stream: isStreaming }), needsLegacyLyriaShim && isStreaming ? { __streamClass: LegacyLyriaStream } : {}));
51420
+ if (isStreaming) {
51421
+ return promise;
51422
+ }
51423
+ let nonStreaming = promise;
51424
+ if (needsLegacyLyriaShim) {
51425
+ nonStreaming = nonStreaming._thenUnwrap((data) => coerceLegacyInteractionResponse(data));
51426
+ }
51427
+ return nonStreaming._thenUnwrap(addOutputProperties);
51428
+ }
51429
+ /**
51430
+ * Deletes the interaction by id.
51431
+ *
51432
+ * @example
51433
+ * ```ts
51434
+ * const interaction = await client.interactions.delete('id', {
51435
+ * api_version: 'api_version',
51436
+ * });
51437
+ * ```
51438
+ */
51439
+ delete(id, params = {}, options) {
51440
+ const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
51441
+ return this._client.delete(path2`/${api_version}/interactions/${id}`, options);
51442
+ }
51443
+ /**
51444
+ * Cancels an interaction by id. This only applies to background interactions that
51445
+ * are still running.
51446
+ *
51447
+ * @example
51448
+ * ```ts
51449
+ * const interaction = await client.interactions.cancel('id', {
51450
+ * api_version: 'api_version',
51451
+ * });
51452
+ * ```
51453
+ */
51454
+ cancel(id, params = {}, options) {
51455
+ const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
51456
+ return this._client.post(path2`/${api_version}/interactions/${id}/cancel`, options)._thenUnwrap(addOutputProperties);
51457
+ }
51458
+ get(id, params = {}, options) {
51459
+ var _a2;
51460
+ const _b = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _b, query = __rest(_b, ["api_version"]);
51461
+ const response = this._client.get(path2`/${api_version}/interactions/${id}`, Object.assign(Object.assign({ query }, options), { stream: (_a2 = params === null || params === void 0 ? void 0 : params.stream) !== null && _a2 !== void 0 ? _a2 : false }));
51462
+ if (params === null || params === void 0 ? void 0 : params.stream) {
51463
+ return response;
51464
+ }
51465
+ return response._thenUnwrap(addOutputProperties);
51466
+ }
51467
+ };
51468
+ BaseInteractions._key = Object.freeze(["interactions"]);
51469
+ var Interactions = class extends BaseInteractions {
51470
+ };
51471
+ function addOutputProperties(interaction) {
51472
+ var _a2, _b;
51473
+ const steps = (_a2 = interaction.steps) !== null && _a2 !== void 0 ? _a2 : [];
51474
+ const textParts = [];
51475
+ let collecting = false;
51476
+ outer: for (let i2 = steps.length - 1; i2 >= 0; i2--) {
51477
+ const step = steps[i2];
51478
+ if (step.type === "user_input")
51479
+ break;
51480
+ if (step.type !== "model_output" || !step.content) {
51481
+ if (collecting)
51482
+ break outer;
51483
+ continue;
51484
+ }
51485
+ const content = step.content;
51486
+ for (let j = content.length - 1; j >= 0; j--) {
51487
+ const item = content[j];
51488
+ if (item.type === "text") {
51489
+ collecting = true;
51490
+ textParts.push((_b = item.text) !== null && _b !== void 0 ? _b : "");
51491
+ } else if (collecting) {
51492
+ break outer;
51493
+ }
51494
+ }
51495
+ }
51496
+ const output_text = textParts.reverse().join("");
51497
+ let output_image;
51498
+ let output_audio;
51499
+ let output_video;
51500
+ for (let i2 = steps.length - 1; i2 >= 0; i2--) {
51501
+ const step = steps[i2];
51502
+ const anyStep = step;
51503
+ if (anyStep.type === "user_input") {
51504
+ break;
51505
+ }
51506
+ if (anyStep.type === "model_output" && anyStep.content) {
51507
+ for (let j = anyStep.content.length - 1; j >= 0; j--) {
51508
+ const content = anyStep.content[j];
51509
+ if (content.type === "image" && !output_image) {
51510
+ output_image = content;
51511
+ }
51512
+ if (content.type === "audio" && !output_audio) {
51513
+ output_audio = content;
51514
+ }
51515
+ if (content.type === "video" && !output_video) {
51516
+ output_video = content;
51517
+ }
51518
+ }
51519
+ }
51520
+ }
51521
+ return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, interaction), output_text && { output_text }), output_image && { output_image }), output_audio && { output_audio }), output_video && { output_video });
51522
+ }
51523
+ var BaseWebhooks = class extends APIResource {
51524
+ /**
51525
+ * Creates a new Webhook.
51526
+ */
51527
+ create(params, options) {
51528
+ const { api_version = this._client.apiVersion } = params, body = __rest(params, ["api_version"]);
51529
+ return this._client.post(path2`/${api_version}/webhooks`, Object.assign({ body }, options));
51530
+ }
51531
+ /**
51532
+ * Updates an existing Webhook.
51533
+ */
51534
+ update(id, params = {}, options) {
51535
+ const _a2 = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion, update_mask } = _a2, body = __rest(_a2, ["api_version", "update_mask"]);
51536
+ return this._client.patch(path2`/${api_version}/webhooks/${id}`, Object.assign({ query: { update_mask }, body }, options));
51537
+ }
51538
+ /**
51539
+ * Lists all Webhooks.
51540
+ */
51541
+ list(params = {}, options) {
51542
+ const _a2 = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _a2, query = __rest(_a2, ["api_version"]);
51543
+ return this._client.get(path2`/${api_version}/webhooks`, Object.assign({ query }, options));
51544
+ }
51545
+ /**
51546
+ * Deletes a Webhook.
51547
+ */
51548
+ delete(id, params = {}, options) {
51549
+ const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
51550
+ return this._client.delete(path2`/${api_version}/webhooks/${id}`, options);
51551
+ }
51552
+ /**
51553
+ * Gets a specific Webhook.
51554
+ */
51555
+ get(id, params = {}, options) {
51556
+ const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
51557
+ return this._client.get(path2`/${api_version}/webhooks/${id}`, options);
51558
+ }
51559
+ /**
51560
+ * Sends a ping event to a Webhook.
51561
+ */
51562
+ ping(id, params = void 0, options) {
51563
+ const { api_version = this._client.apiVersion, body } = params !== null && params !== void 0 ? params : {};
51564
+ return this._client.post(path2`/${api_version}/webhooks/${id}:ping`, Object.assign({ body }, options));
51565
+ }
51566
+ /**
51567
+ * Generates a new signing secret for a Webhook.
51568
+ */
51569
+ rotateSigningSecret(id, params = {}, options) {
51570
+ const _a2 = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _a2, body = __rest(_a2, ["api_version"]);
51571
+ return this._client.post(path2`/${api_version}/webhooks/${id}:rotateSigningSecret`, Object.assign({ body }, options));
51572
+ }
51573
+ };
51574
+ BaseWebhooks._key = Object.freeze(["webhooks"]);
51575
+ var Webhooks = class extends BaseWebhooks {
51576
+ };
51362
51577
  async function defaultParseResponse(client, props) {
51363
51578
  const { response, requestLogID, retryOfRequestLogID, startTime } = props;
51364
51579
  const body = await (async () => {
@@ -51906,6 +52121,7 @@ ${underline}`);
51906
52121
  super(...arguments);
51907
52122
  this.interactions = new Interactions(this);
51908
52123
  this.webhooks = new Webhooks(this);
52124
+ this.agents = new Agents(this);
51909
52125
  }
51910
52126
  };
51911
52127
  _a = GeminiNextGenAPIClient;
@@ -51926,6 +52142,7 @@ ${underline}`);
51926
52142
  GeminiNextGenAPIClient.toFile = toFile;
51927
52143
  GeminiNextGenAPIClient.Interactions = Interactions;
51928
52144
  GeminiNextGenAPIClient.Webhooks = Webhooks;
52145
+ GeminiNextGenAPIClient.Agents = Agents;
51929
52146
  var GOOGLE_API_KEY_HEADER = "x-goog-api-key";
51930
52147
  var REQUIRED_VERTEX_AI_SCOPE = "https://www.googleapis.com/auth/cloud-platform";
51931
52148
  var NodeAuth = class {
@@ -52109,7 +52326,7 @@ ${underline}`);
52109
52326
  function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
52110
52327
  const toObject = {};
52111
52328
  if (getValueByPath(fromObject, ["validationDataset"]) !== void 0) {
52112
- throw new Error("validationDataset parameter is not supported in Gemini API.");
52329
+ throw new Error("validationDataset parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
52113
52330
  }
52114
52331
  const fromTunedModelDisplayName = getValueByPath(fromObject, [
52115
52332
  "tunedModelDisplayName"
@@ -52118,7 +52335,7 @@ ${underline}`);
52118
52335
  setValueByPath(parentObject, ["displayName"], fromTunedModelDisplayName);
52119
52336
  }
52120
52337
  if (getValueByPath(fromObject, ["description"]) !== void 0) {
52121
- throw new Error("description parameter is not supported in Gemini API.");
52338
+ throw new Error("description parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
52122
52339
  }
52123
52340
  const fromEpochCount = getValueByPath(fromObject, ["epochCount"]);
52124
52341
  if (parentObject !== void 0 && fromEpochCount != null) {
@@ -52131,19 +52348,19 @@ ${underline}`);
52131
52348
  setValueByPath(toObject, ["tuningTask", "hyperparameters", "learningRateMultiplier"], fromLearningRateMultiplier);
52132
52349
  }
52133
52350
  if (getValueByPath(fromObject, ["exportLastCheckpointOnly"]) !== void 0) {
52134
- throw new Error("exportLastCheckpointOnly parameter is not supported in Gemini API.");
52351
+ throw new Error("exportLastCheckpointOnly parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
52135
52352
  }
52136
52353
  if (getValueByPath(fromObject, ["preTunedModelCheckpointId"]) !== void 0) {
52137
- throw new Error("preTunedModelCheckpointId parameter is not supported in Gemini API.");
52354
+ throw new Error("preTunedModelCheckpointId parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
52138
52355
  }
52139
52356
  if (getValueByPath(fromObject, ["adapterSize"]) !== void 0) {
52140
- throw new Error("adapterSize parameter is not supported in Gemini API.");
52357
+ throw new Error("adapterSize parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
52141
52358
  }
52142
52359
  if (getValueByPath(fromObject, ["tuningMode"]) !== void 0) {
52143
- throw new Error("tuningMode parameter is not supported in Gemini API.");
52360
+ throw new Error("tuningMode parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
52144
52361
  }
52145
52362
  if (getValueByPath(fromObject, ["customBaseModel"]) !== void 0) {
52146
- throw new Error("customBaseModel parameter is not supported in Gemini API.");
52363
+ throw new Error("customBaseModel parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
52147
52364
  }
52148
52365
  const fromBatchSize = getValueByPath(fromObject, ["batchSize"]);
52149
52366
  if (parentObject !== void 0 && fromBatchSize != null) {
@@ -52154,25 +52371,25 @@ ${underline}`);
52154
52371
  setValueByPath(parentObject, ["tuningTask", "hyperparameters", "learningRate"], fromLearningRate);
52155
52372
  }
52156
52373
  if (getValueByPath(fromObject, ["labels"]) !== void 0) {
52157
- throw new Error("labels parameter is not supported in Gemini API.");
52374
+ throw new Error("labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
52158
52375
  }
52159
52376
  if (getValueByPath(fromObject, ["beta"]) !== void 0) {
52160
- throw new Error("beta parameter is not supported in Gemini API.");
52377
+ throw new Error("beta parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
52161
52378
  }
52162
52379
  if (getValueByPath(fromObject, ["baseTeacherModel"]) !== void 0) {
52163
- throw new Error("baseTeacherModel parameter is not supported in Gemini API.");
52380
+ throw new Error("baseTeacherModel parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
52164
52381
  }
52165
52382
  if (getValueByPath(fromObject, ["tunedTeacherModelSource"]) !== void 0) {
52166
- throw new Error("tunedTeacherModelSource parameter is not supported in Gemini API.");
52383
+ throw new Error("tunedTeacherModelSource parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
52167
52384
  }
52168
52385
  if (getValueByPath(fromObject, ["sftLossWeightMultiplier"]) !== void 0) {
52169
- throw new Error("sftLossWeightMultiplier parameter is not supported in Gemini API.");
52386
+ throw new Error("sftLossWeightMultiplier parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
52170
52387
  }
52171
52388
  if (getValueByPath(fromObject, ["outputUri"]) !== void 0) {
52172
- throw new Error("outputUri parameter is not supported in Gemini API.");
52389
+ throw new Error("outputUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
52173
52390
  }
52174
52391
  if (getValueByPath(fromObject, ["encryptionSpec"]) !== void 0) {
52175
- throw new Error("encryptionSpec parameter is not supported in Gemini API.");
52392
+ throw new Error("encryptionSpec parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
52176
52393
  }
52177
52394
  return toObject;
52178
52395
  }
@@ -52553,10 +52770,10 @@ ${underline}`);
52553
52770
  function tuningDatasetToMldev(fromObject, _rootObject) {
52554
52771
  const toObject = {};
52555
52772
  if (getValueByPath(fromObject, ["gcsUri"]) !== void 0) {
52556
- throw new Error("gcsUri parameter is not supported in Gemini API.");
52773
+ throw new Error("gcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
52557
52774
  }
52558
52775
  if (getValueByPath(fromObject, ["vertexDatasetResource"]) !== void 0) {
52559
- throw new Error("vertexDatasetResource parameter is not supported in Gemini API.");
52776
+ throw new Error("vertexDatasetResource parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");
52560
52777
  }
52561
52778
  const fromExamples = getValueByPath(fromObject, ["examples"]);
52562
52779
  if (fromExamples != null) {
@@ -52625,7 +52842,7 @@ ${underline}`);
52625
52842
  }
52626
52843
  }
52627
52844
  if (getValueByPath(fromObject, ["examples"]) !== void 0) {
52628
- throw new Error("examples parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
52845
+ throw new Error("examples parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");
52629
52846
  }
52630
52847
  return toObject;
52631
52848
  }
@@ -53289,8 +53506,8 @@ ${underline}`);
53289
53506
  * @param filePath The path to the file.
53290
53507
  * @returns The MIME type of the file, or undefined if it cannot be inferred.
53291
53508
  */
53292
- inferMimeType(filePath2) {
53293
- const fileExtension = filePath2.slice(filePath2.lastIndexOf(".") + 1);
53509
+ inferMimeType(filePath) {
53510
+ const fileExtension = filePath.slice(filePath.lastIndexOf(".") + 1);
53294
53511
  const mimeTypes = {
53295
53512
  "aac": "audio/aac",
53296
53513
  "abw": "application/x-abiword",
@@ -53537,6 +53754,7 @@ ${underline}`);
53537
53754
  if (this._interactions !== void 0) {
53538
53755
  return this._interactions;
53539
53756
  }
53757
+ console.warn("GoogleGenAI.interactions: Interactions usage is experimental and may change in future versions.");
53540
53758
  this._interactions = this.getNextGenClient().interactions;
53541
53759
  return this._interactions;
53542
53760
  }
@@ -53547,6 +53765,14 @@ ${underline}`);
53547
53765
  this._webhooks = this.getNextGenClient().webhooks;
53548
53766
  return this._webhooks;
53549
53767
  }
53768
+ get agents() {
53769
+ if (this._agents !== void 0) {
53770
+ return this._agents;
53771
+ }
53772
+ console.warn("GoogleGenAI.agents: Agents usage is experimental and may change in future versions.");
53773
+ this._agents = this.getNextGenClient().agents;
53774
+ return this._agents;
53775
+ }
53550
53776
  constructor(options) {
53551
53777
  var _a2, _b, _c, _d;
53552
53778
  if ((options.project || options.location) && options.apiKey) {
@@ -53723,8 +53949,47 @@ ${underline}`);
53723
53949
  var require_ai_runtime = __commonJS({
53724
53950
  "dist/ai-runtime.js"(exports2) {
53725
53951
  "use strict";
53952
+ var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m2, k, k2) {
53953
+ if (k2 === void 0) k2 = k;
53954
+ var desc = Object.getOwnPropertyDescriptor(m2, k);
53955
+ if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
53956
+ desc = { enumerable: true, get: function() {
53957
+ return m2[k];
53958
+ } };
53959
+ }
53960
+ Object.defineProperty(o, k2, desc);
53961
+ }) : (function(o, m2, k, k2) {
53962
+ if (k2 === void 0) k2 = k;
53963
+ o[k2] = m2[k];
53964
+ }));
53965
+ var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
53966
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
53967
+ }) : function(o, v) {
53968
+ o["default"] = v;
53969
+ });
53970
+ var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
53971
+ var ownKeys = function(o) {
53972
+ ownKeys = Object.getOwnPropertyNames || function(o2) {
53973
+ var ar = [];
53974
+ for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
53975
+ return ar;
53976
+ };
53977
+ return ownKeys(o);
53978
+ };
53979
+ return function(mod) {
53980
+ if (mod && mod.__esModule) return mod;
53981
+ var result = {};
53982
+ if (mod != null) {
53983
+ for (var k = ownKeys(mod), i2 = 0; i2 < k.length; i2++) if (k[i2] !== "default") __createBinding(result, mod, k[i2]);
53984
+ }
53985
+ __setModuleDefault(result, mod);
53986
+ return result;
53987
+ };
53988
+ })();
53726
53989
  Object.defineProperty(exports2, "__esModule", { value: true });
53727
53990
  exports2.aiRuntime = exports2.AIRuntime = void 0;
53991
+ var fs3 = __importStar(require("fs"));
53992
+ var path2 = __importStar(require("path"));
53728
53993
  var AIRuntime = class {
53729
53994
  constructor() {
53730
53995
  this._client = null;
@@ -53741,13 +54006,97 @@ var require_ai_runtime = __commonJS({
53741
54006
  }
53742
54007
  return this._client;
53743
54008
  }
54009
+ getCacheFile() {
54010
+ return path2.resolve(process.cwd(), ".sesi_cache.json");
54011
+ }
54012
+ readCache() {
54013
+ const file = this.getCacheFile();
54014
+ if (fs3.existsSync(file)) {
54015
+ try {
54016
+ return JSON.parse(fs3.readFileSync(file, "utf-8"));
54017
+ } catch (e2) {
54018
+ return {};
54019
+ }
54020
+ }
54021
+ return {};
54022
+ }
54023
+ writeCache(cache) {
54024
+ const file = this.getCacheFile();
54025
+ try {
54026
+ fs3.writeFileSync(file, JSON.stringify(cache, null, 2), "utf-8");
54027
+ } catch (e2) {
54028
+ }
54029
+ }
54030
+ computeCacheHash(request) {
54031
+ const crypto2 = require("crypto");
54032
+ const hash = crypto2.createHash("sha256");
54033
+ const input = {
54034
+ model: request.model,
54035
+ prompt: request.prompt,
54036
+ temperature: request.temperature,
54037
+ maxTokens: request.maxTokens,
54038
+ topK: request.topK,
54039
+ topP: request.topP,
54040
+ ratio: request.ratio,
54041
+ size: request.size,
54042
+ images: request.images,
54043
+ thinkingLevel: request.thinkingLevel
54044
+ };
54045
+ hash.update(JSON.stringify(input));
54046
+ return hash.digest("hex");
54047
+ }
54048
+ resolveImageParts(imagePaths) {
54049
+ const mimeMap = {
54050
+ ".jpg": "image/jpeg",
54051
+ ".jpeg": "image/jpeg",
54052
+ ".png": "image/png",
54053
+ ".gif": "image/gif",
54054
+ ".webp": "image/webp",
54055
+ ".bmp": "image/bmp"
54056
+ };
54057
+ const parts = [];
54058
+ for (const imgPath of imagePaths) {
54059
+ const abs = path2.isAbsolute(imgPath) ? imgPath : path2.resolve(process.cwd(), imgPath);
54060
+ const ext = path2.extname(abs).toLowerCase();
54061
+ const mimeType = mimeMap[ext] ?? "image/jpeg";
54062
+ const data = fs3.readFileSync(abs).toString("base64");
54063
+ parts.push({ inlineData: { mimeType, data } });
54064
+ }
54065
+ return parts;
54066
+ }
53744
54067
  async callModel(request) {
54068
+ const useCache = request.cache !== false;
54069
+ let cacheHash = "";
54070
+ if (useCache) {
54071
+ cacheHash = this.computeCacheHash(request);
54072
+ const cache = this.readCache();
54073
+ if (cache[cacheHash]) {
54074
+ console.log("\u26A1 [Sesi Logic Cache] Served from local cache");
54075
+ return cache[cacheHash];
54076
+ }
54077
+ }
53745
54078
  try {
53746
54079
  const client = this.client;
53747
54080
  const timeContext = `[System context: Current date and time is ${(/* @__PURE__ */ new Date()).toUTCString()}]
53748
54081
 
53749
54082
  `;
53750
54083
  const fullPrompt = timeContext + request.prompt;
54084
+ let thinkingConfig = void 0;
54085
+ if (request.thinkingLevel) {
54086
+ const thinking = request.thinkingLevel.thinking !== "no";
54087
+ const level = request.thinkingLevel.level || "low";
54088
+ const isGemini3 = request.model.includes("gemini-3");
54089
+ if (isGemini3) {
54090
+ const isPro = request.model.includes("pro");
54091
+ thinkingConfig = {
54092
+ thinkingLevel: thinking ? level : isPro ? "low" : "minimal"
54093
+ };
54094
+ } else {
54095
+ thinkingConfig = {
54096
+ thinkingBudget: thinking ? level === "low" ? 1024 : level === "medium" ? 2048 : 4096 : 0
54097
+ };
54098
+ }
54099
+ }
53751
54100
  if (request.model.includes("image")) {
53752
54101
  const imageConfig = {};
53753
54102
  if (request.ratio)
@@ -53768,9 +54117,11 @@ var require_ai_runtime = __commonJS({
53768
54117
  configObj.topK = request.topK;
53769
54118
  if (request.topP !== void 0)
53770
54119
  configObj.topP = request.topP;
54120
+ if (thinkingConfig)
54121
+ configObj.thinkingConfig = thinkingConfig;
53771
54122
  const response = await client.models.generateContent({
53772
54123
  model: request.model,
53773
- contents: request.prompt,
54124
+ contents: request.images && request.images.length > 0 ? [{ role: "user", parts: [...this.resolveImageParts(request.images), { text: request.prompt }] }] : request.prompt,
53774
54125
  config: configObj
53775
54126
  });
53776
54127
  let base64String = null;
@@ -53785,7 +54136,7 @@ var require_ai_runtime = __commonJS({
53785
54136
  if (!base64String) {
53786
54137
  throw new Error("Image generation failed or returned no image output.");
53787
54138
  }
53788
- return {
54139
+ const resObj2 = {
53789
54140
  text: base64String,
53790
54141
  // Return the base64 string directly
53791
54142
  finishReason: "STOP",
@@ -53794,6 +54145,12 @@ var require_ai_runtime = __commonJS({
53794
54145
  outputTokens: 0
53795
54146
  }
53796
54147
  };
54148
+ if (useCache) {
54149
+ const cache = this.readCache();
54150
+ cache[cacheHash] = resObj2;
54151
+ this.writeCache(cache);
54152
+ }
54153
+ return resObj2;
53797
54154
  }
53798
54155
  let accumulatedText = "";
53799
54156
  let currentFinishReason = "";
@@ -53802,9 +54159,12 @@ var require_ai_runtime = __commonJS({
53802
54159
  let totalOutputTokens = 0;
53803
54160
  let maxPolls = 10;
53804
54161
  let currentPoll = 0;
53805
- const contents = [
53806
- { role: "user", parts: [{ text: fullPrompt }] }
53807
- ];
54162
+ const contents = [];
54163
+ const imageParts = request.images && request.images.length > 0 ? this.resolveImageParts(request.images) : [];
54164
+ contents.push({
54165
+ role: "user",
54166
+ parts: [...imageParts, { text: fullPrompt }]
54167
+ });
53808
54168
  while (!isComplete && currentPoll < maxPolls) {
53809
54169
  const genConfig = {
53810
54170
  temperature: request.temperature ?? 0.3,
@@ -53815,6 +54175,9 @@ var require_ai_runtime = __commonJS({
53815
54175
  if (request.tools) {
53816
54176
  genConfig.tools = request.tools;
53817
54177
  }
54178
+ if (thinkingConfig) {
54179
+ genConfig.thinkingConfig = thinkingConfig;
54180
+ }
53818
54181
  const response = await client.models.generateContent({
53819
54182
  model: request.model,
53820
54183
  contents,
@@ -53826,7 +54189,7 @@ var require_ai_runtime = __commonJS({
53826
54189
  if (candidate?.content?.parts) {
53827
54190
  for (const part of candidate.content.parts) {
53828
54191
  if (part.call) {
53829
- return {
54192
+ const toolRes = {
53830
54193
  text: JSON.stringify(part.call),
53831
54194
  finishReason: "TOOL_CALL",
53832
54195
  usage: {
@@ -53834,6 +54197,7 @@ var require_ai_runtime = __commonJS({
53834
54197
  outputTokens: response.usageMetadata?.candidatesTokenCount ?? 0
53835
54198
  }
53836
54199
  };
54200
+ return toolRes;
53837
54201
  }
53838
54202
  }
53839
54203
  }
@@ -53865,7 +54229,7 @@ var require_ai_runtime = __commonJS({
53865
54229
  if (currentFinishReason !== "STOP" && currentFinishReason !== "MAX_TOKENS") {
53866
54230
  throw new Error(`Generation did not complete successfully (finish reason: ${currentFinishReason})`);
53867
54231
  }
53868
- return {
54232
+ const resObj = {
53869
54233
  text: accumulatedText,
53870
54234
  finishReason: currentFinishReason,
53871
54235
  usage: {
@@ -53873,6 +54237,12 @@ var require_ai_runtime = __commonJS({
53873
54237
  outputTokens: totalOutputTokens
53874
54238
  }
53875
54239
  };
54240
+ if (useCache) {
54241
+ const cache = this.readCache();
54242
+ cache[cacheHash] = resObj;
54243
+ this.writeCache(cache);
54244
+ }
54245
+ return resObj;
53876
54246
  } catch (error) {
53877
54247
  throw new Error(`Sesi: ${error.message}`);
53878
54248
  }
@@ -53940,13 +54310,14 @@ var require_interpreter = __commonJS({
53940
54310
  var types_1 = require_types2();
53941
54311
  var builtins_1 = require_builtins();
53942
54312
  var ai_runtime_1 = require_ai_runtime();
53943
- var Interpreter = class {
54313
+ var Interpreter = class _Interpreter {
53944
54314
  constructor() {
53945
54315
  this.prompts = /* @__PURE__ */ new Map();
53946
54316
  this.memory = /* @__PURE__ */ new Map();
54317
+ this.exports = /* @__PURE__ */ new Map();
53947
54318
  this.globalEnv = new types_1.Environment();
53948
54319
  this.currentEnv = this.globalEnv;
53949
- const builtins = (0, builtins_1.getBuiltins)();
54320
+ const builtins = (0, builtins_1.getBuiltins)(this);
53950
54321
  for (const [name, fn] of builtins) {
53951
54322
  this.globalEnv.define(name, fn);
53952
54323
  }
@@ -53995,10 +54366,10 @@ var require_interpreter = __commonJS({
53995
54366
  await this.executeMemory(statement);
53996
54367
  break;
53997
54368
  case "ImportStatement":
53998
- console.log("Import not yet implemented");
54369
+ await this.executeImport(statement);
53999
54370
  break;
54000
54371
  case "ExportStatement":
54001
- console.log("Export not yet implemented");
54372
+ await this.executeExport(statement);
54002
54373
  break;
54003
54374
  }
54004
54375
  }
@@ -54264,28 +54635,7 @@ var require_interpreter = __commonJS({
54264
54635
  for (const arg of expr.arguments) {
54265
54636
  args2.push(await this.evaluateExpression(arg));
54266
54637
  }
54267
- if (fn.isBuiltin && fn.builtin) {
54268
- return fn.builtin(...args2);
54269
- }
54270
- const callEnv = new types_1.Environment(fn.closure);
54271
- for (let i2 = 0; i2 < fn.params.length; i2++) {
54272
- const param = fn.params[i2];
54273
- const value = i2 < args2.length ? args2[i2] : param.defaultValue ? await this.evaluateExpression(param.defaultValue) : null;
54274
- callEnv.define(param.name, value);
54275
- }
54276
- const previous = this.currentEnv;
54277
- this.currentEnv = callEnv;
54278
- try {
54279
- await this.executeBlock(fn.body, callEnv);
54280
- return null;
54281
- } catch (e2) {
54282
- if (e2 instanceof types_1.ReturnValue) {
54283
- return e2.value;
54284
- }
54285
- throw e2;
54286
- } finally {
54287
- this.currentEnv = previous;
54288
- }
54638
+ return await this.callSesiFunction(fn, args2);
54289
54639
  }
54290
54640
  async evaluateMember(expr) {
54291
54641
  const obj = await this.evaluateExpression(expr.object);
@@ -54335,6 +54685,29 @@ var require_interpreter = __commonJS({
54335
54685
  if (typeof promptText !== "string") {
54336
54686
  promptText = (0, builtins_1.stringify)(promptText);
54337
54687
  }
54688
+ let imagePaths;
54689
+ if (expr.images) {
54690
+ const raw = await this.evaluateExpression(expr.images);
54691
+ if (Array.isArray(raw)) {
54692
+ imagePaths = raw.map((v) => (0, builtins_1.stringify)(v));
54693
+ } else if (typeof raw === "string" && raw.trim() !== "") {
54694
+ imagePaths = [raw];
54695
+ }
54696
+ }
54697
+ let thinkingLevel;
54698
+ if (expr.config?.thinkingLevel) {
54699
+ const raw = await this.evaluateExpression(expr.config.thinkingLevel);
54700
+ if (typeof raw === "object" && raw !== null) {
54701
+ thinkingLevel = raw;
54702
+ }
54703
+ }
54704
+ let cache;
54705
+ if (expr.config?.cache) {
54706
+ const raw = await this.evaluateExpression(expr.config.cache);
54707
+ if (typeof raw === "boolean") {
54708
+ cache = raw;
54709
+ }
54710
+ }
54338
54711
  const response = await ai_runtime_1.aiRuntime.callModel({
54339
54712
  model: expr.modelName,
54340
54713
  prompt: promptText,
@@ -54343,7 +54716,10 @@ var require_interpreter = __commonJS({
54343
54716
  topK: expr.config?.top_k ? await this.evaluateExpression(expr.config.top_k) : void 0,
54344
54717
  topP: expr.config?.top_p ? await this.evaluateExpression(expr.config.top_p) : void 0,
54345
54718
  ratio: expr.config?.ratio ? await this.evaluateExpression(expr.config.ratio) : void 0,
54346
- size: expr.config?.size ? await this.evaluateExpression(expr.config.size) : void 0
54719
+ size: expr.config?.size ? await this.evaluateExpression(expr.config.size) : void 0,
54720
+ images: imagePaths,
54721
+ thinkingLevel,
54722
+ cache
54347
54723
  });
54348
54724
  return response.text;
54349
54725
  }
@@ -54352,11 +54728,37 @@ var require_interpreter = __commonJS({
54352
54728
  if (typeof promptText !== "string") {
54353
54729
  promptText = (0, builtins_1.stringify)(promptText);
54354
54730
  }
54731
+ let imagePaths;
54732
+ if (expr.images) {
54733
+ const raw = await this.evaluateExpression(expr.images);
54734
+ if (Array.isArray(raw)) {
54735
+ imagePaths = raw.map((v) => (0, builtins_1.stringify)(v));
54736
+ } else if (typeof raw === "string" && raw.trim() !== "") {
54737
+ imagePaths = [raw];
54738
+ }
54739
+ }
54740
+ let thinkingLevel;
54741
+ if (expr.config?.thinkingLevel) {
54742
+ const raw = await this.evaluateExpression(expr.config.thinkingLevel);
54743
+ if (typeof raw === "object" && raw !== null) {
54744
+ thinkingLevel = raw;
54745
+ }
54746
+ }
54747
+ let cache;
54748
+ if (expr.config?.cache) {
54749
+ const raw = await this.evaluateExpression(expr.config.cache);
54750
+ if (typeof raw === "boolean") {
54751
+ cache = raw;
54752
+ }
54753
+ }
54355
54754
  const response = await ai_runtime_1.aiRuntime.callModel({
54356
54755
  model: expr.modelName,
54357
54756
  prompt: promptText,
54358
54757
  temperature: expr.config?.temperature ? await this.evaluateExpression(expr.config.temperature) : void 0,
54359
- maxTokens: expr.config?.max_tokens ? await this.evaluateExpression(expr.config.max_tokens) : void 0
54758
+ maxTokens: expr.config?.max_tokens ? await this.evaluateExpression(expr.config.max_tokens) : void 0,
54759
+ images: imagePaths,
54760
+ thinkingLevel,
54761
+ cache
54360
54762
  });
54361
54763
  return response.text;
54362
54764
  }
@@ -54378,20 +54780,22 @@ var require_interpreter = __commonJS({
54378
54780
  for (const arg of expr.arguments) {
54379
54781
  args2.push(await this.evaluateExpression(arg));
54380
54782
  }
54381
- const runtimeFn = fn;
54382
- if (runtimeFn.isBuiltin && runtimeFn.builtin) {
54383
- return runtimeFn.builtin(...args2);
54783
+ return await this.callSesiFunction(fn, args2);
54784
+ }
54785
+ async callSesiFunction(fn, args2) {
54786
+ if (fn.isBuiltin && fn.builtin) {
54787
+ return await fn.builtin(...args2);
54384
54788
  }
54385
- const callEnv = new types_1.Environment(runtimeFn.closure);
54386
- for (let i2 = 0; i2 < runtimeFn.params.length; i2++) {
54387
- const param = runtimeFn.params[i2];
54789
+ const callEnv = new types_1.Environment(fn.closure);
54790
+ for (let i2 = 0; i2 < fn.params.length; i2++) {
54791
+ const param = fn.params[i2];
54388
54792
  const value = i2 < args2.length ? args2[i2] : param.defaultValue ? await this.evaluateExpression(param.defaultValue) : null;
54389
54793
  callEnv.define(param.name, value);
54390
54794
  }
54391
54795
  const previous = this.currentEnv;
54392
54796
  this.currentEnv = callEnv;
54393
54797
  try {
54394
- await this.executeBlock(runtimeFn.body, callEnv);
54798
+ await this.executeBlock(fn.body, callEnv);
54395
54799
  return null;
54396
54800
  } catch (e2) {
54397
54801
  if (e2 instanceof types_1.ReturnValue) {
@@ -54402,6 +54806,141 @@ var require_interpreter = __commonJS({
54402
54806
  this.currentEnv = previous;
54403
54807
  }
54404
54808
  }
54809
+ async executeExport(stmt) {
54810
+ await this.executeStatement(stmt.statement);
54811
+ const name = stmt.statement.name;
54812
+ const val = this.currentEnv.get(name);
54813
+ this.exports.set(name, val);
54814
+ }
54815
+ async executeImport(stmt) {
54816
+ const source = stmt.source;
54817
+ let moduleExports = null;
54818
+ if (source.startsWith("std/")) {
54819
+ moduleExports = this.loadStdModule(source);
54820
+ } else {
54821
+ const fs3 = require("fs");
54822
+ const path2 = require("path");
54823
+ let filePath = source;
54824
+ if (!filePath.endsWith(".sesi")) {
54825
+ filePath += ".sesi";
54826
+ }
54827
+ const resolvedPath = path2.resolve(process.cwd(), filePath);
54828
+ if (!fs3.existsSync(resolvedPath)) {
54829
+ throw new Error(`Module not found: ${source}`);
54830
+ }
54831
+ const content = fs3.readFileSync(resolvedPath, "utf-8");
54832
+ const { Lexer } = require_lexer();
54833
+ const { Parser } = require_parser();
54834
+ const lexer = new Lexer(content);
54835
+ const parser = new Parser(lexer.scanTokens());
54836
+ const program = parser.parse();
54837
+ const subInterpreter = new _Interpreter();
54838
+ await subInterpreter.interpret(program);
54839
+ moduleExports = subInterpreter.exports;
54840
+ }
54841
+ if (!moduleExports) {
54842
+ throw new Error(`Failed to load module: ${source}`);
54843
+ }
54844
+ if (stmt.names.length === 1 && stmt.names[0] === stmt.names[0].toLowerCase() && !moduleExports.has(stmt.names[0])) {
54845
+ const nsObj = {};
54846
+ for (const [key, val] of moduleExports.entries()) {
54847
+ nsObj[key] = val;
54848
+ }
54849
+ this.currentEnv.define(stmt.names[0], nsObj);
54850
+ } else {
54851
+ for (const name of stmt.names) {
54852
+ if (!moduleExports.has(name)) {
54853
+ throw new Error(`Module "${source}" does not export "${name}"`);
54854
+ }
54855
+ this.currentEnv.define(name, moduleExports.get(name));
54856
+ }
54857
+ }
54858
+ }
54859
+ loadStdModule(source) {
54860
+ const exports3 = /* @__PURE__ */ new Map();
54861
+ if (source === "std/math") {
54862
+ exports3.set("PI", Math.PI);
54863
+ exports3.set("E", Math.E);
54864
+ const mathFns = ["sin", "cos", "tan", "sqrt", "floor", "ceil", "abs", "pow", "log", "exp"];
54865
+ for (const name of mathFns) {
54866
+ exports3.set(name, {
54867
+ type: "function",
54868
+ name,
54869
+ params: name === "pow" ? [{ name: "x" }, { name: "y" }] : [{ name: "x" }],
54870
+ body: {},
54871
+ closure: {},
54872
+ isBuiltin: true,
54873
+ builtin: (...args2) => {
54874
+ const x2 = typeof args2[0] === "number" ? args2[0] : 0;
54875
+ if (name === "pow") {
54876
+ const y = typeof args2[1] === "number" ? args2[1] : 0;
54877
+ return Math.pow(x2, y);
54878
+ }
54879
+ return Math[name](x2);
54880
+ }
54881
+ });
54882
+ }
54883
+ return exports3;
54884
+ } else if (source === "std/time") {
54885
+ exports3.set("now", {
54886
+ type: "function",
54887
+ name: "now",
54888
+ params: [],
54889
+ body: {},
54890
+ closure: {},
54891
+ isBuiltin: true,
54892
+ builtin: (...args2) => Date.now()
54893
+ });
54894
+ exports3.set("sleep", {
54895
+ type: "function",
54896
+ name: "sleep",
54897
+ params: [{ name: "ms" }],
54898
+ body: {},
54899
+ closure: {},
54900
+ isBuiltin: true,
54901
+ builtin: async (...args2) => {
54902
+ const [ms] = args2;
54903
+ const duration = typeof ms === "number" ? ms : 0;
54904
+ await new Promise((resolve) => setTimeout(resolve, duration));
54905
+ return null;
54906
+ }
54907
+ });
54908
+ return exports3;
54909
+ } else if (source === "std/json") {
54910
+ exports3.set("stringify", {
54911
+ type: "function",
54912
+ name: "stringify",
54913
+ params: [{ name: "val" }],
54914
+ body: {},
54915
+ closure: {},
54916
+ isBuiltin: true,
54917
+ builtin: (...args2) => {
54918
+ const [val] = args2;
54919
+ return JSON.stringify(val);
54920
+ }
54921
+ });
54922
+ exports3.set("parse", {
54923
+ type: "function",
54924
+ name: "parse",
54925
+ params: [{ name: "str" }],
54926
+ body: {},
54927
+ closure: {},
54928
+ isBuiltin: true,
54929
+ builtin: (...args2) => {
54930
+ const [str] = args2;
54931
+ if (typeof str !== "string")
54932
+ return null;
54933
+ try {
54934
+ return JSON.parse(str);
54935
+ } catch (e2) {
54936
+ return null;
54937
+ }
54938
+ }
54939
+ });
54940
+ return exports3;
54941
+ }
54942
+ return null;
54943
+ }
54405
54944
  };
54406
54945
  exports2.Interpreter = Interpreter;
54407
54946
  }
@@ -54469,13 +55008,13 @@ var require_dist5 = __commonJS({
54469
55008
  process.exit(1);
54470
55009
  }
54471
55010
  }
54472
- async function runSesiFile2(filePath2) {
55011
+ async function runSesiFile2(filePath) {
54473
55012
  try {
54474
- const filepath = path2.resolve(filePath2);
55013
+ const filepath = path2.resolve(filePath);
54475
55014
  const source = fs3.readFileSync(filepath, "utf-8");
54476
55015
  await runSesi(source);
54477
55016
  } catch (error) {
54478
- console.error(`Error reading file ${filePath2}:`, error.message);
55017
+ console.error(`Error reading file ${filePath}:`, error.message);
54479
55018
  process.exit(1);
54480
55019
  }
54481
55020
  }
@@ -54490,48 +55029,49 @@ var path = require("path");
54490
55029
  var args = process.argv.slice(2);
54491
55030
  if (args.length === 0) {
54492
55031
  console.log(`
54493
- Sesi Programming Language v1.1.1
55032
+ Sesi Programming Language v1.2.1
54494
55033
 
54495
55034
  Usage:
54496
55035
  sesi <file> Run a Sesi program
54497
- sesi --help Show this help
54498
-
54499
- Examples:
54500
- sesi main/start.sesi
54501
- sesi examples/01_hello.sesi
54502
- `);
54503
- process.exit(0);
54504
- }
54505
- if (args[0] === "--help" || args[0] === "-h") {
54506
- console.log(`
54507
- Sesi Programming Language v1.1.1
55036
+ sesi -help <query> Ask for help from our Sesi Co-Pilot
55037
+ sesi --help <query>
55038
+ sesi -h <query>
54508
55039
 
54509
- Usage:
54510
- sesi <file> Run a Sesi program
54511
- sesi --help Show this help
54512
-
54513
- Options:
55040
+ Options:
54514
55041
  --version Show version
54515
-
55042
+
54516
55043
  Examples:
54517
55044
  sesi main/start.sesi
54518
55045
  sesi examples/01_hello.sesi
55046
+ sesi -help "how do I parse a json string?"
54519
55047
  `);
54520
55048
  process.exit(0);
54521
55049
  }
54522
- if (args[0] === "--version") {
54523
- console.log("Sesi v1.1.1");
55050
+ if (args[0] === "--help" || args[0] === "-help" || args[0] === "-h") {
55051
+ let queryText = args.slice(1).join(" ").trim();
55052
+ if (!queryText) {
55053
+ queryText = "how do I parse a json string?";
55054
+ }
55055
+ fs2.writeFileSync("query.txt", queryText, "utf-8");
55056
+ const copilotPath = path.join(__dirname, "../main/sesi_db_chatbot.sesi");
55057
+ runSesiFile(copilotPath).catch((error) => {
55058
+ console.error("Fatal error in Sesi Co-Pilot:", error.message);
55059
+ process.exit(1);
55060
+ });
55061
+ } else if (args[0] === "--version") {
55062
+ console.log("Sesi v1.2.1");
54524
55063
  process.exit(0);
55064
+ } else {
55065
+ const filePath = args[0];
55066
+ if (!fs2.existsSync(filePath)) {
55067
+ console.error(`Error: File not found: ${filePath}`);
55068
+ process.exit(1);
55069
+ }
55070
+ runSesiFile(filePath).catch((error) => {
55071
+ console.error("Fatal error:", error.message);
55072
+ process.exit(1);
55073
+ });
54525
55074
  }
54526
- var filePath = args[0];
54527
- if (!fs2.existsSync(filePath)) {
54528
- console.error(`Error: File not found: ${filePath}`);
54529
- process.exit(1);
54530
- }
54531
- runSesiFile(filePath).catch((error) => {
54532
- console.error("Fatal error:", error.message);
54533
- process.exit(1);
54534
- });
54535
55075
  /*! Bundled license information:
54536
55076
 
54537
55077
  @noble/ciphers/utils.js: