@digipair/skill-openai 0.34.3 → 0.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.cjs.js +195 -156
  2. package/index.esm.js +195 -156
  3. package/package.json +1 -1
package/index.cjs.js CHANGED
@@ -140,7 +140,7 @@ function _object_spread$1f(target) {
140
140
  }
141
141
  return target;
142
142
  }
143
- function ownKeys$W(object, enumerableOnly) {
143
+ function ownKeys$X(object, enumerableOnly) {
144
144
  var keys = Object.keys(object);
145
145
  if (Object.getOwnPropertySymbols) {
146
146
  var symbols = Object.getOwnPropertySymbols(object);
@@ -153,12 +153,12 @@ function ownKeys$W(object, enumerableOnly) {
153
153
  }
154
154
  return keys;
155
155
  }
156
- function _object_spread_props$W(target, source) {
156
+ function _object_spread_props$X(target, source) {
157
157
  source = source != null ? source : {};
158
158
  if (Object.getOwnPropertyDescriptors) {
159
159
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
160
160
  } else {
161
- ownKeys$W(Object(source)).forEach(function(key) {
161
+ ownKeys$X(Object(source)).forEach(function(key) {
162
162
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
163
163
  });
164
164
  }
@@ -306,7 +306,7 @@ function getRuntime() {
306
306
  return _ts_generator$M(this, function(_state) {
307
307
  return [
308
308
  2,
309
- _object_spread_props$W(_object_spread$1f({}, opts), {
309
+ _object_spread_props$X(_object_spread$1f({}, opts), {
310
310
  body: new MultipartBody(form)
311
311
  })
312
312
  ];
@@ -2134,7 +2134,7 @@ function _object_spread$1e(target) {
2134
2134
  }
2135
2135
  return target;
2136
2136
  }
2137
- function ownKeys$V(object, enumerableOnly) {
2137
+ function ownKeys$W(object, enumerableOnly) {
2138
2138
  var keys = Object.keys(object);
2139
2139
  if (Object.getOwnPropertySymbols) {
2140
2140
  var symbols = Object.getOwnPropertySymbols(object);
@@ -2147,12 +2147,12 @@ function ownKeys$V(object, enumerableOnly) {
2147
2147
  }
2148
2148
  return keys;
2149
2149
  }
2150
- function _object_spread_props$V(target, source) {
2150
+ function _object_spread_props$W(target, source) {
2151
2151
  source = source != null ? source : {};
2152
2152
  if (Object.getOwnPropertyDescriptors) {
2153
2153
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
2154
2154
  } else {
2155
- ownKeys$V(Object(source)).forEach(function(key) {
2155
+ ownKeys$W(Object(source)).forEach(function(key) {
2156
2156
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2157
2157
  });
2158
2158
  }
@@ -2340,7 +2340,7 @@ function _toFile() {
2340
2340
  if (!options.type) {
2341
2341
  type = (_bits_ = bits[0]) === null || _bits_ === void 0 ? void 0 : _bits_.type;
2342
2342
  if (typeof type === "string") {
2343
- options = _object_spread_props$V(_object_spread$1e({}, options), {
2343
+ options = _object_spread_props$W(_object_spread$1e({}, options), {
2344
2344
  type: type
2345
2345
  });
2346
2346
  }
@@ -2951,7 +2951,7 @@ function _object_spread$1d(target) {
2951
2951
  }
2952
2952
  return target;
2953
2953
  }
2954
- function ownKeys$U(object, enumerableOnly) {
2954
+ function ownKeys$V(object, enumerableOnly) {
2955
2955
  var keys = Object.keys(object);
2956
2956
  if (Object.getOwnPropertySymbols) {
2957
2957
  var symbols = Object.getOwnPropertySymbols(object);
@@ -2964,12 +2964,12 @@ function ownKeys$U(object, enumerableOnly) {
2964
2964
  }
2965
2965
  return keys;
2966
2966
  }
2967
- function _object_spread_props$U(target, source) {
2967
+ function _object_spread_props$V(target, source) {
2968
2968
  source = source != null ? source : {};
2969
2969
  if (Object.getOwnPropertyDescriptors) {
2970
2970
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
2971
2971
  } else {
2972
- ownKeys$U(Object(source)).forEach(function(key) {
2972
+ ownKeys$V(Object(source)).forEach(function(key) {
2973
2973
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2974
2974
  });
2975
2975
  }
@@ -3523,7 +3523,7 @@ var APIClient = /*#__PURE__*/ function() {
3523
3523
  body = _tmp;
3524
3524
  return [
3525
3525
  2,
3526
- _object_spread_props$U(_object_spread$1d({
3526
+ _object_spread_props$V(_object_spread$1d({
3527
3527
  method: method,
3528
3528
  path: path
3529
3529
  }, opts), {
@@ -3598,7 +3598,7 @@ var APIClient = /*#__PURE__*/ function() {
3598
3598
  contentLength: contentLength
3599
3599
  });
3600
3600
  var _options_signal;
3601
- var req = _object_spread_props$U(_object_spread$1d(_object_spread_props$U(_object_spread$1d({
3601
+ var req = _object_spread_props$V(_object_spread$1d(_object_spread_props$V(_object_spread$1d({
3602
3602
  method: method
3603
3603
  }, body && {
3604
3604
  body: body
@@ -5319,7 +5319,7 @@ function _object_spread$1c(target) {
5319
5319
  }
5320
5320
  return target;
5321
5321
  }
5322
- function ownKeys$T(object, enumerableOnly) {
5322
+ function ownKeys$U(object, enumerableOnly) {
5323
5323
  var keys = Object.keys(object);
5324
5324
  if (Object.getOwnPropertySymbols) {
5325
5325
  var symbols = Object.getOwnPropertySymbols(object);
@@ -5332,12 +5332,12 @@ function ownKeys$T(object, enumerableOnly) {
5332
5332
  }
5333
5333
  return keys;
5334
5334
  }
5335
- function _object_spread_props$T(target, source) {
5335
+ function _object_spread_props$U(target, source) {
5336
5336
  source = source != null ? source : {};
5337
5337
  if (Object.getOwnPropertyDescriptors) {
5338
5338
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
5339
5339
  } else {
5340
- ownKeys$T(Object(source)).forEach(function(key) {
5340
+ ownKeys$U(Object(source)).forEach(function(key) {
5341
5341
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
5342
5342
  });
5343
5343
  }
@@ -5396,7 +5396,7 @@ var Completions$2 = /*#__PURE__*/ function(APIResource) {
5396
5396
  key: "create",
5397
5397
  value: function create(body, options) {
5398
5398
  var _body_stream;
5399
- return this._client.post("/chat/completions", _object_spread_props$T(_object_spread$1c({
5399
+ return this._client.post("/chat/completions", _object_spread_props$U(_object_spread$1c({
5400
5400
  body: body
5401
5401
  }, options), {
5402
5402
  stream: (_body_stream = body.stream) !== null && _body_stream !== void 0 ? _body_stream : false
@@ -5571,7 +5571,7 @@ function _object_spread$1b(target) {
5571
5571
  }
5572
5572
  return target;
5573
5573
  }
5574
- function ownKeys$S(object, enumerableOnly) {
5574
+ function ownKeys$T(object, enumerableOnly) {
5575
5575
  var keys = Object.keys(object);
5576
5576
  if (Object.getOwnPropertySymbols) {
5577
5577
  var symbols = Object.getOwnPropertySymbols(object);
@@ -5584,12 +5584,12 @@ function ownKeys$S(object, enumerableOnly) {
5584
5584
  }
5585
5585
  return keys;
5586
5586
  }
5587
- function _object_spread_props$S(target, source) {
5587
+ function _object_spread_props$T(target, source) {
5588
5588
  source = source != null ? source : {};
5589
5589
  if (Object.getOwnPropertyDescriptors) {
5590
5590
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
5591
5591
  } else {
5592
- ownKeys$S(Object(source)).forEach(function(key) {
5592
+ ownKeys$T(Object(source)).forEach(function(key) {
5593
5593
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
5594
5594
  });
5595
5595
  }
@@ -5649,7 +5649,7 @@ var Speech = /*#__PURE__*/ function(APIResource) {
5649
5649
  * Generates audio from the input text.
5650
5650
  */ key: "create",
5651
5651
  value: function create(body, options) {
5652
- return this._client.post("/audio/speech", _object_spread_props$S(_object_spread$1b({
5652
+ return this._client.post("/audio/speech", _object_spread_props$T(_object_spread$1b({
5653
5653
  body: body
5654
5654
  }, options), {
5655
5655
  __binaryResponse: true
@@ -6280,7 +6280,7 @@ function _object_spread$17(target) {
6280
6280
  }
6281
6281
  return target;
6282
6282
  }
6283
- function ownKeys$R(object, enumerableOnly) {
6283
+ function ownKeys$S(object, enumerableOnly) {
6284
6284
  var keys = Object.keys(object);
6285
6285
  if (Object.getOwnPropertySymbols) {
6286
6286
  var symbols = Object.getOwnPropertySymbols(object);
@@ -6293,12 +6293,12 @@ function ownKeys$R(object, enumerableOnly) {
6293
6293
  }
6294
6294
  return keys;
6295
6295
  }
6296
- function _object_spread_props$R(target, source) {
6296
+ function _object_spread_props$S(target, source) {
6297
6297
  source = source != null ? source : {};
6298
6298
  if (Object.getOwnPropertyDescriptors) {
6299
6299
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
6300
6300
  } else {
6301
- ownKeys$R(Object(source)).forEach(function(key) {
6301
+ ownKeys$S(Object(source)).forEach(function(key) {
6302
6302
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
6303
6303
  });
6304
6304
  }
@@ -6358,7 +6358,7 @@ var Assistants = /*#__PURE__*/ function(APIResource) {
6358
6358
  * Create an assistant with a model and instructions.
6359
6359
  */ key: "create",
6360
6360
  value: function create(body, options) {
6361
- return this._client.post("/assistants", _object_spread_props$R(_object_spread$17({
6361
+ return this._client.post("/assistants", _object_spread_props$S(_object_spread$17({
6362
6362
  body: body
6363
6363
  }, options), {
6364
6364
  headers: _object_spread$17({
@@ -6372,7 +6372,7 @@ var Assistants = /*#__PURE__*/ function(APIResource) {
6372
6372
  * Retrieves an assistant.
6373
6373
  */ key: "retrieve",
6374
6374
  value: function retrieve(assistantId, options) {
6375
- return this._client.get("/assistants/".concat(assistantId), _object_spread_props$R(_object_spread$17({}, options), {
6375
+ return this._client.get("/assistants/".concat(assistantId), _object_spread_props$S(_object_spread$17({}, options), {
6376
6376
  headers: _object_spread$17({
6377
6377
  "OpenAI-Beta": "assistants=v2"
6378
6378
  }, options === null || options === void 0 ? void 0 : options.headers)
@@ -6384,7 +6384,7 @@ var Assistants = /*#__PURE__*/ function(APIResource) {
6384
6384
  * Modifies an assistant.
6385
6385
  */ key: "update",
6386
6386
  value: function update(assistantId, body, options) {
6387
- return this._client.post("/assistants/".concat(assistantId), _object_spread_props$R(_object_spread$17({
6387
+ return this._client.post("/assistants/".concat(assistantId), _object_spread_props$S(_object_spread$17({
6388
6388
  body: body
6389
6389
  }, options), {
6390
6390
  headers: _object_spread$17({
@@ -6400,7 +6400,7 @@ var Assistants = /*#__PURE__*/ function(APIResource) {
6400
6400
  if (isRequestOptions(query)) {
6401
6401
  return this.list({}, query);
6402
6402
  }
6403
- return this._client.getAPIList("/assistants", AssistantsPage, _object_spread_props$R(_object_spread$17({
6403
+ return this._client.getAPIList("/assistants", AssistantsPage, _object_spread_props$S(_object_spread$17({
6404
6404
  query: query
6405
6405
  }, options), {
6406
6406
  headers: _object_spread$17({
@@ -6414,7 +6414,7 @@ var Assistants = /*#__PURE__*/ function(APIResource) {
6414
6414
  * Delete an assistant.
6415
6415
  */ key: "del",
6416
6416
  value: function del(assistantId, options) {
6417
- return this._client.delete("/assistants/".concat(assistantId), _object_spread_props$R(_object_spread$17({}, options), {
6417
+ return this._client.delete("/assistants/".concat(assistantId), _object_spread_props$S(_object_spread$17({}, options), {
6418
6418
  headers: _object_spread$17({
6419
6419
  "OpenAI-Beta": "assistants=v2"
6420
6420
  }, options === null || options === void 0 ? void 0 : options.headers)
@@ -6548,7 +6548,7 @@ function _object_spread$16(target) {
6548
6548
  }
6549
6549
  return target;
6550
6550
  }
6551
- function ownKeys$Q(object, enumerableOnly) {
6551
+ function ownKeys$R(object, enumerableOnly) {
6552
6552
  var keys = Object.keys(object);
6553
6553
  if (Object.getOwnPropertySymbols) {
6554
6554
  var symbols = Object.getOwnPropertySymbols(object);
@@ -6561,12 +6561,12 @@ function ownKeys$Q(object, enumerableOnly) {
6561
6561
  }
6562
6562
  return keys;
6563
6563
  }
6564
- function _object_spread_props$Q(target, source) {
6564
+ function _object_spread_props$R(target, source) {
6565
6565
  source = source != null ? source : {};
6566
6566
  if (Object.getOwnPropertyDescriptors) {
6567
6567
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
6568
6568
  } else {
6569
- ownKeys$Q(Object(source)).forEach(function(key) {
6569
+ ownKeys$R(Object(source)).forEach(function(key) {
6570
6570
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
6571
6571
  });
6572
6572
  }
@@ -7217,9 +7217,9 @@ var AbstractChatCompletionRunner = /*#__PURE__*/ function() {
7217
7217
  __classPrivateFieldGet$4(_this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_validateParams).call(_this, params);
7218
7218
  return [
7219
7219
  4,
7220
- completions.create(_object_spread_props$Q(_object_spread$16({}, params), {
7220
+ completions.create(_object_spread_props$R(_object_spread$16({}, params), {
7221
7221
  stream: false
7222
- }), _object_spread_props$Q(_object_spread$16({}, options), {
7222
+ }), _object_spread_props$R(_object_spread$16({}, options), {
7223
7223
  signal: _this.controller.signal
7224
7224
  }))
7225
7225
  ];
@@ -7351,7 +7351,7 @@ var AbstractChatCompletionRunner = /*#__PURE__*/ function() {
7351
7351
  ];
7352
7352
  return [
7353
7353
  4,
7354
- _this._createChatCompletion(completions, _object_spread_props$Q(_object_spread$16({}, restParams), {
7354
+ _this._createChatCompletion(completions, _object_spread_props$R(_object_spread$16({}, restParams), {
7355
7355
  function_call: function_call,
7356
7356
  functions: functions,
7357
7357
  messages: _to_consumable_array$A(_this.messages)
@@ -7546,7 +7546,7 @@ var AbstractChatCompletionRunner = /*#__PURE__*/ function() {
7546
7546
  ];
7547
7547
  return [
7548
7548
  4,
7549
- _this._createChatCompletion(completions, _object_spread_props$Q(_object_spread$16({}, restParams), {
7549
+ _this._createChatCompletion(completions, _object_spread_props$R(_object_spread$16({}, restParams), {
7550
7550
  tool_choice: tool_choice,
7551
7551
  tools: tools,
7552
7552
  messages: _to_consumable_array$A(_this.messages)
@@ -7738,7 +7738,7 @@ _AbstractChatCompletionRunner_connectedPromise = new WeakMap(), _AbstractChatCom
7738
7738
  "function_call"
7739
7739
  ]);
7740
7740
  var _message_content;
7741
- var ret = _object_spread_props$Q(_object_spread$16({}, rest), {
7741
+ var ret = _object_spread_props$R(_object_spread$16({}, rest), {
7742
7742
  content: (_message_content = message.content) !== null && _message_content !== void 0 ? _message_content : null
7743
7743
  });
7744
7744
  if (function_call) {
@@ -7912,7 +7912,7 @@ function _object_spread$15(target) {
7912
7912
  }
7913
7913
  return target;
7914
7914
  }
7915
- function ownKeys$P(object, enumerableOnly) {
7915
+ function ownKeys$Q(object, enumerableOnly) {
7916
7916
  var keys = Object.keys(object);
7917
7917
  if (Object.getOwnPropertySymbols) {
7918
7918
  var symbols = Object.getOwnPropertySymbols(object);
@@ -7925,12 +7925,12 @@ function ownKeys$P(object, enumerableOnly) {
7925
7925
  }
7926
7926
  return keys;
7927
7927
  }
7928
- function _object_spread_props$P(target, source) {
7928
+ function _object_spread_props$Q(target, source) {
7929
7929
  source = source != null ? source : {};
7930
7930
  if (Object.getOwnPropertyDescriptors) {
7931
7931
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
7932
7932
  } else {
7933
- ownKeys$P(Object(source)).forEach(function(key) {
7933
+ ownKeys$Q(Object(source)).forEach(function(key) {
7934
7934
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
7935
7935
  });
7936
7936
  }
@@ -8006,8 +8006,8 @@ var ChatCompletionRunner = /*#__PURE__*/ function(AbstractChatCompletionRunner)
8006
8006
  key: "runFunctions",
8007
8007
  value: /** @deprecated - please use `runTools` instead. */ function runFunctions(completions, params, options) {
8008
8008
  var runner = new ChatCompletionRunner();
8009
- var opts = _object_spread_props$P(_object_spread$15({}, options), {
8010
- headers: _object_spread_props$P(_object_spread$15({}, options === null || options === void 0 ? void 0 : options.headers), {
8009
+ var opts = _object_spread_props$Q(_object_spread$15({}, options), {
8010
+ headers: _object_spread_props$Q(_object_spread$15({}, options === null || options === void 0 ? void 0 : options.headers), {
8011
8011
  "X-Stainless-Helper-Method": "runFunctions"
8012
8012
  })
8013
8013
  });
@@ -8021,8 +8021,8 @@ var ChatCompletionRunner = /*#__PURE__*/ function(AbstractChatCompletionRunner)
8021
8021
  key: "runTools",
8022
8022
  value: function runTools(completions, params, options) {
8023
8023
  var runner = new ChatCompletionRunner();
8024
- var opts = _object_spread_props$P(_object_spread$15({}, options), {
8025
- headers: _object_spread_props$P(_object_spread$15({}, options === null || options === void 0 ? void 0 : options.headers), {
8024
+ var opts = _object_spread_props$Q(_object_spread$15({}, options), {
8025
+ headers: _object_spread_props$Q(_object_spread$15({}, options === null || options === void 0 ? void 0 : options.headers), {
8026
8026
  "X-Stainless-Helper-Method": "runTools"
8027
8027
  })
8028
8028
  });
@@ -8193,7 +8193,7 @@ function _object_spread$14(target) {
8193
8193
  }
8194
8194
  return target;
8195
8195
  }
8196
- function ownKeys$O(object, enumerableOnly) {
8196
+ function ownKeys$P(object, enumerableOnly) {
8197
8197
  var keys = Object.keys(object);
8198
8198
  if (Object.getOwnPropertySymbols) {
8199
8199
  var symbols = Object.getOwnPropertySymbols(object);
@@ -8206,12 +8206,12 @@ function ownKeys$O(object, enumerableOnly) {
8206
8206
  }
8207
8207
  return keys;
8208
8208
  }
8209
- function _object_spread_props$O(target, source) {
8209
+ function _object_spread_props$P(target, source) {
8210
8210
  source = source != null ? source : {};
8211
8211
  if (Object.getOwnPropertyDescriptors) {
8212
8212
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
8213
8213
  } else {
8214
- ownKeys$O(Object(source)).forEach(function(key) {
8214
+ ownKeys$P(Object(source)).forEach(function(key) {
8215
8215
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
8216
8216
  });
8217
8217
  }
@@ -8443,9 +8443,9 @@ var ChatCompletionStream = /*#__PURE__*/ function(AbstractChatCompletionRunner)
8443
8443
  __classPrivateFieldGet$3(_this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_beginRequest).call(_this);
8444
8444
  return [
8445
8445
  4,
8446
- completions.create(_object_spread_props$O(_object_spread$14({}, params), {
8446
+ completions.create(_object_spread_props$P(_object_spread$14({}, params), {
8447
8447
  stream: true
8448
- }), _object_spread_props$O(_object_spread$14({}, options), {
8448
+ }), _object_spread_props$P(_object_spread$14({}, options), {
8449
8449
  signal: _this.controller.signal
8450
8450
  }))
8451
8451
  ];
@@ -8689,7 +8689,7 @@ var ChatCompletionStream = /*#__PURE__*/ function(AbstractChatCompletionRunner)
8689
8689
  "choices"
8690
8690
  ]);
8691
8691
  if (!snapshot) {
8692
- snapshot = __classPrivateFieldSet$3(this, _ChatCompletionStream_currentChatCompletionSnapshot, _object_spread_props$O(_object_spread$14({}, rest), {
8692
+ snapshot = __classPrivateFieldSet$3(this, _ChatCompletionStream_currentChatCompletionSnapshot, _object_spread_props$P(_object_spread$14({}, rest), {
8693
8693
  choices: []
8694
8694
  }), "f");
8695
8695
  } else {
@@ -8981,10 +8981,10 @@ var ChatCompletionStream = /*#__PURE__*/ function(AbstractChatCompletionRunner)
8981
8981
  value: function createChatCompletion(completions, params, options) {
8982
8982
  var runner = new ChatCompletionStream();
8983
8983
  runner._run(function() {
8984
- return runner._runChatCompletion(completions, _object_spread_props$O(_object_spread$14({}, params), {
8984
+ return runner._runChatCompletion(completions, _object_spread_props$P(_object_spread$14({}, params), {
8985
8985
  stream: true
8986
- }), _object_spread_props$O(_object_spread$14({}, options), {
8987
- headers: _object_spread_props$O(_object_spread$14({}, options === null || options === void 0 ? void 0 : options.headers), {
8986
+ }), _object_spread_props$P(_object_spread$14({}, options), {
8987
+ headers: _object_spread_props$P(_object_spread$14({}, options === null || options === void 0 ? void 0 : options.headers), {
8988
8988
  "X-Stainless-Helper-Method": "stream"
8989
8989
  })
8990
8990
  }));
@@ -9003,7 +9003,7 @@ function finalizeChatCompletion(snapshot) {
9003
9003
  "model",
9004
9004
  "system_fingerprint"
9005
9005
  ]);
9006
- return _object_spread$14(_object_spread_props$O(_object_spread$14({}, rest), {
9006
+ return _object_spread$14(_object_spread_props$P(_object_spread$14({}, rest), {
9007
9007
  id: id,
9008
9008
  choices: choices.map(function(_param) {
9009
9009
  var message = _param.message, finish_reason = _param.finish_reason, index = _param.index, logprobs = _param.logprobs, choiceRest = _object_without_properties$7(_param, [
@@ -9024,7 +9024,7 @@ function finalizeChatCompletion(snapshot) {
9024
9024
  var args = function_call.arguments, name = function_call.name;
9025
9025
  if (args == null) throw new OpenAIError("missing function_call.arguments for choice ".concat(index));
9026
9026
  if (!name) throw new OpenAIError("missing function_call.name for choice ".concat(index));
9027
- return _object_spread_props$O(_object_spread$14({}, choiceRest), {
9027
+ return _object_spread_props$P(_object_spread$14({}, choiceRest), {
9028
9028
  message: {
9029
9029
  content: content,
9030
9030
  function_call: {
@@ -9039,11 +9039,11 @@ function finalizeChatCompletion(snapshot) {
9039
9039
  });
9040
9040
  }
9041
9041
  if (tool_calls) {
9042
- return _object_spread_props$O(_object_spread$14({}, choiceRest), {
9042
+ return _object_spread_props$P(_object_spread$14({}, choiceRest), {
9043
9043
  index: index,
9044
9044
  finish_reason: finish_reason,
9045
9045
  logprobs: logprobs,
9046
- message: _object_spread_props$O(_object_spread$14({}, messageRest), {
9046
+ message: _object_spread_props$P(_object_spread$14({}, messageRest), {
9047
9047
  role: role,
9048
9048
  content: content,
9049
9049
  tool_calls: tool_calls.map(function(tool_call, i) {
@@ -9060,10 +9060,10 @@ function finalizeChatCompletion(snapshot) {
9060
9060
  if (type == null) throw new OpenAIError("missing choices[".concat(index, "].tool_calls[").concat(i, "].type\n").concat(str(snapshot)));
9061
9061
  if (name == null) throw new OpenAIError("missing choices[".concat(index, "].tool_calls[").concat(i, "].function.name\n").concat(str(snapshot)));
9062
9062
  if (args == null) throw new OpenAIError("missing choices[".concat(index, "].tool_calls[").concat(i, "].function.arguments\n").concat(str(snapshot)));
9063
- return _object_spread_props$O(_object_spread$14({}, toolRest), {
9063
+ return _object_spread_props$P(_object_spread$14({}, toolRest), {
9064
9064
  id: id,
9065
9065
  type: type,
9066
- function: _object_spread_props$O(_object_spread$14({}, fnRest), {
9066
+ function: _object_spread_props$P(_object_spread$14({}, fnRest), {
9067
9067
  name: name,
9068
9068
  arguments: args
9069
9069
  })
@@ -9072,8 +9072,8 @@ function finalizeChatCompletion(snapshot) {
9072
9072
  })
9073
9073
  });
9074
9074
  }
9075
- return _object_spread_props$O(_object_spread$14({}, choiceRest), {
9076
- message: _object_spread_props$O(_object_spread$14({}, messageRest), {
9075
+ return _object_spread_props$P(_object_spread$14({}, choiceRest), {
9076
+ message: _object_spread_props$P(_object_spread$14({}, messageRest), {
9077
9077
  content: content,
9078
9078
  role: role
9079
9079
  }),
@@ -9165,7 +9165,7 @@ function _object_spread$13(target) {
9165
9165
  }
9166
9166
  return target;
9167
9167
  }
9168
- function ownKeys$N(object, enumerableOnly) {
9168
+ function ownKeys$O(object, enumerableOnly) {
9169
9169
  var keys = Object.keys(object);
9170
9170
  if (Object.getOwnPropertySymbols) {
9171
9171
  var symbols = Object.getOwnPropertySymbols(object);
@@ -9178,12 +9178,12 @@ function ownKeys$N(object, enumerableOnly) {
9178
9178
  }
9179
9179
  return keys;
9180
9180
  }
9181
- function _object_spread_props$N(target, source) {
9181
+ function _object_spread_props$O(target, source) {
9182
9182
  source = source != null ? source : {};
9183
9183
  if (Object.getOwnPropertyDescriptors) {
9184
9184
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
9185
9185
  } else {
9186
- ownKeys$N(Object(source)).forEach(function(key) {
9186
+ ownKeys$O(Object(source)).forEach(function(key) {
9187
9187
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
9188
9188
  });
9189
9189
  }
@@ -9252,8 +9252,8 @@ var ChatCompletionStreamingRunner = /*#__PURE__*/ function(ChatCompletionStream)
9252
9252
  key: "runFunctions",
9253
9253
  value: /** @deprecated - please use `runTools` instead. */ function runFunctions(completions, params, options) {
9254
9254
  var runner = new ChatCompletionStreamingRunner();
9255
- var opts = _object_spread_props$N(_object_spread$13({}, options), {
9256
- headers: _object_spread_props$N(_object_spread$13({}, options === null || options === void 0 ? void 0 : options.headers), {
9255
+ var opts = _object_spread_props$O(_object_spread$13({}, options), {
9256
+ headers: _object_spread_props$O(_object_spread$13({}, options === null || options === void 0 ? void 0 : options.headers), {
9257
9257
  "X-Stainless-Helper-Method": "runFunctions"
9258
9258
  })
9259
9259
  });
@@ -9267,8 +9267,8 @@ var ChatCompletionStreamingRunner = /*#__PURE__*/ function(ChatCompletionStream)
9267
9267
  key: "runTools",
9268
9268
  value: function runTools(completions, params, options) {
9269
9269
  var runner = new ChatCompletionStreamingRunner();
9270
- var opts = _object_spread_props$N(_object_spread$13({}, options), {
9271
- headers: _object_spread_props$N(_object_spread$13({}, options === null || options === void 0 ? void 0 : options.headers), {
9270
+ var opts = _object_spread_props$O(_object_spread$13({}, options), {
9271
+ headers: _object_spread_props$O(_object_spread$13({}, options === null || options === void 0 ? void 0 : options.headers), {
9272
9272
  "X-Stainless-Helper-Method": "runTools"
9273
9273
  })
9274
9274
  });
@@ -9595,7 +9595,7 @@ function _object_spread$12(target) {
9595
9595
  }
9596
9596
  return target;
9597
9597
  }
9598
- function ownKeys$M(object, enumerableOnly) {
9598
+ function ownKeys$N(object, enumerableOnly) {
9599
9599
  var keys = Object.keys(object);
9600
9600
  if (Object.getOwnPropertySymbols) {
9601
9601
  var symbols = Object.getOwnPropertySymbols(object);
@@ -9608,12 +9608,12 @@ function ownKeys$M(object, enumerableOnly) {
9608
9608
  }
9609
9609
  return keys;
9610
9610
  }
9611
- function _object_spread_props$M(target, source) {
9611
+ function _object_spread_props$N(target, source) {
9612
9612
  source = source != null ? source : {};
9613
9613
  if (Object.getOwnPropertyDescriptors) {
9614
9614
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
9615
9615
  } else {
9616
- ownKeys$M(Object(source)).forEach(function(key) {
9616
+ ownKeys$N(Object(source)).forEach(function(key) {
9617
9617
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
9618
9618
  });
9619
9619
  }
@@ -10070,9 +10070,9 @@ var AbstractAssistantStreamRunner = /*#__PURE__*/ function() {
10070
10070
  }
10071
10071
  return [
10072
10072
  4,
10073
- thread.createAndRun(_object_spread_props$M(_object_spread$12({}, body), {
10073
+ thread.createAndRun(_object_spread_props$N(_object_spread$12({}, body), {
10074
10074
  stream: false
10075
- }), _object_spread_props$M(_object_spread$12({}, options), {
10075
+ }), _object_spread_props$N(_object_spread$12({}, options), {
10076
10076
  signal: _this.controller.signal
10077
10077
  }))
10078
10078
  ];
@@ -10106,9 +10106,9 @@ var AbstractAssistantStreamRunner = /*#__PURE__*/ function() {
10106
10106
  }
10107
10107
  return [
10108
10108
  4,
10109
- run.submitToolOutputs(threadId, runId, _object_spread_props$M(_object_spread$12({}, params), {
10109
+ run.submitToolOutputs(threadId, runId, _object_spread_props$N(_object_spread$12({}, params), {
10110
10110
  stream: false
10111
- }), _object_spread_props$M(_object_spread$12({}, options), {
10111
+ }), _object_spread_props$N(_object_spread$12({}, options), {
10112
10112
  signal: _this.controller.signal
10113
10113
  }))
10114
10114
  ];
@@ -10142,9 +10142,9 @@ var AbstractAssistantStreamRunner = /*#__PURE__*/ function() {
10142
10142
  }
10143
10143
  return [
10144
10144
  4,
10145
- run.create(threadId, _object_spread_props$M(_object_spread$12({}, params), {
10145
+ run.create(threadId, _object_spread_props$N(_object_spread$12({}, params), {
10146
10146
  stream: false
10147
- }), _object_spread_props$M(_object_spread$12({}, options), {
10147
+ }), _object_spread_props$N(_object_spread$12({}, options), {
10148
10148
  signal: _this.controller.signal
10149
10149
  }))
10150
10150
  ];
@@ -10351,7 +10351,7 @@ function _object_spread$11(target) {
10351
10351
  }
10352
10352
  return target;
10353
10353
  }
10354
- function ownKeys$L(object, enumerableOnly) {
10354
+ function ownKeys$M(object, enumerableOnly) {
10355
10355
  var keys = Object.keys(object);
10356
10356
  if (Object.getOwnPropertySymbols) {
10357
10357
  var symbols = Object.getOwnPropertySymbols(object);
@@ -10364,12 +10364,12 @@ function ownKeys$L(object, enumerableOnly) {
10364
10364
  }
10365
10365
  return keys;
10366
10366
  }
10367
- function _object_spread_props$L(target, source) {
10367
+ function _object_spread_props$M(target, source) {
10368
10368
  source = source != null ? source : {};
10369
10369
  if (Object.getOwnPropertyDescriptors) {
10370
10370
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
10371
10371
  } else {
10372
- ownKeys$L(Object(source)).forEach(function(key) {
10372
+ ownKeys$M(Object(source)).forEach(function(key) {
10373
10373
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
10374
10374
  });
10375
10375
  }
@@ -10843,12 +10843,12 @@ var AssistantStream = /*#__PURE__*/ function(AbstractAssistantStreamRunner) {
10843
10843
  return _this.controller.abort();
10844
10844
  });
10845
10845
  }
10846
- body = _object_spread_props$L(_object_spread$11({}, params), {
10846
+ body = _object_spread_props$M(_object_spread$11({}, params), {
10847
10847
  stream: true
10848
10848
  });
10849
10849
  return [
10850
10850
  4,
10851
- run.submitToolOutputs(threadId, runId, body, _object_spread_props$L(_object_spread$11({}, options), {
10851
+ run.submitToolOutputs(threadId, runId, body, _object_spread_props$M(_object_spread$11({}, options), {
10852
10852
  signal: _this.controller.signal
10853
10853
  }))
10854
10854
  ];
@@ -11056,12 +11056,12 @@ var AssistantStream = /*#__PURE__*/ function(AbstractAssistantStreamRunner) {
11056
11056
  return _this.controller.abort();
11057
11057
  });
11058
11058
  }
11059
- body = _object_spread_props$L(_object_spread$11({}, params), {
11059
+ body = _object_spread_props$M(_object_spread$11({}, params), {
11060
11060
  stream: true
11061
11061
  });
11062
11062
  return [
11063
11063
  4,
11064
- thread.createAndRun(body, _object_spread_props$L(_object_spread$11({}, options), {
11064
+ thread.createAndRun(body, _object_spread_props$M(_object_spread$11({}, options), {
11065
11065
  signal: _this.controller.signal
11066
11066
  }))
11067
11067
  ];
@@ -11175,12 +11175,12 @@ var AssistantStream = /*#__PURE__*/ function(AbstractAssistantStreamRunner) {
11175
11175
  return _this.controller.abort();
11176
11176
  });
11177
11177
  }
11178
- body = _object_spread_props$L(_object_spread$11({}, params), {
11178
+ body = _object_spread_props$M(_object_spread$11({}, params), {
11179
11179
  stream: true
11180
11180
  });
11181
11181
  return [
11182
11182
  4,
11183
- run.create(threadId, body, _object_spread_props$L(_object_spread$11({}, options), {
11183
+ run.create(threadId, body, _object_spread_props$M(_object_spread$11({}, options), {
11184
11184
  signal: _this.controller.signal
11185
11185
  }))
11186
11186
  ];
@@ -11294,8 +11294,8 @@ var AssistantStream = /*#__PURE__*/ function(AbstractAssistantStreamRunner) {
11294
11294
  value: function createToolAssistantStream(threadId, runId, runs, body, options) {
11295
11295
  var runner = new AssistantStream();
11296
11296
  runner._run(function() {
11297
- return runner._runToolAssistantStream(threadId, runId, runs, body, _object_spread_props$L(_object_spread$11({}, options), {
11298
- headers: _object_spread_props$L(_object_spread$11({}, options === null || options === void 0 ? void 0 : options.headers), {
11297
+ return runner._runToolAssistantStream(threadId, runId, runs, body, _object_spread_props$M(_object_spread$11({}, options), {
11298
+ headers: _object_spread_props$M(_object_spread$11({}, options === null || options === void 0 ? void 0 : options.headers), {
11299
11299
  "X-Stainless-Helper-Method": "stream"
11300
11300
  })
11301
11301
  }));
@@ -11308,8 +11308,8 @@ var AssistantStream = /*#__PURE__*/ function(AbstractAssistantStreamRunner) {
11308
11308
  value: function createThreadAssistantStream(body, thread, options) {
11309
11309
  var runner = new AssistantStream();
11310
11310
  runner._run(function() {
11311
- return runner._threadAssistantStream(body, thread, _object_spread_props$L(_object_spread$11({}, options), {
11312
- headers: _object_spread_props$L(_object_spread$11({}, options === null || options === void 0 ? void 0 : options.headers), {
11311
+ return runner._threadAssistantStream(body, thread, _object_spread_props$M(_object_spread$11({}, options), {
11312
+ headers: _object_spread_props$M(_object_spread$11({}, options === null || options === void 0 ? void 0 : options.headers), {
11313
11313
  "X-Stainless-Helper-Method": "stream"
11314
11314
  })
11315
11315
  }));
@@ -11322,8 +11322,8 @@ var AssistantStream = /*#__PURE__*/ function(AbstractAssistantStreamRunner) {
11322
11322
  value: function createAssistantStream(threadId, runs, params, options) {
11323
11323
  var runner = new AssistantStream();
11324
11324
  runner._run(function() {
11325
- return runner._runAssistantStream(threadId, runs, params, _object_spread_props$L(_object_spread$11({}, options), {
11326
- headers: _object_spread_props$L(_object_spread$11({}, options === null || options === void 0 ? void 0 : options.headers), {
11325
+ return runner._runAssistantStream(threadId, runs, params, _object_spread_props$M(_object_spread$11({}, options), {
11326
+ headers: _object_spread_props$M(_object_spread$11({}, options === null || options === void 0 ? void 0 : options.headers), {
11327
11327
  "X-Stainless-Helper-Method": "stream"
11328
11328
  })
11329
11329
  }));
@@ -11785,7 +11785,7 @@ function _object_spread$10(target) {
11785
11785
  }
11786
11786
  return target;
11787
11787
  }
11788
- function ownKeys$K(object, enumerableOnly) {
11788
+ function ownKeys$L(object, enumerableOnly) {
11789
11789
  var keys = Object.keys(object);
11790
11790
  if (Object.getOwnPropertySymbols) {
11791
11791
  var symbols = Object.getOwnPropertySymbols(object);
@@ -11798,12 +11798,12 @@ function ownKeys$K(object, enumerableOnly) {
11798
11798
  }
11799
11799
  return keys;
11800
11800
  }
11801
- function _object_spread_props$K(target, source) {
11801
+ function _object_spread_props$L(target, source) {
11802
11802
  source = source != null ? source : {};
11803
11803
  if (Object.getOwnPropertyDescriptors) {
11804
11804
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
11805
11805
  } else {
11806
- ownKeys$K(Object(source)).forEach(function(key) {
11806
+ ownKeys$L(Object(source)).forEach(function(key) {
11807
11807
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
11808
11808
  });
11809
11809
  }
@@ -11863,7 +11863,7 @@ var Messages = /*#__PURE__*/ function(APIResource) {
11863
11863
  * Create a message.
11864
11864
  */ key: "create",
11865
11865
  value: function create(threadId, body, options) {
11866
- return this._client.post("/threads/".concat(threadId, "/messages"), _object_spread_props$K(_object_spread$10({
11866
+ return this._client.post("/threads/".concat(threadId, "/messages"), _object_spread_props$L(_object_spread$10({
11867
11867
  body: body
11868
11868
  }, options), {
11869
11869
  headers: _object_spread$10({
@@ -11877,7 +11877,7 @@ var Messages = /*#__PURE__*/ function(APIResource) {
11877
11877
  * Retrieve a message.
11878
11878
  */ key: "retrieve",
11879
11879
  value: function retrieve(threadId, messageId, options) {
11880
- return this._client.get("/threads/".concat(threadId, "/messages/").concat(messageId), _object_spread_props$K(_object_spread$10({}, options), {
11880
+ return this._client.get("/threads/".concat(threadId, "/messages/").concat(messageId), _object_spread_props$L(_object_spread$10({}, options), {
11881
11881
  headers: _object_spread$10({
11882
11882
  "OpenAI-Beta": "assistants=v2"
11883
11883
  }, options === null || options === void 0 ? void 0 : options.headers)
@@ -11889,7 +11889,7 @@ var Messages = /*#__PURE__*/ function(APIResource) {
11889
11889
  * Modifies a message.
11890
11890
  */ key: "update",
11891
11891
  value: function update(threadId, messageId, body, options) {
11892
- return this._client.post("/threads/".concat(threadId, "/messages/").concat(messageId), _object_spread_props$K(_object_spread$10({
11892
+ return this._client.post("/threads/".concat(threadId, "/messages/").concat(messageId), _object_spread_props$L(_object_spread$10({
11893
11893
  body: body
11894
11894
  }, options), {
11895
11895
  headers: _object_spread$10({
@@ -11905,7 +11905,7 @@ var Messages = /*#__PURE__*/ function(APIResource) {
11905
11905
  if (isRequestOptions(query)) {
11906
11906
  return this.list(threadId, {}, query);
11907
11907
  }
11908
- return this._client.getAPIList("/threads/".concat(threadId, "/messages"), MessagesPage, _object_spread_props$K(_object_spread$10({
11908
+ return this._client.getAPIList("/threads/".concat(threadId, "/messages"), MessagesPage, _object_spread_props$L(_object_spread$10({
11909
11909
  query: query
11910
11910
  }, options), {
11911
11911
  headers: _object_spread$10({
@@ -11919,7 +11919,7 @@ var Messages = /*#__PURE__*/ function(APIResource) {
11919
11919
  * Deletes a message.
11920
11920
  */ key: "del",
11921
11921
  value: function del(threadId, messageId, options) {
11922
- return this._client.delete("/threads/".concat(threadId, "/messages/").concat(messageId), _object_spread_props$K(_object_spread$10({}, options), {
11922
+ return this._client.delete("/threads/".concat(threadId, "/messages/").concat(messageId), _object_spread_props$L(_object_spread$10({}, options), {
11923
11923
  headers: _object_spread$10({
11924
11924
  "OpenAI-Beta": "assistants=v2"
11925
11925
  }, options === null || options === void 0 ? void 0 : options.headers)
@@ -12015,7 +12015,7 @@ function _object_spread$$(target) {
12015
12015
  }
12016
12016
  return target;
12017
12017
  }
12018
- function ownKeys$J(object, enumerableOnly) {
12018
+ function ownKeys$K(object, enumerableOnly) {
12019
12019
  var keys = Object.keys(object);
12020
12020
  if (Object.getOwnPropertySymbols) {
12021
12021
  var symbols = Object.getOwnPropertySymbols(object);
@@ -12028,12 +12028,12 @@ function ownKeys$J(object, enumerableOnly) {
12028
12028
  }
12029
12029
  return keys;
12030
12030
  }
12031
- function _object_spread_props$J(target, source) {
12031
+ function _object_spread_props$K(target, source) {
12032
12032
  source = source != null ? source : {};
12033
12033
  if (Object.getOwnPropertyDescriptors) {
12034
12034
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
12035
12035
  } else {
12036
- ownKeys$J(Object(source)).forEach(function(key) {
12036
+ ownKeys$K(Object(source)).forEach(function(key) {
12037
12037
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
12038
12038
  });
12039
12039
  }
@@ -12093,7 +12093,7 @@ var Steps = /*#__PURE__*/ function(APIResource) {
12093
12093
  * Retrieves a run step.
12094
12094
  */ key: "retrieve",
12095
12095
  value: function retrieve(threadId, runId, stepId, options) {
12096
- return this._client.get("/threads/".concat(threadId, "/runs/").concat(runId, "/steps/").concat(stepId), _object_spread_props$J(_object_spread$$({}, options), {
12096
+ return this._client.get("/threads/".concat(threadId, "/runs/").concat(runId, "/steps/").concat(stepId), _object_spread_props$K(_object_spread$$({}, options), {
12097
12097
  headers: _object_spread$$({
12098
12098
  "OpenAI-Beta": "assistants=v2"
12099
12099
  }, options === null || options === void 0 ? void 0 : options.headers)
@@ -12107,7 +12107,7 @@ var Steps = /*#__PURE__*/ function(APIResource) {
12107
12107
  if (isRequestOptions(query)) {
12108
12108
  return this.list(threadId, runId, {}, query);
12109
12109
  }
12110
- return this._client.getAPIList("/threads/".concat(threadId, "/runs/").concat(runId, "/steps"), RunStepsPage, _object_spread_props$J(_object_spread$$({
12110
+ return this._client.getAPIList("/threads/".concat(threadId, "/runs/").concat(runId, "/steps"), RunStepsPage, _object_spread_props$K(_object_spread$$({
12111
12111
  query: query
12112
12112
  }, options), {
12113
12113
  headers: _object_spread$$({
@@ -12234,7 +12234,7 @@ function _object_spread$_(target) {
12234
12234
  }
12235
12235
  return target;
12236
12236
  }
12237
- function ownKeys$I(object, enumerableOnly) {
12237
+ function ownKeys$J(object, enumerableOnly) {
12238
12238
  var keys = Object.keys(object);
12239
12239
  if (Object.getOwnPropertySymbols) {
12240
12240
  var symbols = Object.getOwnPropertySymbols(object);
@@ -12247,12 +12247,12 @@ function ownKeys$I(object, enumerableOnly) {
12247
12247
  }
12248
12248
  return keys;
12249
12249
  }
12250
- function _object_spread_props$I(target, source) {
12250
+ function _object_spread_props$J(target, source) {
12251
12251
  source = source != null ? source : {};
12252
12252
  if (Object.getOwnPropertyDescriptors) {
12253
12253
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
12254
12254
  } else {
12255
- ownKeys$I(Object(source)).forEach(function(key) {
12255
+ ownKeys$J(Object(source)).forEach(function(key) {
12256
12256
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
12257
12257
  });
12258
12258
  }
@@ -12411,7 +12411,7 @@ var Runs = /*#__PURE__*/ function(APIResource) {
12411
12411
  key: "create",
12412
12412
  value: function create(threadId, body, options) {
12413
12413
  var _body_stream;
12414
- return this._client.post("/threads/".concat(threadId, "/runs"), _object_spread_props$I(_object_spread$_({
12414
+ return this._client.post("/threads/".concat(threadId, "/runs"), _object_spread_props$J(_object_spread$_({
12415
12415
  body: body
12416
12416
  }, options), {
12417
12417
  headers: _object_spread$_({
@@ -12426,7 +12426,7 @@ var Runs = /*#__PURE__*/ function(APIResource) {
12426
12426
  * Retrieves a run.
12427
12427
  */ key: "retrieve",
12428
12428
  value: function retrieve(threadId, runId, options) {
12429
- return this._client.get("/threads/".concat(threadId, "/runs/").concat(runId), _object_spread_props$I(_object_spread$_({}, options), {
12429
+ return this._client.get("/threads/".concat(threadId, "/runs/").concat(runId), _object_spread_props$J(_object_spread$_({}, options), {
12430
12430
  headers: _object_spread$_({
12431
12431
  "OpenAI-Beta": "assistants=v2"
12432
12432
  }, options === null || options === void 0 ? void 0 : options.headers)
@@ -12438,7 +12438,7 @@ var Runs = /*#__PURE__*/ function(APIResource) {
12438
12438
  * Modifies a run.
12439
12439
  */ key: "update",
12440
12440
  value: function update(threadId, runId, body, options) {
12441
- return this._client.post("/threads/".concat(threadId, "/runs/").concat(runId), _object_spread_props$I(_object_spread$_({
12441
+ return this._client.post("/threads/".concat(threadId, "/runs/").concat(runId), _object_spread_props$J(_object_spread$_({
12442
12442
  body: body
12443
12443
  }, options), {
12444
12444
  headers: _object_spread$_({
@@ -12454,7 +12454,7 @@ var Runs = /*#__PURE__*/ function(APIResource) {
12454
12454
  if (isRequestOptions(query)) {
12455
12455
  return this.list(threadId, {}, query);
12456
12456
  }
12457
- return this._client.getAPIList("/threads/".concat(threadId, "/runs"), RunsPage, _object_spread_props$I(_object_spread$_({
12457
+ return this._client.getAPIList("/threads/".concat(threadId, "/runs"), RunsPage, _object_spread_props$J(_object_spread$_({
12458
12458
  query: query
12459
12459
  }, options), {
12460
12460
  headers: _object_spread$_({
@@ -12468,7 +12468,7 @@ var Runs = /*#__PURE__*/ function(APIResource) {
12468
12468
  * Cancels a run that is `in_progress`.
12469
12469
  */ key: "cancel",
12470
12470
  value: function cancel(threadId, runId, options) {
12471
- return this._client.post("/threads/".concat(threadId, "/runs/").concat(runId, "/cancel"), _object_spread_props$I(_object_spread$_({}, options), {
12471
+ return this._client.post("/threads/".concat(threadId, "/runs/").concat(runId, "/cancel"), _object_spread_props$J(_object_spread$_({}, options), {
12472
12472
  headers: _object_spread$_({
12473
12473
  "OpenAI-Beta": "assistants=v2"
12474
12474
  }, options === null || options === void 0 ? void 0 : options.headers)
@@ -12531,7 +12531,7 @@ var Runs = /*#__PURE__*/ function(APIResource) {
12531
12531
  return _ts_generator$E(this, function(_state) {
12532
12532
  switch(_state.label){
12533
12533
  case 0:
12534
- headers = _object_spread_props$I(_object_spread$_({}, options === null || options === void 0 ? void 0 : options.headers), {
12534
+ headers = _object_spread_props$J(_object_spread$_({}, options === null || options === void 0 ? void 0 : options.headers), {
12535
12535
  "X-Stainless-Poll-Helper": "true"
12536
12536
  });
12537
12537
  if (options === null || options === void 0 ? void 0 : options.pollIntervalMs) {
@@ -12541,7 +12541,7 @@ var Runs = /*#__PURE__*/ function(APIResource) {
12541
12541
  case 1:
12542
12542
  return [
12543
12543
  4,
12544
- _this.retrieve(threadId, runId, _object_spread_props$I(_object_spread$_({}, options), {
12544
+ _this.retrieve(threadId, runId, _object_spread_props$J(_object_spread$_({}, options), {
12545
12545
  headers: _object_spread$_({}, options === null || options === void 0 ? void 0 : options.headers, headers)
12546
12546
  })).withResponse()
12547
12547
  ];
@@ -12653,7 +12653,7 @@ var Runs = /*#__PURE__*/ function(APIResource) {
12653
12653
  key: "submitToolOutputs",
12654
12654
  value: function submitToolOutputs(threadId, runId, body, options) {
12655
12655
  var _body_stream;
12656
- return this._client.post("/threads/".concat(threadId, "/runs/").concat(runId, "/submit_tool_outputs"), _object_spread_props$I(_object_spread$_({
12656
+ return this._client.post("/threads/".concat(threadId, "/runs/").concat(runId, "/submit_tool_outputs"), _object_spread_props$J(_object_spread$_({
12657
12657
  body: body
12658
12658
  }, options), {
12659
12659
  headers: _object_spread$_({
@@ -12826,7 +12826,7 @@ function _object_spread$Z(target) {
12826
12826
  }
12827
12827
  return target;
12828
12828
  }
12829
- function ownKeys$H(object, enumerableOnly) {
12829
+ function ownKeys$I(object, enumerableOnly) {
12830
12830
  var keys = Object.keys(object);
12831
12831
  if (Object.getOwnPropertySymbols) {
12832
12832
  var symbols = Object.getOwnPropertySymbols(object);
@@ -12839,12 +12839,12 @@ function ownKeys$H(object, enumerableOnly) {
12839
12839
  }
12840
12840
  return keys;
12841
12841
  }
12842
- function _object_spread_props$H(target, source) {
12842
+ function _object_spread_props$I(target, source) {
12843
12843
  source = source != null ? source : {};
12844
12844
  if (Object.getOwnPropertyDescriptors) {
12845
12845
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
12846
12846
  } else {
12847
- ownKeys$H(Object(source)).forEach(function(key) {
12847
+ ownKeys$I(Object(source)).forEach(function(key) {
12848
12848
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
12849
12849
  });
12850
12850
  }
@@ -13007,7 +13007,7 @@ var Threads = /*#__PURE__*/ function(APIResource) {
13007
13007
  if (isRequestOptions(body)) {
13008
13008
  return this.create({}, body);
13009
13009
  }
13010
- return this._client.post("/threads", _object_spread_props$H(_object_spread$Z({
13010
+ return this._client.post("/threads", _object_spread_props$I(_object_spread$Z({
13011
13011
  body: body
13012
13012
  }, options), {
13013
13013
  headers: _object_spread$Z({
@@ -13021,7 +13021,7 @@ var Threads = /*#__PURE__*/ function(APIResource) {
13021
13021
  * Retrieves a thread.
13022
13022
  */ key: "retrieve",
13023
13023
  value: function retrieve(threadId, options) {
13024
- return this._client.get("/threads/".concat(threadId), _object_spread_props$H(_object_spread$Z({}, options), {
13024
+ return this._client.get("/threads/".concat(threadId), _object_spread_props$I(_object_spread$Z({}, options), {
13025
13025
  headers: _object_spread$Z({
13026
13026
  "OpenAI-Beta": "assistants=v2"
13027
13027
  }, options === null || options === void 0 ? void 0 : options.headers)
@@ -13033,7 +13033,7 @@ var Threads = /*#__PURE__*/ function(APIResource) {
13033
13033
  * Modifies a thread.
13034
13034
  */ key: "update",
13035
13035
  value: function update(threadId, body, options) {
13036
- return this._client.post("/threads/".concat(threadId), _object_spread_props$H(_object_spread$Z({
13036
+ return this._client.post("/threads/".concat(threadId), _object_spread_props$I(_object_spread$Z({
13037
13037
  body: body
13038
13038
  }, options), {
13039
13039
  headers: _object_spread$Z({
@@ -13047,7 +13047,7 @@ var Threads = /*#__PURE__*/ function(APIResource) {
13047
13047
  * Delete a thread.
13048
13048
  */ key: "del",
13049
13049
  value: function del(threadId, options) {
13050
- return this._client.delete("/threads/".concat(threadId), _object_spread_props$H(_object_spread$Z({}, options), {
13050
+ return this._client.delete("/threads/".concat(threadId), _object_spread_props$I(_object_spread$Z({}, options), {
13051
13051
  headers: _object_spread$Z({
13052
13052
  "OpenAI-Beta": "assistants=v2"
13053
13053
  }, options === null || options === void 0 ? void 0 : options.headers)
@@ -13058,7 +13058,7 @@ var Threads = /*#__PURE__*/ function(APIResource) {
13058
13058
  key: "createAndRun",
13059
13059
  value: function createAndRun(body, options) {
13060
13060
  var _body_stream;
13061
- return this._client.post("/threads/runs", _object_spread_props$H(_object_spread$Z({
13061
+ return this._client.post("/threads/runs", _object_spread_props$I(_object_spread$Z({
13062
13062
  body: body
13063
13063
  }, options), {
13064
13064
  headers: _object_spread$Z({
@@ -13421,7 +13421,7 @@ function _object_spread$Y(target) {
13421
13421
  }
13422
13422
  return target;
13423
13423
  }
13424
- function ownKeys$G(object, enumerableOnly) {
13424
+ function ownKeys$H(object, enumerableOnly) {
13425
13425
  var keys = Object.keys(object);
13426
13426
  if (Object.getOwnPropertySymbols) {
13427
13427
  var symbols = Object.getOwnPropertySymbols(object);
@@ -13434,12 +13434,12 @@ function ownKeys$G(object, enumerableOnly) {
13434
13434
  }
13435
13435
  return keys;
13436
13436
  }
13437
- function _object_spread_props$G(target, source) {
13437
+ function _object_spread_props$H(target, source) {
13438
13438
  source = source != null ? source : {};
13439
13439
  if (Object.getOwnPropertyDescriptors) {
13440
13440
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
13441
13441
  } else {
13442
- ownKeys$G(Object(source)).forEach(function(key) {
13442
+ ownKeys$H(Object(source)).forEach(function(key) {
13443
13443
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
13444
13444
  });
13445
13445
  }
@@ -13596,7 +13596,7 @@ var Files$1 = /*#__PURE__*/ function(APIResource) {
13596
13596
  * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object).
13597
13597
  */ key: "create",
13598
13598
  value: function create(vectorStoreId, body, options) {
13599
- return this._client.post("/vector_stores/".concat(vectorStoreId, "/files"), _object_spread_props$G(_object_spread$Y({
13599
+ return this._client.post("/vector_stores/".concat(vectorStoreId, "/files"), _object_spread_props$H(_object_spread$Y({
13600
13600
  body: body
13601
13601
  }, options), {
13602
13602
  headers: _object_spread$Y({
@@ -13610,7 +13610,7 @@ var Files$1 = /*#__PURE__*/ function(APIResource) {
13610
13610
  * Retrieves a vector store file.
13611
13611
  */ key: "retrieve",
13612
13612
  value: function retrieve(vectorStoreId, fileId, options) {
13613
- return this._client.get("/vector_stores/".concat(vectorStoreId, "/files/").concat(fileId), _object_spread_props$G(_object_spread$Y({}, options), {
13613
+ return this._client.get("/vector_stores/".concat(vectorStoreId, "/files/").concat(fileId), _object_spread_props$H(_object_spread$Y({}, options), {
13614
13614
  headers: _object_spread$Y({
13615
13615
  "OpenAI-Beta": "assistants=v2"
13616
13616
  }, options === null || options === void 0 ? void 0 : options.headers)
@@ -13624,7 +13624,7 @@ var Files$1 = /*#__PURE__*/ function(APIResource) {
13624
13624
  if (isRequestOptions(query)) {
13625
13625
  return this.list(vectorStoreId, {}, query);
13626
13626
  }
13627
- return this._client.getAPIList("/vector_stores/".concat(vectorStoreId, "/files"), VectorStoreFilesPage, _object_spread_props$G(_object_spread$Y({
13627
+ return this._client.getAPIList("/vector_stores/".concat(vectorStoreId, "/files"), VectorStoreFilesPage, _object_spread_props$H(_object_spread$Y({
13628
13628
  query: query
13629
13629
  }, options), {
13630
13630
  headers: _object_spread$Y({
@@ -13641,7 +13641,7 @@ var Files$1 = /*#__PURE__*/ function(APIResource) {
13641
13641
  * endpoint.
13642
13642
  */ key: "del",
13643
13643
  value: function del(vectorStoreId, fileId, options) {
13644
- return this._client.delete("/vector_stores/".concat(vectorStoreId, "/files/").concat(fileId), _object_spread_props$G(_object_spread$Y({}, options), {
13644
+ return this._client.delete("/vector_stores/".concat(vectorStoreId, "/files/").concat(fileId), _object_spread_props$H(_object_spread$Y({}, options), {
13645
13645
  headers: _object_spread$Y({
13646
13646
  "OpenAI-Beta": "assistants=v2"
13647
13647
  }, options === null || options === void 0 ? void 0 : options.headers)
@@ -13693,7 +13693,7 @@ var Files$1 = /*#__PURE__*/ function(APIResource) {
13693
13693
  return _ts_generator$B(this, function(_state) {
13694
13694
  switch(_state.label){
13695
13695
  case 0:
13696
- headers = _object_spread_props$G(_object_spread$Y({}, options === null || options === void 0 ? void 0 : options.headers), {
13696
+ headers = _object_spread_props$H(_object_spread$Y({}, options === null || options === void 0 ? void 0 : options.headers), {
13697
13697
  "X-Stainless-Poll-Helper": "true"
13698
13698
  });
13699
13699
  if (options === null || options === void 0 ? void 0 : options.pollIntervalMs) {
@@ -13703,7 +13703,7 @@ var Files$1 = /*#__PURE__*/ function(APIResource) {
13703
13703
  case 1:
13704
13704
  return [
13705
13705
  4,
13706
- _this.retrieve(vectorStoreId, fileId, _object_spread_props$G(_object_spread$Y({}, options), {
13706
+ _this.retrieve(vectorStoreId, fileId, _object_spread_props$H(_object_spread$Y({}, options), {
13707
13707
  headers: headers
13708
13708
  })).withResponse()
13709
13709
  ];
@@ -13971,7 +13971,7 @@ function _object_spread$X(target) {
13971
13971
  }
13972
13972
  return target;
13973
13973
  }
13974
- function ownKeys$F(object, enumerableOnly) {
13974
+ function ownKeys$G(object, enumerableOnly) {
13975
13975
  var keys = Object.keys(object);
13976
13976
  if (Object.getOwnPropertySymbols) {
13977
13977
  var symbols = Object.getOwnPropertySymbols(object);
@@ -13984,12 +13984,12 @@ function ownKeys$F(object, enumerableOnly) {
13984
13984
  }
13985
13985
  return keys;
13986
13986
  }
13987
- function _object_spread_props$F(target, source) {
13987
+ function _object_spread_props$G(target, source) {
13988
13988
  source = source != null ? source : {};
13989
13989
  if (Object.getOwnPropertyDescriptors) {
13990
13990
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
13991
13991
  } else {
13992
- ownKeys$F(Object(source)).forEach(function(key) {
13992
+ ownKeys$G(Object(source)).forEach(function(key) {
13993
13993
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
13994
13994
  });
13995
13995
  }
@@ -14155,7 +14155,7 @@ var FileBatches = /*#__PURE__*/ function(APIResource) {
14155
14155
  * Create a vector store file batch.
14156
14156
  */ key: "create",
14157
14157
  value: function create(vectorStoreId, body, options) {
14158
- return this._client.post("/vector_stores/".concat(vectorStoreId, "/file_batches"), _object_spread_props$F(_object_spread$X({
14158
+ return this._client.post("/vector_stores/".concat(vectorStoreId, "/file_batches"), _object_spread_props$G(_object_spread$X({
14159
14159
  body: body
14160
14160
  }, options), {
14161
14161
  headers: _object_spread$X({
@@ -14169,7 +14169,7 @@ var FileBatches = /*#__PURE__*/ function(APIResource) {
14169
14169
  * Retrieves a vector store file batch.
14170
14170
  */ key: "retrieve",
14171
14171
  value: function retrieve(vectorStoreId, batchId, options) {
14172
- return this._client.get("/vector_stores/".concat(vectorStoreId, "/file_batches/").concat(batchId), _object_spread_props$F(_object_spread$X({}, options), {
14172
+ return this._client.get("/vector_stores/".concat(vectorStoreId, "/file_batches/").concat(batchId), _object_spread_props$G(_object_spread$X({}, options), {
14173
14173
  headers: _object_spread$X({
14174
14174
  "OpenAI-Beta": "assistants=v2"
14175
14175
  }, options === null || options === void 0 ? void 0 : options.headers)
@@ -14182,7 +14182,7 @@ var FileBatches = /*#__PURE__*/ function(APIResource) {
14182
14182
  * files in this batch as soon as possible.
14183
14183
  */ key: "cancel",
14184
14184
  value: function cancel(vectorStoreId, batchId, options) {
14185
- return this._client.post("/vector_stores/".concat(vectorStoreId, "/file_batches/").concat(batchId, "/cancel"), _object_spread_props$F(_object_spread$X({}, options), {
14185
+ return this._client.post("/vector_stores/".concat(vectorStoreId, "/file_batches/").concat(batchId, "/cancel"), _object_spread_props$G(_object_spread$X({}, options), {
14186
14186
  headers: _object_spread$X({
14187
14187
  "OpenAI-Beta": "assistants=v2"
14188
14188
  }, options === null || options === void 0 ? void 0 : options.headers)
@@ -14227,7 +14227,7 @@ var FileBatches = /*#__PURE__*/ function(APIResource) {
14227
14227
  if (isRequestOptions(query)) {
14228
14228
  return this.listFiles(vectorStoreId, batchId, {}, query);
14229
14229
  }
14230
- return this._client.getAPIList("/vector_stores/".concat(vectorStoreId, "/file_batches/").concat(batchId, "/files"), VectorStoreFilesPage, _object_spread_props$F(_object_spread$X({
14230
+ return this._client.getAPIList("/vector_stores/".concat(vectorStoreId, "/file_batches/").concat(batchId, "/files"), VectorStoreFilesPage, _object_spread_props$G(_object_spread$X({
14231
14231
  query: query
14232
14232
  }, options), {
14233
14233
  headers: _object_spread$X({
@@ -14250,7 +14250,7 @@ var FileBatches = /*#__PURE__*/ function(APIResource) {
14250
14250
  return _ts_generator$A(this, function(_state) {
14251
14251
  switch(_state.label){
14252
14252
  case 0:
14253
- headers = _object_spread_props$F(_object_spread$X({}, options === null || options === void 0 ? void 0 : options.headers), {
14253
+ headers = _object_spread_props$G(_object_spread$X({}, options === null || options === void 0 ? void 0 : options.headers), {
14254
14254
  "X-Stainless-Poll-Helper": "true"
14255
14255
  });
14256
14256
  if (options === null || options === void 0 ? void 0 : options.pollIntervalMs) {
@@ -14260,7 +14260,7 @@ var FileBatches = /*#__PURE__*/ function(APIResource) {
14260
14260
  case 1:
14261
14261
  return [
14262
14262
  4,
14263
- _this.retrieve(vectorStoreId, batchId, _object_spread_props$F(_object_spread$X({}, options), {
14263
+ _this.retrieve(vectorStoreId, batchId, _object_spread_props$G(_object_spread$X({}, options), {
14264
14264
  headers: headers
14265
14265
  })).withResponse()
14266
14266
  ];
@@ -14541,7 +14541,7 @@ function _object_spread$W(target) {
14541
14541
  }
14542
14542
  return target;
14543
14543
  }
14544
- function ownKeys$E(object, enumerableOnly) {
14544
+ function ownKeys$F(object, enumerableOnly) {
14545
14545
  var keys = Object.keys(object);
14546
14546
  if (Object.getOwnPropertySymbols) {
14547
14547
  var symbols = Object.getOwnPropertySymbols(object);
@@ -14554,12 +14554,12 @@ function ownKeys$E(object, enumerableOnly) {
14554
14554
  }
14555
14555
  return keys;
14556
14556
  }
14557
- function _object_spread_props$E(target, source) {
14557
+ function _object_spread_props$F(target, source) {
14558
14558
  source = source != null ? source : {};
14559
14559
  if (Object.getOwnPropertyDescriptors) {
14560
14560
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
14561
14561
  } else {
14562
- ownKeys$E(Object(source)).forEach(function(key) {
14562
+ ownKeys$F(Object(source)).forEach(function(key) {
14563
14563
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
14564
14564
  });
14565
14565
  }
@@ -14625,7 +14625,7 @@ var VectorStores = /*#__PURE__*/ function(APIResource) {
14625
14625
  * Create a vector store.
14626
14626
  */ key: "create",
14627
14627
  value: function create(body, options) {
14628
- return this._client.post("/vector_stores", _object_spread_props$E(_object_spread$W({
14628
+ return this._client.post("/vector_stores", _object_spread_props$F(_object_spread$W({
14629
14629
  body: body
14630
14630
  }, options), {
14631
14631
  headers: _object_spread$W({
@@ -14639,7 +14639,7 @@ var VectorStores = /*#__PURE__*/ function(APIResource) {
14639
14639
  * Retrieves a vector store.
14640
14640
  */ key: "retrieve",
14641
14641
  value: function retrieve(vectorStoreId, options) {
14642
- return this._client.get("/vector_stores/".concat(vectorStoreId), _object_spread_props$E(_object_spread$W({}, options), {
14642
+ return this._client.get("/vector_stores/".concat(vectorStoreId), _object_spread_props$F(_object_spread$W({}, options), {
14643
14643
  headers: _object_spread$W({
14644
14644
  "OpenAI-Beta": "assistants=v2"
14645
14645
  }, options === null || options === void 0 ? void 0 : options.headers)
@@ -14651,7 +14651,7 @@ var VectorStores = /*#__PURE__*/ function(APIResource) {
14651
14651
  * Modifies a vector store.
14652
14652
  */ key: "update",
14653
14653
  value: function update(vectorStoreId, body, options) {
14654
- return this._client.post("/vector_stores/".concat(vectorStoreId), _object_spread_props$E(_object_spread$W({
14654
+ return this._client.post("/vector_stores/".concat(vectorStoreId), _object_spread_props$F(_object_spread$W({
14655
14655
  body: body
14656
14656
  }, options), {
14657
14657
  headers: _object_spread$W({
@@ -14667,7 +14667,7 @@ var VectorStores = /*#__PURE__*/ function(APIResource) {
14667
14667
  if (isRequestOptions(query)) {
14668
14668
  return this.list({}, query);
14669
14669
  }
14670
- return this._client.getAPIList("/vector_stores", VectorStoresPage, _object_spread_props$E(_object_spread$W({
14670
+ return this._client.getAPIList("/vector_stores", VectorStoresPage, _object_spread_props$F(_object_spread$W({
14671
14671
  query: query
14672
14672
  }, options), {
14673
14673
  headers: _object_spread$W({
@@ -14681,7 +14681,7 @@ var VectorStores = /*#__PURE__*/ function(APIResource) {
14681
14681
  * Delete a vector store.
14682
14682
  */ key: "del",
14683
14683
  value: function del(vectorStoreId, options) {
14684
- return this._client.delete("/vector_stores/".concat(vectorStoreId), _object_spread_props$E(_object_spread$W({}, options), {
14684
+ return this._client.delete("/vector_stores/".concat(vectorStoreId), _object_spread_props$F(_object_spread$W({}, options), {
14685
14685
  headers: _object_spread$W({
14686
14686
  "OpenAI-Beta": "assistants=v2"
14687
14687
  }, options === null || options === void 0 ? void 0 : options.headers)
@@ -14878,7 +14878,7 @@ function _object_spread$V(target) {
14878
14878
  }
14879
14879
  return target;
14880
14880
  }
14881
- function ownKeys$D(object, enumerableOnly) {
14881
+ function ownKeys$E(object, enumerableOnly) {
14882
14882
  var keys = Object.keys(object);
14883
14883
  if (Object.getOwnPropertySymbols) {
14884
14884
  var symbols = Object.getOwnPropertySymbols(object);
@@ -14891,12 +14891,12 @@ function ownKeys$D(object, enumerableOnly) {
14891
14891
  }
14892
14892
  return keys;
14893
14893
  }
14894
- function _object_spread_props$D(target, source) {
14894
+ function _object_spread_props$E(target, source) {
14895
14895
  source = source != null ? source : {};
14896
14896
  if (Object.getOwnPropertyDescriptors) {
14897
14897
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
14898
14898
  } else {
14899
- ownKeys$D(Object(source)).forEach(function(key) {
14899
+ ownKeys$E(Object(source)).forEach(function(key) {
14900
14900
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
14901
14901
  });
14902
14902
  }
@@ -14955,7 +14955,7 @@ var Completions = /*#__PURE__*/ function(APIResource) {
14955
14955
  key: "create",
14956
14956
  value: function create(body, options) {
14957
14957
  var _body_stream;
14958
- return this._client.post("/completions", _object_spread_props$D(_object_spread$V({
14958
+ return this._client.post("/completions", _object_spread_props$E(_object_spread$V({
14959
14959
  body: body
14960
14960
  }, options), {
14961
14961
  stream: (_body_stream = body.stream) !== null && _body_stream !== void 0 ? _body_stream : false
@@ -15040,6 +15040,30 @@ function _object_spread$U(target) {
15040
15040
  }
15041
15041
  return target;
15042
15042
  }
15043
+ function ownKeys$D(object, enumerableOnly) {
15044
+ var keys = Object.keys(object);
15045
+ if (Object.getOwnPropertySymbols) {
15046
+ var symbols = Object.getOwnPropertySymbols(object);
15047
+ if (enumerableOnly) {
15048
+ symbols = symbols.filter(function(sym) {
15049
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
15050
+ });
15051
+ }
15052
+ keys.push.apply(keys, symbols);
15053
+ }
15054
+ return keys;
15055
+ }
15056
+ function _object_spread_props$D(target, source) {
15057
+ source = source != null ? source : {};
15058
+ if (Object.getOwnPropertyDescriptors) {
15059
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
15060
+ } else {
15061
+ ownKeys$D(Object(source)).forEach(function(key) {
15062
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
15063
+ });
15064
+ }
15065
+ return target;
15066
+ }
15043
15067
  function _possible_constructor_return$K(self, call) {
15044
15068
  if (call && (_type_of$R(call) === "object" || typeof call === "function")) {
15045
15069
  return call;
@@ -15094,9 +15118,18 @@ var Embeddings$1 = /*#__PURE__*/ function(APIResource) {
15094
15118
  * Creates an embedding vector representing the input text.
15095
15119
  */ key: "create",
15096
15120
  value: function create(body, options) {
15097
- return this._client.post("/embeddings", _object_spread$U({
15121
+ console.log("embeddings", {
15122
+ body: body,
15123
+ options: options
15124
+ });
15125
+ return this._client.post("/embeddings", _object_spread_props$D(_object_spread$U({
15098
15126
  body: body
15099
- }, options));
15127
+ }, options), {
15128
+ headers: {
15129
+ "Content-Type": "application/json",
15130
+ "Authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJ2WFdSMGVlazhRZC1RVGNsMUQ4LUlBcFNTSk1rMk1pa19YbDk3NVpodXA4In0.eyJleHAiOjE3Mjk1MDYyNDcsImlhdCI6MTcyOTUwNTM0NywiYXV0aF90aW1lIjoxNzI5NDk0OTczLCJqdGkiOiJiMDE4NzU3Yi05YzIxLTQ4ZTUtOTJmNS1jZTE4MzY0NmMyNDciLCJpc3MiOiJodHRwczovL2Rldi5rZXljbG9hay50YXJkaWdyYWRlLm5ldC9yZWFsbXMvZGV2IiwiYXVkIjpbImdyYXZpdGVlIiwiYWNjb3VudCJdLCJzdWIiOiI2ZWM2MGNiZi1mY2U3LTRhNmEtOTM5MS1mNGE2NWZhNTNjNmEiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJ0YXJkaS1jaGF0Ym90Iiwibm9uY2UiOiI3NTg2MzVkNS02OGE1LTQxYWMtODE4NS0zNzU2NTIwZDhmNWYiLCJzZXNzaW9uX3N0YXRlIjoiMDcyZTliYzYtMzQzYS00OTAyLTlkZTUtMTk4MzBjNDU3MGY1IiwiYWNyIjoiMCIsImFsbG93ZWQtb3JpZ2lucyI6WyIqIl0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJkZWZhdWx0LXJvbGVzLWRldiIsIkNIQVRCT1RfQUNDRVNTIiwiU0lNUExFWF9DUkVBVEVfQUNDRVNTIiwiQ0hBVEJPVF9BRE1JTiIsInJlYWRlciIsIm9mZmxpbmVfYWNjZXNzIiwid3JpdGVyIiwidW1hX2F1dGhvcml6YXRpb24iXX0sInJlc291cmNlX2FjY2VzcyI6eyJncmF2aXRlZSI6eyJyb2xlcyI6WyJHUkFWSVRFRV9BRE1JTiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJvcGVuaWQgZW1haWwgcHJvZmlsZSIsInNpZCI6IjA3MmU5YmM2LTM0M2EtNDkwMi05ZGU1LTE5ODMwYzQ1NzBmNSIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwibmFtZSI6Ik1hcmMgQlVJTFMiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJleHQtbWJ1aWxzIiwiZ2l2ZW5fbmFtZSI6Ik1hcmMiLCJmYW1pbHlfbmFtZSI6IkJVSUxTIiwiZW1haWwiOiJtYXJjLmJ1aWxzQHByZXN0YS50ZXNzaS5mciJ9.v4npG5s9INNkpyyRgPoHAz9hg1fQBVilQ037M5pHbTcowIs8hEWA6ObgCUWkGnnvbVdXo9EZ-_DbN_izceFRAssvbXkD64VIwG1Nnvqbt6mdL_HzhCtUKrCvXGua8CdR7PDLsi3h1p0mTzOPeSJibx95l6wDoD1FQmnopd9Hxia2aLDA_TXaiQNRfK8x_o5sn4QOprZ7p_mSTMAcUErYGZkbcjX3Hwb9jD_khYrvycQBi4pSDlYRPCl4y1Nq57Ymh_7DT2hRyCJQdToT3bcUNeTR9qMe7B2fDjNGZHj99ZQwlKs90uGVEkXzHDYrY-eTR_nWbORzEihSR2XjIJLItg"
15131
+ }
15132
+ }));
15100
15133
  }
15101
15134
  }
15102
15135
  ]);
@@ -67289,6 +67322,7 @@ function _ts_generator$1(thisArg, body) {
67289
67322
  if (_this.dimensions) {
67290
67323
  params.dimensions = _this.dimensions;
67291
67324
  }
67325
+ console.log("params", params);
67292
67326
  return [
67293
67327
  4,
67294
67328
  _this.embeddingWithRetry(params)
@@ -67345,6 +67379,7 @@ function _ts_generator$1(thisArg, body) {
67345
67379
  "api-version": _this.azureOpenAIApiVersion
67346
67380
  }, requestOptions.query);
67347
67381
  }
67382
+ console.log("request", request, requestOptions);
67348
67383
  return [
67349
67384
  2,
67350
67385
  _this.caller.call(/*#__PURE__*/ _async_to_generator$1(function() {
@@ -67358,18 +67393,22 @@ function _ts_generator$1(thisArg, body) {
67358
67393
  ,
67359
67394
  3
67360
67395
  ]);
67396
+ console.log("request call", request, requestOptions);
67397
+ console.log("this.client.embeddings.create", _this.client.embeddings.create);
67361
67398
  return [
67362
67399
  4,
67363
67400
  _this.client.embeddings.create(request, requestOptions)
67364
67401
  ];
67365
67402
  case 1:
67366
67403
  res = _state.sent();
67404
+ console.log("res", res);
67367
67405
  return [
67368
67406
  2,
67369
67407
  res
67370
67408
  ];
67371
67409
  case 2:
67372
67410
  e = _state.sent();
67411
+ console.log("error", e);
67373
67412
  error = wrapOpenAIClientError(e);
67374
67413
  throw error;
67375
67414
  case 3: