@digipair/skill-dsp 0.22.1 → 0.23.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -20332,6 +20332,7 @@ about the parse state.
20332
20332
  var _a;
20333
20333
  var depth = action >> 19 /* Action.ReduceDepthShift */ , type = action & 65535 /* Action.ValueMask */ ;
20334
20334
  var parser = this.p.parser;
20335
+ if (this.reducePos < this.pos - 25 /* Lookahead.Margin */ ) this.setLookAhead(this.pos);
20335
20336
  var dPrec = parser.dynamicPrecedence(type);
20336
20337
  if (dPrec) this.score += dPrec;
20337
20338
  if (depth == 0) {
@@ -21284,7 +21285,7 @@ function cutAt(tree, pos, side) {
21284
21285
  cursor.moveTo(pos);
21285
21286
  for(;;){
21286
21287
  if (!(side < 0 ? cursor.childBefore(pos) : cursor.childAfter(pos))) for(;;){
21287
- if ((side < 0 ? cursor.to < pos : cursor.from > pos) && !cursor.type.isError) return side < 0 ? Math.max(0, Math.min(cursor.to - 1, pos - 25 /* Safety.Margin */ )) : Math.min(tree.length, Math.max(cursor.from + 1, pos + 25 /* Safety.Margin */ ));
21288
+ if ((side < 0 ? cursor.to < pos : cursor.from > pos) && !cursor.type.isError) return side < 0 ? Math.max(0, Math.min(cursor.to - 1, pos - 25 /* Lookahead.Margin */ )) : Math.min(tree.length, Math.max(cursor.from + 1, pos + 25 /* Lookahead.Margin */ ));
21288
21289
  if (side < 0 ? cursor.prevSibling() : cursor.nextSibling()) break;
21289
21290
  if (!cursor.parent()) return side < 0 ? 0 : tree.length;
21290
21291
  }
@@ -21407,7 +21408,7 @@ var TokenCache = /*#__PURE__*/ function() {
21407
21408
  token.mask = mask;
21408
21409
  token.context = context;
21409
21410
  }
21410
- if (token.lookAhead > token.end + 25 /* Safety.Margin */ ) lookAhead = Math.max(token.lookAhead, lookAhead);
21411
+ if (token.lookAhead > token.end + 25 /* Lookahead.Margin */ ) lookAhead = Math.max(token.lookAhead, lookAhead);
21411
21412
  if (token.value != 0 /* Term.Err */ ) {
21412
21413
  var startIndex = actionIndex;
21413
21414
  if (token.extended > -1) actionIndex = this.addActions(stack, token.extended, token.end, actionIndex);
@@ -23498,14 +23499,14 @@ function indent(str, spaces) {
23498
23499
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
23499
23500
  // match is required
23500
23501
  if (!match) {
23501
- return tokens = tokens1, nextMatch = nextMatch1, i = i1, {
23502
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
23502
23503
  v: nextMatch1
23503
23504
  };
23504
23505
  }
23505
23506
  var token = match.token, offset = match.offset;
23506
23507
  i1 += offset;
23507
23508
  if (token === " ") {
23508
- return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
23509
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23509
23510
  }
23510
23511
  tokens1 = _to_consumable_array$6(tokens1).concat([
23511
23512
  token
@@ -23524,7 +23525,7 @@ function indent(str, spaces) {
23524
23525
  if (contextKeys.some(function(el) {
23525
23526
  return el.startsWith(name);
23526
23527
  })) {
23527
- return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
23528
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23528
23529
  }
23529
23530
  if (dateTimeIdentifiers.some(function(el) {
23530
23531
  return el === name;
@@ -23543,9 +23544,9 @@ function indent(str, spaces) {
23543
23544
  if (dateTimeIdentifiers.some(function(el) {
23544
23545
  return el.startsWith(name);
23545
23546
  })) {
23546
- return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
23547
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23547
23548
  }
23548
- return tokens = tokens1, nextMatch = nextMatch1, i = i1, {
23549
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
23549
23550
  v: nextMatch1
23550
23551
  };
23551
23552
  };
@@ -24348,6 +24349,7 @@ var parser = LRParser.deserialize({
24348
24349
  },
24349
24350
  dynamicPrecedences: {
24350
24351
  "31": -1,
24352
+ "67": 1,
24351
24353
  "71": -1,
24352
24354
  "73": -1
24353
24355
  },
@@ -27351,6 +27353,7 @@ const applyTemplate = (value, context)=>{
27351
27353
  const path = result.replace(/^EVALUATE:/, '');
27352
27354
  result = evaluate(path, _extends({}, context, {
27353
27355
  getTime: (time)=>new Date(time).getTime(),
27356
+ fromTime: (time)=>new Date(time).toISOString(),
27354
27357
  atob: (value)=>atob(value),
27355
27358
  btoa: (value)=>btoa(value),
27356
27359
  encodeURIComponent: (value)=>encodeURIComponent(value),
@@ -28609,7 +28612,7 @@ var axBaseAIDefaultConfig = function() {
28609
28612
  };
28610
28613
  var AxBaseAI = /*#__PURE__*/ function() {
28611
28614
  function AxBaseAI(param) {
28612
- var name = param.name, apiURL = param.apiURL, headers = param.headers, modelInfo = param.modelInfo, models = param.models, _param_options = param.options, options = _param_options === void 0 ? {} : _param_options, supportFor = param.supportFor;
28615
+ var name = param.name, apiURL = param.apiURL, headers = param.headers, modelInfo = param.modelInfo, models = param.models, _param_options = param.options, options = _param_options === void 0 ? {} : _param_options, supportFor = param.supportFor, modelMap = param.modelMap;
28613
28616
  _class_call_check$p(this, AxBaseAI);
28614
28617
  _define_property$p(this, "generateChatReq", void 0);
28615
28618
  _define_property$p(this, "generateEmbedReq", void 0);
@@ -28621,48 +28624,29 @@ var AxBaseAI = /*#__PURE__*/ function() {
28621
28624
  _define_property$p(this, "fetch", void 0);
28622
28625
  _define_property$p(this, "tracer", void 0);
28623
28626
  _define_property$p(this, "modelMap", void 0);
28624
- _define_property$p(this, "embedModelMap", void 0);
28627
+ _define_property$p(this, "modelInfo", void 0);
28625
28628
  _define_property$p(this, "modelUsage", void 0);
28626
28629
  _define_property$p(this, "embedModelUsage", void 0);
28630
+ _define_property$p(this, "models", void 0);
28627
28631
  _define_property$p(this, "apiURL", void 0);
28628
28632
  _define_property$p(this, "name", void 0);
28629
28633
  _define_property$p(this, "headers", void 0);
28630
- _define_property$p(this, "modelInfo", void 0);
28631
- _define_property$p(this, "embedModelInfo", void 0);
28632
28634
  _define_property$p(this, "supportFor", void 0);
28633
28635
  this.name = name;
28634
28636
  this.apiURL = apiURL;
28635
28637
  this.headers = headers;
28636
28638
  this.supportFor = supportFor;
28637
28639
  this.tracer = options.tracer;
28638
- var model = this.getModel(models.model);
28639
- var embedModel = this.getEmbedModel(models.embedModel);
28640
- if (typeof model === "string") {
28641
- var modelName = model.replace(/-0\d+$|-\d{2,}$/, "");
28642
- var _modelInfo_filter_at;
28643
- this.modelInfo = (_modelInfo_filter_at = modelInfo.filter(function(v) {
28644
- return v.name === modelName;
28645
- }).at(0)) !== null && _modelInfo_filter_at !== void 0 ? _modelInfo_filter_at : {
28646
- name: model,
28647
- currency: "usd",
28648
- promptTokenCostPer1M: 0,
28649
- completionTokenCostPer1M: 0
28650
- };
28651
- } else {
28640
+ this.modelInfo = modelInfo;
28641
+ this.modelMap = modelMap;
28642
+ var _modelMap_models_model, _models_embedModel, _modelMap_;
28643
+ this.models = {
28644
+ model: (_modelMap_models_model = modelMap === null || modelMap === void 0 ? void 0 : modelMap[models.model]) !== null && _modelMap_models_model !== void 0 ? _modelMap_models_model : models.model,
28645
+ embedModel: (_modelMap_ = modelMap === null || modelMap === void 0 ? void 0 : modelMap[(_models_embedModel = models.embedModel) !== null && _models_embedModel !== void 0 ? _models_embedModel : ""]) !== null && _modelMap_ !== void 0 ? _modelMap_ : models.embedModel
28646
+ };
28647
+ if (!models.model || typeof models.model !== "string" || models.model === "") {
28652
28648
  throw new Error("No model defined");
28653
28649
  }
28654
- if (typeof embedModel === "string") {
28655
- var embedModelName = embedModel === null || embedModel === void 0 ? void 0 : embedModel.replace(/-0\d+$|-\d{2,}$/, "");
28656
- var _modelInfo_filter_at1;
28657
- this.embedModelInfo = (_modelInfo_filter_at1 = modelInfo.filter(function(v) {
28658
- return v.name === embedModelName;
28659
- }).at(0)) !== null && _modelInfo_filter_at1 !== void 0 ? _modelInfo_filter_at1 : {
28660
- name: embedModel !== null && embedModel !== void 0 ? embedModel : "",
28661
- currency: "usd",
28662
- promptTokenCostPer1M: 0,
28663
- completionTokenCostPer1M: 0
28664
- };
28665
- }
28666
28650
  this.setOptions(options);
28667
28651
  }
28668
28652
  _create_class$c(AxBaseAI, [
@@ -28702,21 +28686,27 @@ var AxBaseAI = /*#__PURE__*/ function() {
28702
28686
  }
28703
28687
  },
28704
28688
  {
28705
- key: "setModelMap",
28706
- value: function setModelMap(modelMap) {
28707
- this.modelMap = modelMap;
28708
- }
28709
- },
28710
- {
28711
- key: "setEmbedModelMap",
28712
- value: function setEmbedModelMap(embedModelMap) {
28713
- this.embedModelMap = embedModelMap;
28689
+ key: "_getModelInfo",
28690
+ value: function _getModelInfo(model) {
28691
+ var _this_modelMap;
28692
+ var _this_modelMap_model;
28693
+ var _model = (_this_modelMap_model = (_this_modelMap = this.modelMap) === null || _this_modelMap === void 0 ? void 0 : _this_modelMap[model]) !== null && _this_modelMap_model !== void 0 ? _this_modelMap_model : model;
28694
+ var modelName = _model.replace(/-0\d+$|-\d{2,}$/, "");
28695
+ var _this_modelInfo_filter_at;
28696
+ return (_this_modelInfo_filter_at = this.modelInfo.filter(function(v) {
28697
+ return v.name === modelName;
28698
+ }).at(0)) !== null && _this_modelInfo_filter_at !== void 0 ? _this_modelInfo_filter_at : {
28699
+ name: model,
28700
+ currency: "usd",
28701
+ promptTokenCostPer1M: 0,
28702
+ completionTokenCostPer1M: 0
28703
+ };
28714
28704
  }
28715
28705
  },
28716
28706
  {
28717
28707
  key: "getModelInfo",
28718
28708
  value: function getModelInfo() {
28719
- return _object_spread_props$8(_object_spread$h({}, this.modelInfo), {
28709
+ return _object_spread_props$8(_object_spread$h({}, this._getModelInfo(this.models.model)), {
28720
28710
  provider: this.name
28721
28711
  });
28722
28712
  }
@@ -28724,9 +28714,17 @@ var AxBaseAI = /*#__PURE__*/ function() {
28724
28714
  {
28725
28715
  key: "getEmbedModelInfo",
28726
28716
  value: function getEmbedModelInfo() {
28727
- return this.embedModelInfo ? _object_spread_props$8(_object_spread$h({}, this.embedModelInfo), {
28728
- provider: this.name
28729
- }) : undefined;
28717
+ if (this.models.embedModel) {
28718
+ return _object_spread_props$8(_object_spread$h({}, this._getModelInfo(this.models.embedModel)), {
28719
+ provider: this.name
28720
+ });
28721
+ }
28722
+ }
28723
+ },
28724
+ {
28725
+ key: "getModelMap",
28726
+ value: function getModelMap() {
28727
+ return this.modelMap;
28730
28728
  }
28731
28729
  },
28732
28730
  {
@@ -28749,13 +28747,14 @@ var AxBaseAI = /*#__PURE__*/ function() {
28749
28747
  },
28750
28748
  {
28751
28749
  key: "chat",
28752
- value: function chat(_req, options) {
28750
+ value: function chat(req, options) {
28753
28751
  var _this = this;
28754
28752
  return _async_to_generator$7(function() {
28755
- var _mc_stopSequences, _this_tracer, mc, _obj;
28753
+ var _this_modelMap, _this_modelMap_req_model, model, _mc_stopSequences, _this_tracer, mc, _obj;
28756
28754
  return _ts_generator$8(this, function(_state) {
28757
28755
  switch(_state.label){
28758
28756
  case 0:
28757
+ model = req.model ? (_this_modelMap_req_model = (_this_modelMap = _this.modelMap) === null || _this_modelMap === void 0 ? void 0 : _this_modelMap[req.model]) !== null && _this_modelMap_req_model !== void 0 ? _this_modelMap_req_model : req.model : _this.models.model;
28759
28758
  if (!_this.tracer) return [
28760
28759
  3,
28761
28760
  2
@@ -28765,7 +28764,7 @@ var AxBaseAI = /*#__PURE__*/ function() {
28765
28764
  4,
28766
28765
  (_this_tracer = _this.tracer) === null || _this_tracer === void 0 ? void 0 : _this_tracer.startActiveSpan("Chat Request", {
28767
28766
  kind: AxSpanKind.SERVER,
28768
- attributes: (_obj = {}, _define_property$p(_obj, axSpanAttributes.LLM_SYSTEM, _this.name), _define_property$p(_obj, axSpanAttributes.LLM_REQUEST_MODEL, _this.modelInfo.name), _define_property$p(_obj, axSpanAttributes.LLM_REQUEST_MAX_TOKENS, mc.maxTokens), _define_property$p(_obj, axSpanAttributes.LLM_REQUEST_TEMPERATURE, mc.temperature), _define_property$p(_obj, axSpanAttributes.LLM_REQUEST_TOP_P, mc.topP), _define_property$p(_obj, axSpanAttributes.LLM_REQUEST_TOP_K, mc.topK), _define_property$p(_obj, axSpanAttributes.LLM_REQUEST_FREQUENCY_PENALTY, mc.frequencyPenalty), _define_property$p(_obj, axSpanAttributes.LLM_REQUEST_PRESENCE_PENALTY, mc.presencePenalty), _define_property$p(_obj, axSpanAttributes.LLM_REQUEST_STOP_SEQUENCES, (_mc_stopSequences = mc.stopSequences) === null || _mc_stopSequences === void 0 ? void 0 : _mc_stopSequences.join(", ")), _define_property$p(_obj, axSpanAttributes.LLM_REQUEST_LLM_IS_STREAMING, mc.stream), _obj)
28767
+ attributes: (_obj = {}, _define_property$p(_obj, axSpanAttributes.LLM_SYSTEM, _this.name), _define_property$p(_obj, axSpanAttributes.LLM_REQUEST_MODEL, model), _define_property$p(_obj, axSpanAttributes.LLM_REQUEST_MAX_TOKENS, mc.maxTokens), _define_property$p(_obj, axSpanAttributes.LLM_REQUEST_TEMPERATURE, mc.temperature), _define_property$p(_obj, axSpanAttributes.LLM_REQUEST_TOP_P, mc.topP), _define_property$p(_obj, axSpanAttributes.LLM_REQUEST_TOP_K, mc.topK), _define_property$p(_obj, axSpanAttributes.LLM_REQUEST_FREQUENCY_PENALTY, mc.frequencyPenalty), _define_property$p(_obj, axSpanAttributes.LLM_REQUEST_PRESENCE_PENALTY, mc.presencePenalty), _define_property$p(_obj, axSpanAttributes.LLM_REQUEST_STOP_SEQUENCES, (_mc_stopSequences = mc.stopSequences) === null || _mc_stopSequences === void 0 ? void 0 : _mc_stopSequences.join(", ")), _define_property$p(_obj, axSpanAttributes.LLM_REQUEST_LLM_IS_STREAMING, mc.stream), _obj)
28769
28768
  }, function() {
28770
28769
  var _ref = _async_to_generator$7(function(span) {
28771
28770
  var res;
@@ -28774,7 +28773,7 @@ var AxBaseAI = /*#__PURE__*/ function() {
28774
28773
  case 0:
28775
28774
  return [
28776
28775
  4,
28777
- _this._chat(_req, options, span)
28776
+ _this._chat(model, req, options, span)
28778
28777
  ];
28779
28778
  case 1:
28780
28779
  res = _state.sent();
@@ -28799,7 +28798,7 @@ var AxBaseAI = /*#__PURE__*/ function() {
28799
28798
  case 2:
28800
28799
  return [
28801
28800
  4,
28802
- _this._chat(_req, options)
28801
+ _this._chat(model, req, options)
28803
28802
  ];
28804
28803
  case 3:
28805
28804
  return [
@@ -28813,10 +28812,10 @@ var AxBaseAI = /*#__PURE__*/ function() {
28813
28812
  },
28814
28813
  {
28815
28814
  key: "_chat",
28816
- value: function _chat(_req, options, span) {
28815
+ value: function _chat(model, chatReq, options, span) {
28817
28816
  var _this = this;
28818
28817
  return _async_to_generator$7(function() {
28819
- var _req_modelConfig, reqFn, _options_stream, stream, functions, req, fn, rv, _tmp, respFn, wrappedRespFn, doneCb, st, res;
28818
+ var _chatReq_modelConfig, reqFn, _options_stream, stream, functions, req, fn, rv, _tmp, respFn, wrappedRespFn, doneCb, st, res;
28820
28819
  return _ts_generator$8(this, function(_state) {
28821
28820
  switch(_state.label){
28822
28821
  case 0:
@@ -28824,11 +28823,14 @@ var AxBaseAI = /*#__PURE__*/ function() {
28824
28823
  throw new Error("generateChatReq not implemented");
28825
28824
  }
28826
28825
  reqFn = _this.generateChatReq;
28827
- stream = (_options_stream = options === null || options === void 0 ? void 0 : options.stream) !== null && _options_stream !== void 0 ? _options_stream : (_req_modelConfig = _req.modelConfig) === null || _req_modelConfig === void 0 ? void 0 : _req_modelConfig.stream;
28828
- functions = _req.functions && _req.functions.length > 0 ? _req.functions : undefined;
28829
- req = _object_spread_props$8(_object_spread$h({}, _req), {
28826
+ stream = (_options_stream = options === null || options === void 0 ? void 0 : options.stream) !== null && _options_stream !== void 0 ? _options_stream : (_chatReq_modelConfig = chatReq.modelConfig) === null || _chatReq_modelConfig === void 0 ? void 0 : _chatReq_modelConfig.stream;
28827
+ if (chatReq.functions && chatReq.functions.length > 0) {
28828
+ functions = chatReq.functions;
28829
+ }
28830
+ req = _object_spread_props$8(_object_spread$h({}, chatReq), {
28831
+ model: model,
28830
28832
  functions: functions,
28831
- modelConfig: _object_spread_props$8(_object_spread$h({}, _req.modelConfig), {
28833
+ modelConfig: _object_spread_props$8(_object_spread$h({}, chatReq.modelConfig), {
28832
28834
  stream: stream
28833
28835
  })
28834
28836
  });
@@ -28965,10 +28967,14 @@ var AxBaseAI = /*#__PURE__*/ function() {
28965
28967
  value: function embed(req, options) {
28966
28968
  var _this = this;
28967
28969
  return _async_to_generator$7(function() {
28968
- var _this_tracer, _obj;
28970
+ var _this_modelMap, _this_modelMap_req_embedModel, embedModel, _this_tracer, _req_embedModel, _obj;
28969
28971
  return _ts_generator$8(this, function(_state) {
28970
28972
  switch(_state.label){
28971
28973
  case 0:
28974
+ embedModel = req.embedModel ? (_this_modelMap_req_embedModel = (_this_modelMap = _this.modelMap) === null || _this_modelMap === void 0 ? void 0 : _this_modelMap[req.embedModel]) !== null && _this_modelMap_req_embedModel !== void 0 ? _this_modelMap_req_embedModel : req.embedModel : _this.models.embedModel;
28975
+ if (!embedModel) {
28976
+ throw new Error("No embed model defined");
28977
+ }
28972
28978
  if (!_this.tracer) return [
28973
28979
  3,
28974
28980
  2
@@ -28977,7 +28983,7 @@ var AxBaseAI = /*#__PURE__*/ function() {
28977
28983
  4,
28978
28984
  (_this_tracer = _this.tracer) === null || _this_tracer === void 0 ? void 0 : _this_tracer.startActiveSpan("Embed Request", {
28979
28985
  kind: AxSpanKind.SERVER,
28980
- attributes: (_obj = {}, _define_property$p(_obj, axSpanAttributes.LLM_SYSTEM, _this.name), _define_property$p(_obj, axSpanAttributes.LLM_REQUEST_MODEL, _this.modelInfo.name), _obj)
28986
+ attributes: (_obj = {}, _define_property$p(_obj, axSpanAttributes.LLM_SYSTEM, _this.name), _define_property$p(_obj, axSpanAttributes.LLM_REQUEST_MODEL, (_req_embedModel = req.embedModel) !== null && _req_embedModel !== void 0 ? _req_embedModel : _this.models.embedModel), _obj)
28981
28987
  }, function() {
28982
28988
  var _ref = _async_to_generator$7(function(span) {
28983
28989
  var res;
@@ -28986,7 +28992,7 @@ var AxBaseAI = /*#__PURE__*/ function() {
28986
28992
  case 0:
28987
28993
  return [
28988
28994
  4,
28989
- _this._embed(req, options, span)
28995
+ _this._embed(embedModel, req, options, span)
28990
28996
  ];
28991
28997
  case 1:
28992
28998
  res = _state.sent();
@@ -29011,7 +29017,7 @@ var AxBaseAI = /*#__PURE__*/ function() {
29011
29017
  case 2:
29012
29018
  return [
29013
29019
  2,
29014
- _this._embed(req, options)
29020
+ _this._embed(embedModel, req, options)
29015
29021
  ];
29016
29022
  }
29017
29023
  });
@@ -29020,10 +29026,10 @@ var AxBaseAI = /*#__PURE__*/ function() {
29020
29026
  },
29021
29027
  {
29022
29028
  key: "_embed",
29023
- value: function _embed(req, options, span) {
29029
+ value: function _embed(embedModel, embedReq, options, span) {
29024
29030
  var _this = this;
29025
29031
  return _async_to_generator$7(function() {
29026
- var fn, resValue, _tmp, res, _res_modelUsage_completionTokens, _obj;
29032
+ var req, fn, resValue, _tmp, res, _res_modelUsage_completionTokens, _obj;
29027
29033
  return _ts_generator$8(this, function(_state) {
29028
29034
  switch(_state.label){
29029
29035
  case 0:
@@ -29033,6 +29039,9 @@ var AxBaseAI = /*#__PURE__*/ function() {
29033
29039
  if (!_this.generateEmbedResp) {
29034
29040
  throw new Error("generateEmbedResp not implemented");
29035
29041
  }
29042
+ req = _object_spread_props$8(_object_spread$h({}, embedReq), {
29043
+ embedModel: embedModel
29044
+ });
29036
29045
  fn = function() {
29037
29046
  var _ref = _async_to_generator$7(function() {
29038
29047
  var _this_generateEmbedReq, apiConfig, reqValue, res;
@@ -29114,22 +29123,6 @@ var AxBaseAI = /*#__PURE__*/ function() {
29114
29123
  var headers = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
29115
29124
  return _object_spread$h({}, headers, this.headers);
29116
29125
  }
29117
- },
29118
- {
29119
- key: "getEmbedModel",
29120
- value: function getEmbedModel(name) {
29121
- var _this_embedModelMap;
29122
- var _this_embedModelMap_name;
29123
- return name ? (_this_embedModelMap_name = (_this_embedModelMap = this.embedModelMap) === null || _this_embedModelMap === void 0 ? void 0 : _this_embedModelMap[name]) !== null && _this_embedModelMap_name !== void 0 ? _this_embedModelMap_name : name : undefined;
29124
- }
29125
- },
29126
- {
29127
- key: "getModel",
29128
- value: function getModel(name) {
29129
- var _this_modelMap;
29130
- var _this_modelMap_name;
29131
- return (_this_modelMap_name = (_this_modelMap = this.modelMap) === null || _this_modelMap === void 0 ? void 0 : _this_modelMap[name]) !== null && _this_modelMap_name !== void 0 ? _this_modelMap_name : name;
29132
- }
29133
29126
  }
29134
29127
  ]);
29135
29128
  return AxBaseAI;
@@ -29293,6 +29286,7 @@ var AxAIOpenAIModel;
29293
29286
  (function(AxAIOpenAIModel) {
29294
29287
  AxAIOpenAIModel["GPT4"] = "gpt-4";
29295
29288
  AxAIOpenAIModel["GPT4O"] = "gpt-4o";
29289
+ AxAIOpenAIModel["GPT4OMini"] = "gpt-4o-mini";
29296
29290
  AxAIOpenAIModel["GPT4Turbo"] = "gpt-4-turbo";
29297
29291
  AxAIOpenAIModel["GPT35Turbo"] = "gpt-3.5-turbo";
29298
29292
  AxAIOpenAIModel["GPT35TurboInstruct"] = "gpt-3.5-turbo-instruct";
@@ -29323,6 +29317,12 @@ var AxAIOpenAIEmbedModel;
29323
29317
  promptTokenCostPer1M: 5,
29324
29318
  completionTokenCostPer1M: 15
29325
29319
  },
29320
+ {
29321
+ name: AxAIOpenAIModel.GPT4OMini,
29322
+ currency: "usd",
29323
+ promptTokenCostPer1M: 0.15,
29324
+ completionTokenCostPer1M: 0.6
29325
+ },
29326
29326
  {
29327
29327
  name: AxAIOpenAIModel.GPT4Turbo,
29328
29328
  currency: "usd",
@@ -29478,7 +29478,7 @@ var AxAIOpenAI = /*#__PURE__*/ function(AxBaseAI) {
29478
29478
  _inherits$f(AxAIOpenAI, AxBaseAI);
29479
29479
  var _super = _create_super$f(AxAIOpenAI);
29480
29480
  function AxAIOpenAI(param) {
29481
- var apiKey = param.apiKey, config = param.config, options = param.options, apiURL = param.apiURL, _param_modelInfo = param.modelInfo, modelInfo = _param_modelInfo === void 0 ? axModelInfoOpenAI : _param_modelInfo;
29481
+ var apiKey = param.apiKey, config = param.config, options = param.options, apiURL = param.apiURL, _param_modelInfo = param.modelInfo, modelInfo = _param_modelInfo === void 0 ? axModelInfoOpenAI : _param_modelInfo, modelMap = param.modelMap;
29482
29482
  _class_call_check$o(this, AxAIOpenAI);
29483
29483
  var _this;
29484
29484
  if (!apiKey || apiKey === "") {
@@ -29500,14 +29500,16 @@ var AxAIOpenAI = /*#__PURE__*/ function(AxBaseAI) {
29500
29500
  supportFor: {
29501
29501
  functions: true,
29502
29502
  streaming: true
29503
- }
29503
+ },
29504
+ modelMap: modelMap
29504
29505
  });
29505
29506
  _define_property$o(_assert_this_initialized$f(_this), "config", void 0);
29506
29507
  _define_property$o(_assert_this_initialized$f(_this), "streamingUsage", void 0);
29508
+ _define_property$o(_assert_this_initialized$f(_this), "dimensions", void 0);
29507
29509
  _define_property$o(_assert_this_initialized$f(_this), "generateChatReq", function(req, // eslint-disable-next-line @typescript-eslint/no-unused-vars
29508
29510
  _config) {
29509
29511
  var _req_functions, _req_modelConfig, _req_modelConfig1, _this_config, _this_config1, _req_modelConfig2, _req_modelConfig3, _req_modelConfig4, _req_modelConfig5, _req_modelConfig6, _req_modelConfig7;
29510
- var model = _this.config.model;
29512
+ var model = req.model;
29511
29513
  if (!req.chatPrompt || req.chatPrompt.length === 0) {
29512
29514
  throw new Error("Chat prompt is empty");
29513
29515
  }
@@ -29560,7 +29562,7 @@ var AxAIOpenAI = /*#__PURE__*/ function(AxBaseAI) {
29560
29562
  ];
29561
29563
  });
29562
29564
  _define_property$o(_assert_this_initialized$f(_this), "generateEmbedReq", function(req) {
29563
- var model = _this.config.embedModel;
29565
+ var model = req.embedModel;
29564
29566
  if (!model) {
29565
29567
  throw new Error("Embed model not set");
29566
29568
  }
@@ -29572,7 +29574,8 @@ var AxAIOpenAI = /*#__PURE__*/ function(AxBaseAI) {
29572
29574
  };
29573
29575
  var reqValue = {
29574
29576
  model: model,
29575
- input: req.texts
29577
+ input: req.texts,
29578
+ dimensions: _this.dimensions
29576
29579
  };
29577
29580
  return [
29578
29581
  apiConfig,
@@ -29681,6 +29684,7 @@ var AxAIOpenAI = /*#__PURE__*/ function(AxBaseAI) {
29681
29684
  _this.config = _config;
29682
29685
  var _options_streamingUsage;
29683
29686
  _this.streamingUsage = (_options_streamingUsage = options === null || options === void 0 ? void 0 : options.streamingUsage) !== null && _options_streamingUsage !== void 0 ? _options_streamingUsage : true;
29687
+ _this.dimensions = config === null || config === void 0 ? void 0 : config.dimensions;
29684
29688
  return _this;
29685
29689
  }
29686
29690
  _create_class$b(AxAIOpenAI, [
@@ -29914,7 +29918,7 @@ var AxAIAzureOpenAI = /*#__PURE__*/ function(AxAIOpenAI) {
29914
29918
  _inherits$e(AxAIAzureOpenAI, AxAIOpenAI);
29915
29919
  var _super = _create_super$e(AxAIAzureOpenAI);
29916
29920
  function AxAIAzureOpenAI(param) {
29917
- var apiKey = param.apiKey, resourceName = param.resourceName, deploymentName = param.deploymentName, _param_version = param.version, version = _param_version === void 0 ? "api-version=2024-02-15-preview" : _param_version, config = param.config, options = param.options;
29921
+ var apiKey = param.apiKey, resourceName = param.resourceName, deploymentName = param.deploymentName, _param_version = param.version, version = _param_version === void 0 ? "api-version=2024-02-15-preview" : _param_version, config = param.config, options = param.options, modelMap = param.modelMap;
29918
29922
  _class_call_check$n(this, AxAIAzureOpenAI);
29919
29923
  if (!apiKey || apiKey === "") {
29920
29924
  throw new Error("Azure OpenAPI API key not set");
@@ -29929,7 +29933,8 @@ var AxAIAzureOpenAI = /*#__PURE__*/ function(AxAIOpenAI) {
29929
29933
  var _this = _super.call(this, {
29930
29934
  apiKey: apiKey,
29931
29935
  config: _config,
29932
- options: options
29936
+ options: options,
29937
+ modelMap: modelMap
29933
29938
  });
29934
29939
  var host = resourceName.includes("://") ? resourceName : "https://".concat(resourceName, ".openai.azure.com/");
29935
29940
  _get$5((_assert_this_initialized$e(_this), _get_prototype_of$e(AxAIAzureOpenAI.prototype)), "setName", _this).call(_this, "Azure OpenAI");
@@ -30075,7 +30080,7 @@ var AxAIHuggingFace = /*#__PURE__*/ function(AxBaseAI) {
30075
30080
  _inherits$d(AxAIHuggingFace, AxBaseAI);
30076
30081
  var _super = _create_super$d(AxAIHuggingFace);
30077
30082
  function AxAIHuggingFace(param) {
30078
- var apiKey = param.apiKey, config = param.config, options = param.options;
30083
+ var apiKey = param.apiKey, config = param.config, options = param.options, modelMap = param.modelMap;
30079
30084
  _class_call_check$m(this, AxAIHuggingFace);
30080
30085
  var _this;
30081
30086
  if (!apiKey || apiKey === "") {
@@ -30096,13 +30101,14 @@ var AxAIHuggingFace = /*#__PURE__*/ function(AxBaseAI) {
30096
30101
  supportFor: {
30097
30102
  functions: false,
30098
30103
  streaming: false
30099
- }
30104
+ },
30105
+ modelMap: modelMap
30100
30106
  });
30101
30107
  _define_property$m(_assert_this_initialized$d(_this), "config", void 0);
30102
30108
  _define_property$m(_assert_this_initialized$d(_this), "generateChatReq", function(req, // eslint-disable-next-line @typescript-eslint/no-unused-vars
30103
30109
  _config) {
30104
30110
  var _req_chatPrompt, _req_modelConfig, _req_modelConfig1, _req_modelConfig2, _req_modelConfig3, _req_modelConfig4;
30105
- var model = _this.config.model;
30111
+ var model = req.model;
30106
30112
  var functionsList = req.functions ? "Functions:\n".concat(JSON.stringify(req.functions, null, 2), "\n") : "";
30107
30113
  var prompt = (_req_chatPrompt = req.chatPrompt) === null || _req_chatPrompt === void 0 ? void 0 : _req_chatPrompt.map(function(msg) {
30108
30114
  switch(msg.role){
@@ -30324,7 +30330,7 @@ var AxAITogether = /*#__PURE__*/ function(AxAIOpenAI) {
30324
30330
  _inherits$c(AxAITogether, AxAIOpenAI);
30325
30331
  var _super = _create_super$c(AxAITogether);
30326
30332
  function AxAITogether(param) {
30327
- var apiKey = param.apiKey, config = param.config, options = param.options;
30333
+ var apiKey = param.apiKey, config = param.config, options = param.options, modelMap = param.modelMap;
30328
30334
  _class_call_check$l(this, AxAITogether);
30329
30335
  if (!apiKey || apiKey === "") {
30330
30336
  throw new Error("Together API key not set");
@@ -30335,7 +30341,8 @@ var AxAITogether = /*#__PURE__*/ function(AxAIOpenAI) {
30335
30341
  config: _config,
30336
30342
  options: options,
30337
30343
  apiURL: "https://api.together.xyz/v1",
30338
- modelInfo: axModelInfoTogether
30344
+ modelInfo: axModelInfoTogether,
30345
+ modelMap: modelMap
30339
30346
  });
30340
30347
  _get$4((_assert_this_initialized$c(_this), _get_prototype_of$c(AxAITogether.prototype)), "setName", _this).call(_this, "Together");
30341
30348
  return _this;
@@ -30609,7 +30616,7 @@ var AxAICohere = /*#__PURE__*/ function(AxBaseAI) {
30609
30616
  _inherits$b(AxAICohere, AxBaseAI);
30610
30617
  var _super = _create_super$b(AxAICohere);
30611
30618
  function AxAICohere(param) {
30612
- var apiKey = param.apiKey, config = param.config, options = param.options;
30619
+ var apiKey = param.apiKey, config = param.config, options = param.options, modelMap = param.modelMap;
30613
30620
  _class_call_check$k(this, AxAICohere);
30614
30621
  var _this;
30615
30622
  if (!apiKey || apiKey === "") {
@@ -30630,13 +30637,14 @@ var AxAICohere = /*#__PURE__*/ function(AxBaseAI) {
30630
30637
  functions: true,
30631
30638
  streaming: true
30632
30639
  },
30633
- options: options
30640
+ options: options,
30641
+ modelMap: modelMap
30634
30642
  });
30635
30643
  _define_property$k(_assert_this_initialized$b(_this), "config", void 0);
30636
30644
  _define_property$k(_assert_this_initialized$b(_this), "generateChatReq", function(req, // eslint-disable-next-line @typescript-eslint/no-unused-vars
30637
30645
  _config) {
30638
30646
  var _req_functions, _req_modelConfig, _req_modelConfig1, _req_modelConfig2, _req_modelConfig3, _req_modelConfig4, _req_modelConfig5, _req_modelConfig6;
30639
- var model = _this.config.model;
30647
+ var model = req.model;
30640
30648
  var lastChatMsg = req.chatPrompt.at(-1);
30641
30649
  var restOfChat = req.chatPrompt.slice(0, -1);
30642
30650
  var message;
@@ -30731,7 +30739,7 @@ var AxAICohere = /*#__PURE__*/ function(AxBaseAI) {
30731
30739
  ];
30732
30740
  });
30733
30741
  _define_property$k(_assert_this_initialized$b(_this), "generateEmbedReq", function(req) {
30734
- var model = _this.config.embedModel;
30742
+ var model = req.embedModel;
30735
30743
  if (!model) {
30736
30744
  throw new Error("Embed model not set");
30737
30745
  }
@@ -31130,7 +31138,7 @@ var safetySettings = [
31130
31138
  _inherits$a(AxAIGoogleGemini, AxBaseAI);
31131
31139
  var _super = _create_super$a(AxAIGoogleGemini);
31132
31140
  function AxAIGoogleGemini(param) {
31133
- var apiKey = param.apiKey, projectId = param.projectId, region = param.region, config = param.config, options = param.options;
31141
+ var apiKey = param.apiKey, projectId = param.projectId, region = param.region, config = param.config, options = param.options, modelMap = param.modelMap;
31134
31142
  _class_call_check$j(this, AxAIGoogleGemini);
31135
31143
  var _this;
31136
31144
  if (!apiKey || apiKey === "") {
@@ -31154,14 +31162,15 @@ var safetySettings = [
31154
31162
  supportFor: {
31155
31163
  functions: true,
31156
31164
  streaming: true
31157
- }
31165
+ },
31166
+ modelMap: modelMap
31158
31167
  });
31159
31168
  _define_property$j(_assert_this_initialized$a(_this), "options", void 0);
31160
31169
  _define_property$j(_assert_this_initialized$a(_this), "config", void 0);
31161
31170
  _define_property$j(_assert_this_initialized$a(_this), "apiKey", void 0);
31162
31171
  _define_property$j(_assert_this_initialized$a(_this), "generateChatReq", function(req) {
31163
31172
  var _req_modelConfig, _this_options, _req_modelConfig1, _req_modelConfig2, _req_modelConfig3, _req_modelConfig4, _req_modelConfig5;
31164
- var model = _this.config.model;
31173
+ var model = req.model;
31165
31174
  var _req_modelConfig_stream;
31166
31175
  var stream = (_req_modelConfig_stream = (_req_modelConfig = req.modelConfig) === null || _req_modelConfig === void 0 ? void 0 : _req_modelConfig.stream) !== null && _req_modelConfig_stream !== void 0 ? _req_modelConfig_stream : _this.config.stream;
31167
31176
  if (!req.chatPrompt || req.chatPrompt.length === 0) {
@@ -31341,7 +31350,7 @@ var safetySettings = [
31341
31350
  ];
31342
31351
  });
31343
31352
  _define_property$j(_assert_this_initialized$a(_this), "generateEmbedReq", function(req) {
31344
- var model = _this.config.embedModel;
31353
+ var model = req.embedModel;
31345
31354
  if (!model) {
31346
31355
  throw new Error("Embed model not set");
31347
31356
  }
@@ -31705,7 +31714,7 @@ var AxAIAnthropic = /*#__PURE__*/ function(AxBaseAI) {
31705
31714
  _inherits$9(AxAIAnthropic, AxBaseAI);
31706
31715
  var _super = _create_super$9(AxAIAnthropic);
31707
31716
  function AxAIAnthropic(param) {
31708
- var apiKey = param.apiKey, config = param.config, options = param.options;
31717
+ var apiKey = param.apiKey, config = param.config, options = param.options, modelMap = param.modelMap;
31709
31718
  _class_call_check$i(this, AxAIAnthropic);
31710
31719
  var _this;
31711
31720
  if (!apiKey || apiKey === "") {
@@ -31727,12 +31736,13 @@ var AxAIAnthropic = /*#__PURE__*/ function(AxBaseAI) {
31727
31736
  supportFor: {
31728
31737
  functions: true,
31729
31738
  streaming: true
31730
- }
31739
+ },
31740
+ modelMap: modelMap
31731
31741
  });
31732
31742
  _define_property$i(_assert_this_initialized$9(_this), "config", void 0);
31733
31743
  _define_property$i(_assert_this_initialized$9(_this), "generateChatReq", function(req) {
31734
31744
  var _req_functions, _req_modelConfig, _req_modelConfig1, _req_modelConfig2, _req_modelConfig3, _req_modelConfig4, _req_modelConfig5;
31735
- var model = _this.config.model;
31745
+ var model = req.model;
31736
31746
  var apiConfig = {
31737
31747
  name: "/messages"
31738
31748
  };
@@ -32629,7 +32639,7 @@ var AxAIGroq = /*#__PURE__*/ function(AxAIOpenAI) {
32629
32639
  _inherits$8(AxAIGroq, AxAIOpenAI);
32630
32640
  var _super = _create_super$8(AxAIGroq);
32631
32641
  function AxAIGroq(param) {
32632
- var apiKey = param.apiKey, config = param.config, options = param.options;
32642
+ var apiKey = param.apiKey, config = param.config, options = param.options, modelMap = param.modelMap;
32633
32643
  _class_call_check$g(this, AxAIGroq);
32634
32644
  var _this;
32635
32645
  if (!apiKey || apiKey === "") {
@@ -32644,7 +32654,8 @@ var AxAIGroq = /*#__PURE__*/ function(AxAIOpenAI) {
32644
32654
  config: _config,
32645
32655
  options: _options,
32646
32656
  apiURL: "https://api.groq.com/openai/v1",
32647
- modelInfo: []
32657
+ modelInfo: [],
32658
+ modelMap: modelMap
32648
32659
  });
32649
32660
  _define_property$g(_assert_this_initialized$8(_this), "setOptions", function(options) {
32650
32661
  var rateLimiter = _this.newRateLimiter(options);
@@ -32700,19 +32711,23 @@ var AxAIGroq = /*#__PURE__*/ function(AxAIOpenAI) {
32700
32711
  }
32701
32712
  (AxAIOpenAI);
32702
32713
 
32714
+ // cspell:ignore mistral, mixtral, codestral, nemo
32703
32715
  var AxAIMistralModel;
32704
32716
  (function(AxAIMistralModel) {
32705
32717
  AxAIMistralModel["Mistral7B"] = "open-mistral-7b";
32706
32718
  AxAIMistralModel["Mistral8x7B"] = "open-mixtral-8x7b";
32707
32719
  AxAIMistralModel["MistralSmall"] = "mistral-small-latest";
32708
- AxAIMistralModel["MistralMedium"] = "mistral-medium-latest";
32709
32720
  AxAIMistralModel["MistralLarge"] = "mistral-large-latest";
32721
+ AxAIMistralModel["Codestral"] = "codestral-latest";
32722
+ AxAIMistralModel["OpenCodestralMamba"] = "open-codestral-mamba";
32723
+ AxAIMistralModel["OpenMistralNemo"] = "open-mistral-nemo-latest";
32710
32724
  })(AxAIMistralModel || (AxAIMistralModel = {}));
32711
32725
  var AxAIMistralEmbedModels;
32712
32726
  (function(AxAIMistralEmbedModels) {
32713
32727
  AxAIMistralEmbedModels["MistralEmbed"] = "mistral-embed";
32714
32728
  })(AxAIMistralEmbedModels || (AxAIMistralEmbedModels = {}));
32715
32729
 
32730
+ // cspell:ignore mistral, mixtral, codestral, nemo
32716
32731
  var axModelInfoMistral = [
32717
32732
  {
32718
32733
  name: AxAIMistralModel.Mistral7B,
@@ -32732,17 +32747,29 @@ var axModelInfoMistral = [
32732
32747
  promptTokenCostPer1M: 2,
32733
32748
  completionTokenCostPer1M: 6
32734
32749
  },
32735
- {
32736
- name: AxAIMistralModel.MistralMedium,
32737
- currency: "USD",
32738
- promptTokenCostPer1M: 2.7,
32739
- completionTokenCostPer1M: 8.1
32740
- },
32741
32750
  {
32742
32751
  name: AxAIMistralModel.MistralLarge,
32743
32752
  currency: "USD",
32744
32753
  promptTokenCostPer1M: 8,
32745
32754
  completionTokenCostPer1M: 24
32755
+ },
32756
+ {
32757
+ name: AxAIMistralModel.Codestral,
32758
+ currency: "USD",
32759
+ promptTokenCostPer1M: 1,
32760
+ completionTokenCostPer1M: 3
32761
+ },
32762
+ {
32763
+ name: AxAIMistralModel.OpenCodestralMamba,
32764
+ currency: "USD",
32765
+ promptTokenCostPer1M: 0.25,
32766
+ completionTokenCostPer1M: 0.25
32767
+ },
32768
+ {
32769
+ name: AxAIMistralModel.OpenMistralNemo,
32770
+ currency: "USD",
32771
+ promptTokenCostPer1M: 0.3,
32772
+ completionTokenCostPer1M: 0.3
32746
32773
  }
32747
32774
  ];
32748
32775
 
@@ -32877,7 +32904,7 @@ var AxAIMistral = /*#__PURE__*/ function(AxAIOpenAI) {
32877
32904
  _inherits$7(AxAIMistral, AxAIOpenAI);
32878
32905
  var _super = _create_super$7(AxAIMistral);
32879
32906
  function AxAIMistral(param) {
32880
- var apiKey = param.apiKey, config = param.config, options = param.options;
32907
+ var apiKey = param.apiKey, config = param.config, options = param.options, modelMap = param.modelMap;
32881
32908
  _class_call_check$f(this, AxAIMistral);
32882
32909
  if (!apiKey || apiKey === "") {
32883
32910
  throw new Error("Mistral API key not set");
@@ -32888,7 +32915,8 @@ var AxAIMistral = /*#__PURE__*/ function(AxAIOpenAI) {
32888
32915
  config: _config,
32889
32916
  options: options,
32890
32917
  apiURL: "https://api.mistral.ai/v1",
32891
- modelInfo: axModelInfoMistral
32918
+ modelInfo: axModelInfoMistral,
32919
+ modelMap: modelMap
32892
32920
  });
32893
32921
  _get$2((_assert_this_initialized$7(_this), _get_prototype_of$7(AxAIMistral.prototype)), "setName", _this).call(_this, "Mistral");
32894
32922
  return _this;
@@ -33052,7 +33080,7 @@ var AxAIDeepSeek = /*#__PURE__*/ function(AxAIOpenAI) {
33052
33080
  _inherits$6(AxAIDeepSeek, AxAIOpenAI);
33053
33081
  var _super = _create_super$6(AxAIDeepSeek);
33054
33082
  function AxAIDeepSeek(param) {
33055
- var apiKey = param.apiKey, config = param.config, options = param.options;
33083
+ var apiKey = param.apiKey, config = param.config, options = param.options, modelMap = param.modelMap;
33056
33084
  _class_call_check$e(this, AxAIDeepSeek);
33057
33085
  if (!apiKey || apiKey === "") {
33058
33086
  throw new Error("DeepSeek API key not set");
@@ -33063,7 +33091,8 @@ var AxAIDeepSeek = /*#__PURE__*/ function(AxAIOpenAI) {
33063
33091
  config: _config,
33064
33092
  options: options,
33065
33093
  apiURL: "https://api.deepseek.com",
33066
- modelInfo: axModelInfoDeepSeek
33094
+ modelInfo: axModelInfoDeepSeek,
33095
+ modelMap: modelMap
33067
33096
  });
33068
33097
  _get$1((_assert_this_initialized$6(_this), _get_prototype_of$6(AxAIDeepSeek.prototype)), "setName", _this).call(_this, "DeepSeek");
33069
33098
  return _this;
@@ -33231,14 +33260,15 @@ var axAIOllamaDefaultConfig = function() {
33231
33260
  _inherits$5(AxAIOllama, AxAIOpenAI);
33232
33261
  var _super = _create_super$5(AxAIOllama);
33233
33262
  function AxAIOllama(param) {
33234
- var _param_apiKey = param.apiKey, apiKey = _param_apiKey === void 0 ? "not-set" : _param_apiKey, _param_url = param.url, url = _param_url === void 0 ? "http://localhost:11434" : _param_url, config = param.config, options = param.options;
33263
+ var _param_apiKey = param.apiKey, apiKey = _param_apiKey === void 0 ? "not-set" : _param_apiKey, _param_url = param.url, url = _param_url === void 0 ? "http://localhost:11434" : _param_url, config = param.config, options = param.options, modelMap = param.modelMap;
33235
33264
  _class_call_check$d(this, AxAIOllama);
33236
33265
  var _config = _object_spread$6({}, axAIOllamaDefaultConfig(), config);
33237
33266
  var _this = _super.call(this, {
33238
33267
  apiKey: apiKey,
33239
33268
  options: options,
33240
33269
  config: _config,
33241
- apiURL: new URL("/v1", url).href
33270
+ apiURL: new URL("/api", url).href,
33271
+ modelMap: modelMap
33242
33272
  });
33243
33273
  _get((_assert_this_initialized$5(_this), _get_prototype_of$5(AxAIOllama.prototype)), "setName", _this).call(_this, "Ollama");
33244
33274
  return _this;
@@ -33446,18 +33476,6 @@ var AxAI = /*#__PURE__*/ function() {
33446
33476
  }
33447
33477
  }
33448
33478
  _create_class$5(AxAI, [
33449
- {
33450
- key: "setModelMap",
33451
- value: function setModelMap(modelMap) {
33452
- this.ai.setModelMap(modelMap);
33453
- }
33454
- },
33455
- {
33456
- key: "setEmbedModelMap",
33457
- value: function setEmbedModelMap(modelMap) {
33458
- this.ai.setEmbedModelMap(modelMap);
33459
- }
33460
- },
33461
33479
  {
33462
33480
  key: "getName",
33463
33481
  value: function getName() {
@@ -33488,6 +33506,12 @@ var AxAI = /*#__PURE__*/ function() {
33488
33506
  return this.ai.getFeatures();
33489
33507
  }
33490
33508
  },
33509
+ {
33510
+ key: "getModelMap",
33511
+ value: function getModelMap() {
33512
+ return this.ai.getModelMap();
33513
+ }
33514
+ },
33491
33515
  {
33492
33516
  key: "chat",
33493
33517
  value: function chat(req, options) {
@@ -34046,8 +34070,8 @@ var assertRequiredFields = function(sig, values) {
34046
34070
  });
34047
34071
  if (missingFields.length > 0) {
34048
34072
  throw new AxAssertionError({
34049
- message: "Missing required fields: ".concat(missingFields.map(function(f) {
34050
- return f.name;
34073
+ message: "Output must include: t: ".concat(missingFields.map(function(f) {
34074
+ return "`".concat(f.title, ":`");
34051
34075
  }).join(", ")),
34052
34076
  values: values
34053
34077
  });
@@ -38853,7 +38877,7 @@ var AxPromptTemplate = function AxPromptTemplate(sig, fieldTemplates) {
38853
38877
  this.outputFormat = {
38854
38878
  type: "text",
38855
38879
  text: [
38856
- "Follow the following format."
38880
+ "Use the following output format."
38857
38881
  ].concat(_to_consumable_array$2(this.renderOutFields(this.sig.getOutputFields())), [
38858
38882
  "---\n\n"
38859
38883
  ]).join("\n\n")