@digipair/skill-openai 0.34.6 → 0.35.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.cjs.js +195 -156
- package/index.esm.js +195 -156
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -136,7 +136,7 @@ function _object_spread$1f(target) {
|
|
|
136
136
|
}
|
|
137
137
|
return target;
|
|
138
138
|
}
|
|
139
|
-
function ownKeys$
|
|
139
|
+
function ownKeys$X(object, enumerableOnly) {
|
|
140
140
|
var keys = Object.keys(object);
|
|
141
141
|
if (Object.getOwnPropertySymbols) {
|
|
142
142
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -149,12 +149,12 @@ function ownKeys$W(object, enumerableOnly) {
|
|
|
149
149
|
}
|
|
150
150
|
return keys;
|
|
151
151
|
}
|
|
152
|
-
function _object_spread_props$
|
|
152
|
+
function _object_spread_props$X(target, source) {
|
|
153
153
|
source = source != null ? source : {};
|
|
154
154
|
if (Object.getOwnPropertyDescriptors) {
|
|
155
155
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
156
156
|
} else {
|
|
157
|
-
ownKeys$
|
|
157
|
+
ownKeys$X(Object(source)).forEach(function(key) {
|
|
158
158
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
159
159
|
});
|
|
160
160
|
}
|
|
@@ -302,7 +302,7 @@ function getRuntime() {
|
|
|
302
302
|
return _ts_generator$M(this, function(_state) {
|
|
303
303
|
return [
|
|
304
304
|
2,
|
|
305
|
-
_object_spread_props$
|
|
305
|
+
_object_spread_props$X(_object_spread$1f({}, opts), {
|
|
306
306
|
body: new MultipartBody(form)
|
|
307
307
|
})
|
|
308
308
|
];
|
|
@@ -2130,7 +2130,7 @@ function _object_spread$1e(target) {
|
|
|
2130
2130
|
}
|
|
2131
2131
|
return target;
|
|
2132
2132
|
}
|
|
2133
|
-
function ownKeys$
|
|
2133
|
+
function ownKeys$W(object, enumerableOnly) {
|
|
2134
2134
|
var keys = Object.keys(object);
|
|
2135
2135
|
if (Object.getOwnPropertySymbols) {
|
|
2136
2136
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -2143,12 +2143,12 @@ function ownKeys$V(object, enumerableOnly) {
|
|
|
2143
2143
|
}
|
|
2144
2144
|
return keys;
|
|
2145
2145
|
}
|
|
2146
|
-
function _object_spread_props$
|
|
2146
|
+
function _object_spread_props$W(target, source) {
|
|
2147
2147
|
source = source != null ? source : {};
|
|
2148
2148
|
if (Object.getOwnPropertyDescriptors) {
|
|
2149
2149
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
2150
2150
|
} else {
|
|
2151
|
-
ownKeys$
|
|
2151
|
+
ownKeys$W(Object(source)).forEach(function(key) {
|
|
2152
2152
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
2153
2153
|
});
|
|
2154
2154
|
}
|
|
@@ -2336,7 +2336,7 @@ function _toFile() {
|
|
|
2336
2336
|
if (!options.type) {
|
|
2337
2337
|
type = (_bits_ = bits[0]) === null || _bits_ === void 0 ? void 0 : _bits_.type;
|
|
2338
2338
|
if (typeof type === "string") {
|
|
2339
|
-
options = _object_spread_props$
|
|
2339
|
+
options = _object_spread_props$W(_object_spread$1e({}, options), {
|
|
2340
2340
|
type: type
|
|
2341
2341
|
});
|
|
2342
2342
|
}
|
|
@@ -2947,7 +2947,7 @@ function _object_spread$1d(target) {
|
|
|
2947
2947
|
}
|
|
2948
2948
|
return target;
|
|
2949
2949
|
}
|
|
2950
|
-
function ownKeys$
|
|
2950
|
+
function ownKeys$V(object, enumerableOnly) {
|
|
2951
2951
|
var keys = Object.keys(object);
|
|
2952
2952
|
if (Object.getOwnPropertySymbols) {
|
|
2953
2953
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -2960,12 +2960,12 @@ function ownKeys$U(object, enumerableOnly) {
|
|
|
2960
2960
|
}
|
|
2961
2961
|
return keys;
|
|
2962
2962
|
}
|
|
2963
|
-
function _object_spread_props$
|
|
2963
|
+
function _object_spread_props$V(target, source) {
|
|
2964
2964
|
source = source != null ? source : {};
|
|
2965
2965
|
if (Object.getOwnPropertyDescriptors) {
|
|
2966
2966
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
2967
2967
|
} else {
|
|
2968
|
-
ownKeys$
|
|
2968
|
+
ownKeys$V(Object(source)).forEach(function(key) {
|
|
2969
2969
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
2970
2970
|
});
|
|
2971
2971
|
}
|
|
@@ -3519,7 +3519,7 @@ var APIClient = /*#__PURE__*/ function() {
|
|
|
3519
3519
|
body = _tmp;
|
|
3520
3520
|
return [
|
|
3521
3521
|
2,
|
|
3522
|
-
_object_spread_props$
|
|
3522
|
+
_object_spread_props$V(_object_spread$1d({
|
|
3523
3523
|
method: method,
|
|
3524
3524
|
path: path
|
|
3525
3525
|
}, opts), {
|
|
@@ -3594,7 +3594,7 @@ var APIClient = /*#__PURE__*/ function() {
|
|
|
3594
3594
|
contentLength: contentLength
|
|
3595
3595
|
});
|
|
3596
3596
|
var _options_signal;
|
|
3597
|
-
var req = _object_spread_props$
|
|
3597
|
+
var req = _object_spread_props$V(_object_spread$1d(_object_spread_props$V(_object_spread$1d({
|
|
3598
3598
|
method: method
|
|
3599
3599
|
}, body && {
|
|
3600
3600
|
body: body
|
|
@@ -5315,7 +5315,7 @@ function _object_spread$1c(target) {
|
|
|
5315
5315
|
}
|
|
5316
5316
|
return target;
|
|
5317
5317
|
}
|
|
5318
|
-
function ownKeys$
|
|
5318
|
+
function ownKeys$U(object, enumerableOnly) {
|
|
5319
5319
|
var keys = Object.keys(object);
|
|
5320
5320
|
if (Object.getOwnPropertySymbols) {
|
|
5321
5321
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -5328,12 +5328,12 @@ function ownKeys$T(object, enumerableOnly) {
|
|
|
5328
5328
|
}
|
|
5329
5329
|
return keys;
|
|
5330
5330
|
}
|
|
5331
|
-
function _object_spread_props$
|
|
5331
|
+
function _object_spread_props$U(target, source) {
|
|
5332
5332
|
source = source != null ? source : {};
|
|
5333
5333
|
if (Object.getOwnPropertyDescriptors) {
|
|
5334
5334
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
5335
5335
|
} else {
|
|
5336
|
-
ownKeys$
|
|
5336
|
+
ownKeys$U(Object(source)).forEach(function(key) {
|
|
5337
5337
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
5338
5338
|
});
|
|
5339
5339
|
}
|
|
@@ -5392,7 +5392,7 @@ var Completions$2 = /*#__PURE__*/ function(APIResource) {
|
|
|
5392
5392
|
key: "create",
|
|
5393
5393
|
value: function create(body, options) {
|
|
5394
5394
|
var _body_stream;
|
|
5395
|
-
return this._client.post("/chat/completions", _object_spread_props$
|
|
5395
|
+
return this._client.post("/chat/completions", _object_spread_props$U(_object_spread$1c({
|
|
5396
5396
|
body: body
|
|
5397
5397
|
}, options), {
|
|
5398
5398
|
stream: (_body_stream = body.stream) !== null && _body_stream !== void 0 ? _body_stream : false
|
|
@@ -5567,7 +5567,7 @@ function _object_spread$1b(target) {
|
|
|
5567
5567
|
}
|
|
5568
5568
|
return target;
|
|
5569
5569
|
}
|
|
5570
|
-
function ownKeys$
|
|
5570
|
+
function ownKeys$T(object, enumerableOnly) {
|
|
5571
5571
|
var keys = Object.keys(object);
|
|
5572
5572
|
if (Object.getOwnPropertySymbols) {
|
|
5573
5573
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -5580,12 +5580,12 @@ function ownKeys$S(object, enumerableOnly) {
|
|
|
5580
5580
|
}
|
|
5581
5581
|
return keys;
|
|
5582
5582
|
}
|
|
5583
|
-
function _object_spread_props$
|
|
5583
|
+
function _object_spread_props$T(target, source) {
|
|
5584
5584
|
source = source != null ? source : {};
|
|
5585
5585
|
if (Object.getOwnPropertyDescriptors) {
|
|
5586
5586
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
5587
5587
|
} else {
|
|
5588
|
-
ownKeys$
|
|
5588
|
+
ownKeys$T(Object(source)).forEach(function(key) {
|
|
5589
5589
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
5590
5590
|
});
|
|
5591
5591
|
}
|
|
@@ -5645,7 +5645,7 @@ var Speech = /*#__PURE__*/ function(APIResource) {
|
|
|
5645
5645
|
* Generates audio from the input text.
|
|
5646
5646
|
*/ key: "create",
|
|
5647
5647
|
value: function create(body, options) {
|
|
5648
|
-
return this._client.post("/audio/speech", _object_spread_props$
|
|
5648
|
+
return this._client.post("/audio/speech", _object_spread_props$T(_object_spread$1b({
|
|
5649
5649
|
body: body
|
|
5650
5650
|
}, options), {
|
|
5651
5651
|
__binaryResponse: true
|
|
@@ -6276,7 +6276,7 @@ function _object_spread$17(target) {
|
|
|
6276
6276
|
}
|
|
6277
6277
|
return target;
|
|
6278
6278
|
}
|
|
6279
|
-
function ownKeys$
|
|
6279
|
+
function ownKeys$S(object, enumerableOnly) {
|
|
6280
6280
|
var keys = Object.keys(object);
|
|
6281
6281
|
if (Object.getOwnPropertySymbols) {
|
|
6282
6282
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -6289,12 +6289,12 @@ function ownKeys$R(object, enumerableOnly) {
|
|
|
6289
6289
|
}
|
|
6290
6290
|
return keys;
|
|
6291
6291
|
}
|
|
6292
|
-
function _object_spread_props$
|
|
6292
|
+
function _object_spread_props$S(target, source) {
|
|
6293
6293
|
source = source != null ? source : {};
|
|
6294
6294
|
if (Object.getOwnPropertyDescriptors) {
|
|
6295
6295
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
6296
6296
|
} else {
|
|
6297
|
-
ownKeys$
|
|
6297
|
+
ownKeys$S(Object(source)).forEach(function(key) {
|
|
6298
6298
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
6299
6299
|
});
|
|
6300
6300
|
}
|
|
@@ -6354,7 +6354,7 @@ var Assistants = /*#__PURE__*/ function(APIResource) {
|
|
|
6354
6354
|
* Create an assistant with a model and instructions.
|
|
6355
6355
|
*/ key: "create",
|
|
6356
6356
|
value: function create(body, options) {
|
|
6357
|
-
return this._client.post("/assistants", _object_spread_props$
|
|
6357
|
+
return this._client.post("/assistants", _object_spread_props$S(_object_spread$17({
|
|
6358
6358
|
body: body
|
|
6359
6359
|
}, options), {
|
|
6360
6360
|
headers: _object_spread$17({
|
|
@@ -6368,7 +6368,7 @@ var Assistants = /*#__PURE__*/ function(APIResource) {
|
|
|
6368
6368
|
* Retrieves an assistant.
|
|
6369
6369
|
*/ key: "retrieve",
|
|
6370
6370
|
value: function retrieve(assistantId, options) {
|
|
6371
|
-
return this._client.get("/assistants/".concat(assistantId), _object_spread_props$
|
|
6371
|
+
return this._client.get("/assistants/".concat(assistantId), _object_spread_props$S(_object_spread$17({}, options), {
|
|
6372
6372
|
headers: _object_spread$17({
|
|
6373
6373
|
"OpenAI-Beta": "assistants=v2"
|
|
6374
6374
|
}, options === null || options === void 0 ? void 0 : options.headers)
|
|
@@ -6380,7 +6380,7 @@ var Assistants = /*#__PURE__*/ function(APIResource) {
|
|
|
6380
6380
|
* Modifies an assistant.
|
|
6381
6381
|
*/ key: "update",
|
|
6382
6382
|
value: function update(assistantId, body, options) {
|
|
6383
|
-
return this._client.post("/assistants/".concat(assistantId), _object_spread_props$
|
|
6383
|
+
return this._client.post("/assistants/".concat(assistantId), _object_spread_props$S(_object_spread$17({
|
|
6384
6384
|
body: body
|
|
6385
6385
|
}, options), {
|
|
6386
6386
|
headers: _object_spread$17({
|
|
@@ -6396,7 +6396,7 @@ var Assistants = /*#__PURE__*/ function(APIResource) {
|
|
|
6396
6396
|
if (isRequestOptions(query)) {
|
|
6397
6397
|
return this.list({}, query);
|
|
6398
6398
|
}
|
|
6399
|
-
return this._client.getAPIList("/assistants", AssistantsPage, _object_spread_props$
|
|
6399
|
+
return this._client.getAPIList("/assistants", AssistantsPage, _object_spread_props$S(_object_spread$17({
|
|
6400
6400
|
query: query
|
|
6401
6401
|
}, options), {
|
|
6402
6402
|
headers: _object_spread$17({
|
|
@@ -6410,7 +6410,7 @@ var Assistants = /*#__PURE__*/ function(APIResource) {
|
|
|
6410
6410
|
* Delete an assistant.
|
|
6411
6411
|
*/ key: "del",
|
|
6412
6412
|
value: function del(assistantId, options) {
|
|
6413
|
-
return this._client.delete("/assistants/".concat(assistantId), _object_spread_props$
|
|
6413
|
+
return this._client.delete("/assistants/".concat(assistantId), _object_spread_props$S(_object_spread$17({}, options), {
|
|
6414
6414
|
headers: _object_spread$17({
|
|
6415
6415
|
"OpenAI-Beta": "assistants=v2"
|
|
6416
6416
|
}, options === null || options === void 0 ? void 0 : options.headers)
|
|
@@ -6544,7 +6544,7 @@ function _object_spread$16(target) {
|
|
|
6544
6544
|
}
|
|
6545
6545
|
return target;
|
|
6546
6546
|
}
|
|
6547
|
-
function ownKeys$
|
|
6547
|
+
function ownKeys$R(object, enumerableOnly) {
|
|
6548
6548
|
var keys = Object.keys(object);
|
|
6549
6549
|
if (Object.getOwnPropertySymbols) {
|
|
6550
6550
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -6557,12 +6557,12 @@ function ownKeys$Q(object, enumerableOnly) {
|
|
|
6557
6557
|
}
|
|
6558
6558
|
return keys;
|
|
6559
6559
|
}
|
|
6560
|
-
function _object_spread_props$
|
|
6560
|
+
function _object_spread_props$R(target, source) {
|
|
6561
6561
|
source = source != null ? source : {};
|
|
6562
6562
|
if (Object.getOwnPropertyDescriptors) {
|
|
6563
6563
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
6564
6564
|
} else {
|
|
6565
|
-
ownKeys$
|
|
6565
|
+
ownKeys$R(Object(source)).forEach(function(key) {
|
|
6566
6566
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
6567
6567
|
});
|
|
6568
6568
|
}
|
|
@@ -7213,9 +7213,9 @@ var AbstractChatCompletionRunner = /*#__PURE__*/ function() {
|
|
|
7213
7213
|
__classPrivateFieldGet$4(_this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_validateParams).call(_this, params);
|
|
7214
7214
|
return [
|
|
7215
7215
|
4,
|
|
7216
|
-
completions.create(_object_spread_props$
|
|
7216
|
+
completions.create(_object_spread_props$R(_object_spread$16({}, params), {
|
|
7217
7217
|
stream: false
|
|
7218
|
-
}), _object_spread_props$
|
|
7218
|
+
}), _object_spread_props$R(_object_spread$16({}, options), {
|
|
7219
7219
|
signal: _this.controller.signal
|
|
7220
7220
|
}))
|
|
7221
7221
|
];
|
|
@@ -7347,7 +7347,7 @@ var AbstractChatCompletionRunner = /*#__PURE__*/ function() {
|
|
|
7347
7347
|
];
|
|
7348
7348
|
return [
|
|
7349
7349
|
4,
|
|
7350
|
-
_this._createChatCompletion(completions, _object_spread_props$
|
|
7350
|
+
_this._createChatCompletion(completions, _object_spread_props$R(_object_spread$16({}, restParams), {
|
|
7351
7351
|
function_call: function_call,
|
|
7352
7352
|
functions: functions,
|
|
7353
7353
|
messages: _to_consumable_array$A(_this.messages)
|
|
@@ -7542,7 +7542,7 @@ var AbstractChatCompletionRunner = /*#__PURE__*/ function() {
|
|
|
7542
7542
|
];
|
|
7543
7543
|
return [
|
|
7544
7544
|
4,
|
|
7545
|
-
_this._createChatCompletion(completions, _object_spread_props$
|
|
7545
|
+
_this._createChatCompletion(completions, _object_spread_props$R(_object_spread$16({}, restParams), {
|
|
7546
7546
|
tool_choice: tool_choice,
|
|
7547
7547
|
tools: tools,
|
|
7548
7548
|
messages: _to_consumable_array$A(_this.messages)
|
|
@@ -7734,7 +7734,7 @@ _AbstractChatCompletionRunner_connectedPromise = new WeakMap(), _AbstractChatCom
|
|
|
7734
7734
|
"function_call"
|
|
7735
7735
|
]);
|
|
7736
7736
|
var _message_content;
|
|
7737
|
-
var ret = _object_spread_props$
|
|
7737
|
+
var ret = _object_spread_props$R(_object_spread$16({}, rest), {
|
|
7738
7738
|
content: (_message_content = message.content) !== null && _message_content !== void 0 ? _message_content : null
|
|
7739
7739
|
});
|
|
7740
7740
|
if (function_call) {
|
|
@@ -7908,7 +7908,7 @@ function _object_spread$15(target) {
|
|
|
7908
7908
|
}
|
|
7909
7909
|
return target;
|
|
7910
7910
|
}
|
|
7911
|
-
function ownKeys$
|
|
7911
|
+
function ownKeys$Q(object, enumerableOnly) {
|
|
7912
7912
|
var keys = Object.keys(object);
|
|
7913
7913
|
if (Object.getOwnPropertySymbols) {
|
|
7914
7914
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -7921,12 +7921,12 @@ function ownKeys$P(object, enumerableOnly) {
|
|
|
7921
7921
|
}
|
|
7922
7922
|
return keys;
|
|
7923
7923
|
}
|
|
7924
|
-
function _object_spread_props$
|
|
7924
|
+
function _object_spread_props$Q(target, source) {
|
|
7925
7925
|
source = source != null ? source : {};
|
|
7926
7926
|
if (Object.getOwnPropertyDescriptors) {
|
|
7927
7927
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
7928
7928
|
} else {
|
|
7929
|
-
ownKeys$
|
|
7929
|
+
ownKeys$Q(Object(source)).forEach(function(key) {
|
|
7930
7930
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
7931
7931
|
});
|
|
7932
7932
|
}
|
|
@@ -8002,8 +8002,8 @@ var ChatCompletionRunner = /*#__PURE__*/ function(AbstractChatCompletionRunner)
|
|
|
8002
8002
|
key: "runFunctions",
|
|
8003
8003
|
value: /** @deprecated - please use `runTools` instead. */ function runFunctions(completions, params, options) {
|
|
8004
8004
|
var runner = new ChatCompletionRunner();
|
|
8005
|
-
var opts = _object_spread_props$
|
|
8006
|
-
headers: _object_spread_props$
|
|
8005
|
+
var opts = _object_spread_props$Q(_object_spread$15({}, options), {
|
|
8006
|
+
headers: _object_spread_props$Q(_object_spread$15({}, options === null || options === void 0 ? void 0 : options.headers), {
|
|
8007
8007
|
"X-Stainless-Helper-Method": "runFunctions"
|
|
8008
8008
|
})
|
|
8009
8009
|
});
|
|
@@ -8017,8 +8017,8 @@ var ChatCompletionRunner = /*#__PURE__*/ function(AbstractChatCompletionRunner)
|
|
|
8017
8017
|
key: "runTools",
|
|
8018
8018
|
value: function runTools(completions, params, options) {
|
|
8019
8019
|
var runner = new ChatCompletionRunner();
|
|
8020
|
-
var opts = _object_spread_props$
|
|
8021
|
-
headers: _object_spread_props$
|
|
8020
|
+
var opts = _object_spread_props$Q(_object_spread$15({}, options), {
|
|
8021
|
+
headers: _object_spread_props$Q(_object_spread$15({}, options === null || options === void 0 ? void 0 : options.headers), {
|
|
8022
8022
|
"X-Stainless-Helper-Method": "runTools"
|
|
8023
8023
|
})
|
|
8024
8024
|
});
|
|
@@ -8189,7 +8189,7 @@ function _object_spread$14(target) {
|
|
|
8189
8189
|
}
|
|
8190
8190
|
return target;
|
|
8191
8191
|
}
|
|
8192
|
-
function ownKeys$
|
|
8192
|
+
function ownKeys$P(object, enumerableOnly) {
|
|
8193
8193
|
var keys = Object.keys(object);
|
|
8194
8194
|
if (Object.getOwnPropertySymbols) {
|
|
8195
8195
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -8202,12 +8202,12 @@ function ownKeys$O(object, enumerableOnly) {
|
|
|
8202
8202
|
}
|
|
8203
8203
|
return keys;
|
|
8204
8204
|
}
|
|
8205
|
-
function _object_spread_props$
|
|
8205
|
+
function _object_spread_props$P(target, source) {
|
|
8206
8206
|
source = source != null ? source : {};
|
|
8207
8207
|
if (Object.getOwnPropertyDescriptors) {
|
|
8208
8208
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
8209
8209
|
} else {
|
|
8210
|
-
ownKeys$
|
|
8210
|
+
ownKeys$P(Object(source)).forEach(function(key) {
|
|
8211
8211
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
8212
8212
|
});
|
|
8213
8213
|
}
|
|
@@ -8439,9 +8439,9 @@ var ChatCompletionStream = /*#__PURE__*/ function(AbstractChatCompletionRunner)
|
|
|
8439
8439
|
__classPrivateFieldGet$3(_this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_beginRequest).call(_this);
|
|
8440
8440
|
return [
|
|
8441
8441
|
4,
|
|
8442
|
-
completions.create(_object_spread_props$
|
|
8442
|
+
completions.create(_object_spread_props$P(_object_spread$14({}, params), {
|
|
8443
8443
|
stream: true
|
|
8444
|
-
}), _object_spread_props$
|
|
8444
|
+
}), _object_spread_props$P(_object_spread$14({}, options), {
|
|
8445
8445
|
signal: _this.controller.signal
|
|
8446
8446
|
}))
|
|
8447
8447
|
];
|
|
@@ -8685,7 +8685,7 @@ var ChatCompletionStream = /*#__PURE__*/ function(AbstractChatCompletionRunner)
|
|
|
8685
8685
|
"choices"
|
|
8686
8686
|
]);
|
|
8687
8687
|
if (!snapshot) {
|
|
8688
|
-
snapshot = __classPrivateFieldSet$3(this, _ChatCompletionStream_currentChatCompletionSnapshot, _object_spread_props$
|
|
8688
|
+
snapshot = __classPrivateFieldSet$3(this, _ChatCompletionStream_currentChatCompletionSnapshot, _object_spread_props$P(_object_spread$14({}, rest), {
|
|
8689
8689
|
choices: []
|
|
8690
8690
|
}), "f");
|
|
8691
8691
|
} else {
|
|
@@ -8977,10 +8977,10 @@ var ChatCompletionStream = /*#__PURE__*/ function(AbstractChatCompletionRunner)
|
|
|
8977
8977
|
value: function createChatCompletion(completions, params, options) {
|
|
8978
8978
|
var runner = new ChatCompletionStream();
|
|
8979
8979
|
runner._run(function() {
|
|
8980
|
-
return runner._runChatCompletion(completions, _object_spread_props$
|
|
8980
|
+
return runner._runChatCompletion(completions, _object_spread_props$P(_object_spread$14({}, params), {
|
|
8981
8981
|
stream: true
|
|
8982
|
-
}), _object_spread_props$
|
|
8983
|
-
headers: _object_spread_props$
|
|
8982
|
+
}), _object_spread_props$P(_object_spread$14({}, options), {
|
|
8983
|
+
headers: _object_spread_props$P(_object_spread$14({}, options === null || options === void 0 ? void 0 : options.headers), {
|
|
8984
8984
|
"X-Stainless-Helper-Method": "stream"
|
|
8985
8985
|
})
|
|
8986
8986
|
}));
|
|
@@ -8999,7 +8999,7 @@ function finalizeChatCompletion(snapshot) {
|
|
|
8999
8999
|
"model",
|
|
9000
9000
|
"system_fingerprint"
|
|
9001
9001
|
]);
|
|
9002
|
-
return _object_spread$14(_object_spread_props$
|
|
9002
|
+
return _object_spread$14(_object_spread_props$P(_object_spread$14({}, rest), {
|
|
9003
9003
|
id: id,
|
|
9004
9004
|
choices: choices.map(function(_param) {
|
|
9005
9005
|
var message = _param.message, finish_reason = _param.finish_reason, index = _param.index, logprobs = _param.logprobs, choiceRest = _object_without_properties$7(_param, [
|
|
@@ -9020,7 +9020,7 @@ function finalizeChatCompletion(snapshot) {
|
|
|
9020
9020
|
var args = function_call.arguments, name = function_call.name;
|
|
9021
9021
|
if (args == null) throw new OpenAIError("missing function_call.arguments for choice ".concat(index));
|
|
9022
9022
|
if (!name) throw new OpenAIError("missing function_call.name for choice ".concat(index));
|
|
9023
|
-
return _object_spread_props$
|
|
9023
|
+
return _object_spread_props$P(_object_spread$14({}, choiceRest), {
|
|
9024
9024
|
message: {
|
|
9025
9025
|
content: content,
|
|
9026
9026
|
function_call: {
|
|
@@ -9035,11 +9035,11 @@ function finalizeChatCompletion(snapshot) {
|
|
|
9035
9035
|
});
|
|
9036
9036
|
}
|
|
9037
9037
|
if (tool_calls) {
|
|
9038
|
-
return _object_spread_props$
|
|
9038
|
+
return _object_spread_props$P(_object_spread$14({}, choiceRest), {
|
|
9039
9039
|
index: index,
|
|
9040
9040
|
finish_reason: finish_reason,
|
|
9041
9041
|
logprobs: logprobs,
|
|
9042
|
-
message: _object_spread_props$
|
|
9042
|
+
message: _object_spread_props$P(_object_spread$14({}, messageRest), {
|
|
9043
9043
|
role: role,
|
|
9044
9044
|
content: content,
|
|
9045
9045
|
tool_calls: tool_calls.map(function(tool_call, i) {
|
|
@@ -9056,10 +9056,10 @@ function finalizeChatCompletion(snapshot) {
|
|
|
9056
9056
|
if (type == null) throw new OpenAIError("missing choices[".concat(index, "].tool_calls[").concat(i, "].type\n").concat(str(snapshot)));
|
|
9057
9057
|
if (name == null) throw new OpenAIError("missing choices[".concat(index, "].tool_calls[").concat(i, "].function.name\n").concat(str(snapshot)));
|
|
9058
9058
|
if (args == null) throw new OpenAIError("missing choices[".concat(index, "].tool_calls[").concat(i, "].function.arguments\n").concat(str(snapshot)));
|
|
9059
|
-
return _object_spread_props$
|
|
9059
|
+
return _object_spread_props$P(_object_spread$14({}, toolRest), {
|
|
9060
9060
|
id: id,
|
|
9061
9061
|
type: type,
|
|
9062
|
-
function: _object_spread_props$
|
|
9062
|
+
function: _object_spread_props$P(_object_spread$14({}, fnRest), {
|
|
9063
9063
|
name: name,
|
|
9064
9064
|
arguments: args
|
|
9065
9065
|
})
|
|
@@ -9068,8 +9068,8 @@ function finalizeChatCompletion(snapshot) {
|
|
|
9068
9068
|
})
|
|
9069
9069
|
});
|
|
9070
9070
|
}
|
|
9071
|
-
return _object_spread_props$
|
|
9072
|
-
message: _object_spread_props$
|
|
9071
|
+
return _object_spread_props$P(_object_spread$14({}, choiceRest), {
|
|
9072
|
+
message: _object_spread_props$P(_object_spread$14({}, messageRest), {
|
|
9073
9073
|
content: content,
|
|
9074
9074
|
role: role
|
|
9075
9075
|
}),
|
|
@@ -9161,7 +9161,7 @@ function _object_spread$13(target) {
|
|
|
9161
9161
|
}
|
|
9162
9162
|
return target;
|
|
9163
9163
|
}
|
|
9164
|
-
function ownKeys$
|
|
9164
|
+
function ownKeys$O(object, enumerableOnly) {
|
|
9165
9165
|
var keys = Object.keys(object);
|
|
9166
9166
|
if (Object.getOwnPropertySymbols) {
|
|
9167
9167
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -9174,12 +9174,12 @@ function ownKeys$N(object, enumerableOnly) {
|
|
|
9174
9174
|
}
|
|
9175
9175
|
return keys;
|
|
9176
9176
|
}
|
|
9177
|
-
function _object_spread_props$
|
|
9177
|
+
function _object_spread_props$O(target, source) {
|
|
9178
9178
|
source = source != null ? source : {};
|
|
9179
9179
|
if (Object.getOwnPropertyDescriptors) {
|
|
9180
9180
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
9181
9181
|
} else {
|
|
9182
|
-
ownKeys$
|
|
9182
|
+
ownKeys$O(Object(source)).forEach(function(key) {
|
|
9183
9183
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
9184
9184
|
});
|
|
9185
9185
|
}
|
|
@@ -9248,8 +9248,8 @@ var ChatCompletionStreamingRunner = /*#__PURE__*/ function(ChatCompletionStream)
|
|
|
9248
9248
|
key: "runFunctions",
|
|
9249
9249
|
value: /** @deprecated - please use `runTools` instead. */ function runFunctions(completions, params, options) {
|
|
9250
9250
|
var runner = new ChatCompletionStreamingRunner();
|
|
9251
|
-
var opts = _object_spread_props$
|
|
9252
|
-
headers: _object_spread_props$
|
|
9251
|
+
var opts = _object_spread_props$O(_object_spread$13({}, options), {
|
|
9252
|
+
headers: _object_spread_props$O(_object_spread$13({}, options === null || options === void 0 ? void 0 : options.headers), {
|
|
9253
9253
|
"X-Stainless-Helper-Method": "runFunctions"
|
|
9254
9254
|
})
|
|
9255
9255
|
});
|
|
@@ -9263,8 +9263,8 @@ var ChatCompletionStreamingRunner = /*#__PURE__*/ function(ChatCompletionStream)
|
|
|
9263
9263
|
key: "runTools",
|
|
9264
9264
|
value: function runTools(completions, params, options) {
|
|
9265
9265
|
var runner = new ChatCompletionStreamingRunner();
|
|
9266
|
-
var opts = _object_spread_props$
|
|
9267
|
-
headers: _object_spread_props$
|
|
9266
|
+
var opts = _object_spread_props$O(_object_spread$13({}, options), {
|
|
9267
|
+
headers: _object_spread_props$O(_object_spread$13({}, options === null || options === void 0 ? void 0 : options.headers), {
|
|
9268
9268
|
"X-Stainless-Helper-Method": "runTools"
|
|
9269
9269
|
})
|
|
9270
9270
|
});
|
|
@@ -9591,7 +9591,7 @@ function _object_spread$12(target) {
|
|
|
9591
9591
|
}
|
|
9592
9592
|
return target;
|
|
9593
9593
|
}
|
|
9594
|
-
function ownKeys$
|
|
9594
|
+
function ownKeys$N(object, enumerableOnly) {
|
|
9595
9595
|
var keys = Object.keys(object);
|
|
9596
9596
|
if (Object.getOwnPropertySymbols) {
|
|
9597
9597
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -9604,12 +9604,12 @@ function ownKeys$M(object, enumerableOnly) {
|
|
|
9604
9604
|
}
|
|
9605
9605
|
return keys;
|
|
9606
9606
|
}
|
|
9607
|
-
function _object_spread_props$
|
|
9607
|
+
function _object_spread_props$N(target, source) {
|
|
9608
9608
|
source = source != null ? source : {};
|
|
9609
9609
|
if (Object.getOwnPropertyDescriptors) {
|
|
9610
9610
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
9611
9611
|
} else {
|
|
9612
|
-
ownKeys$
|
|
9612
|
+
ownKeys$N(Object(source)).forEach(function(key) {
|
|
9613
9613
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
9614
9614
|
});
|
|
9615
9615
|
}
|
|
@@ -10066,9 +10066,9 @@ var AbstractAssistantStreamRunner = /*#__PURE__*/ function() {
|
|
|
10066
10066
|
}
|
|
10067
10067
|
return [
|
|
10068
10068
|
4,
|
|
10069
|
-
thread.createAndRun(_object_spread_props$
|
|
10069
|
+
thread.createAndRun(_object_spread_props$N(_object_spread$12({}, body), {
|
|
10070
10070
|
stream: false
|
|
10071
|
-
}), _object_spread_props$
|
|
10071
|
+
}), _object_spread_props$N(_object_spread$12({}, options), {
|
|
10072
10072
|
signal: _this.controller.signal
|
|
10073
10073
|
}))
|
|
10074
10074
|
];
|
|
@@ -10102,9 +10102,9 @@ var AbstractAssistantStreamRunner = /*#__PURE__*/ function() {
|
|
|
10102
10102
|
}
|
|
10103
10103
|
return [
|
|
10104
10104
|
4,
|
|
10105
|
-
run.submitToolOutputs(threadId, runId, _object_spread_props$
|
|
10105
|
+
run.submitToolOutputs(threadId, runId, _object_spread_props$N(_object_spread$12({}, params), {
|
|
10106
10106
|
stream: false
|
|
10107
|
-
}), _object_spread_props$
|
|
10107
|
+
}), _object_spread_props$N(_object_spread$12({}, options), {
|
|
10108
10108
|
signal: _this.controller.signal
|
|
10109
10109
|
}))
|
|
10110
10110
|
];
|
|
@@ -10138,9 +10138,9 @@ var AbstractAssistantStreamRunner = /*#__PURE__*/ function() {
|
|
|
10138
10138
|
}
|
|
10139
10139
|
return [
|
|
10140
10140
|
4,
|
|
10141
|
-
run.create(threadId, _object_spread_props$
|
|
10141
|
+
run.create(threadId, _object_spread_props$N(_object_spread$12({}, params), {
|
|
10142
10142
|
stream: false
|
|
10143
|
-
}), _object_spread_props$
|
|
10143
|
+
}), _object_spread_props$N(_object_spread$12({}, options), {
|
|
10144
10144
|
signal: _this.controller.signal
|
|
10145
10145
|
}))
|
|
10146
10146
|
];
|
|
@@ -10347,7 +10347,7 @@ function _object_spread$11(target) {
|
|
|
10347
10347
|
}
|
|
10348
10348
|
return target;
|
|
10349
10349
|
}
|
|
10350
|
-
function ownKeys$
|
|
10350
|
+
function ownKeys$M(object, enumerableOnly) {
|
|
10351
10351
|
var keys = Object.keys(object);
|
|
10352
10352
|
if (Object.getOwnPropertySymbols) {
|
|
10353
10353
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -10360,12 +10360,12 @@ function ownKeys$L(object, enumerableOnly) {
|
|
|
10360
10360
|
}
|
|
10361
10361
|
return keys;
|
|
10362
10362
|
}
|
|
10363
|
-
function _object_spread_props$
|
|
10363
|
+
function _object_spread_props$M(target, source) {
|
|
10364
10364
|
source = source != null ? source : {};
|
|
10365
10365
|
if (Object.getOwnPropertyDescriptors) {
|
|
10366
10366
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
10367
10367
|
} else {
|
|
10368
|
-
ownKeys$
|
|
10368
|
+
ownKeys$M(Object(source)).forEach(function(key) {
|
|
10369
10369
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
10370
10370
|
});
|
|
10371
10371
|
}
|
|
@@ -10839,12 +10839,12 @@ var AssistantStream = /*#__PURE__*/ function(AbstractAssistantStreamRunner) {
|
|
|
10839
10839
|
return _this.controller.abort();
|
|
10840
10840
|
});
|
|
10841
10841
|
}
|
|
10842
|
-
body = _object_spread_props$
|
|
10842
|
+
body = _object_spread_props$M(_object_spread$11({}, params), {
|
|
10843
10843
|
stream: true
|
|
10844
10844
|
});
|
|
10845
10845
|
return [
|
|
10846
10846
|
4,
|
|
10847
|
-
run.submitToolOutputs(threadId, runId, body, _object_spread_props$
|
|
10847
|
+
run.submitToolOutputs(threadId, runId, body, _object_spread_props$M(_object_spread$11({}, options), {
|
|
10848
10848
|
signal: _this.controller.signal
|
|
10849
10849
|
}))
|
|
10850
10850
|
];
|
|
@@ -11052,12 +11052,12 @@ var AssistantStream = /*#__PURE__*/ function(AbstractAssistantStreamRunner) {
|
|
|
11052
11052
|
return _this.controller.abort();
|
|
11053
11053
|
});
|
|
11054
11054
|
}
|
|
11055
|
-
body = _object_spread_props$
|
|
11055
|
+
body = _object_spread_props$M(_object_spread$11({}, params), {
|
|
11056
11056
|
stream: true
|
|
11057
11057
|
});
|
|
11058
11058
|
return [
|
|
11059
11059
|
4,
|
|
11060
|
-
thread.createAndRun(body, _object_spread_props$
|
|
11060
|
+
thread.createAndRun(body, _object_spread_props$M(_object_spread$11({}, options), {
|
|
11061
11061
|
signal: _this.controller.signal
|
|
11062
11062
|
}))
|
|
11063
11063
|
];
|
|
@@ -11171,12 +11171,12 @@ var AssistantStream = /*#__PURE__*/ function(AbstractAssistantStreamRunner) {
|
|
|
11171
11171
|
return _this.controller.abort();
|
|
11172
11172
|
});
|
|
11173
11173
|
}
|
|
11174
|
-
body = _object_spread_props$
|
|
11174
|
+
body = _object_spread_props$M(_object_spread$11({}, params), {
|
|
11175
11175
|
stream: true
|
|
11176
11176
|
});
|
|
11177
11177
|
return [
|
|
11178
11178
|
4,
|
|
11179
|
-
run.create(threadId, body, _object_spread_props$
|
|
11179
|
+
run.create(threadId, body, _object_spread_props$M(_object_spread$11({}, options), {
|
|
11180
11180
|
signal: _this.controller.signal
|
|
11181
11181
|
}))
|
|
11182
11182
|
];
|
|
@@ -11290,8 +11290,8 @@ var AssistantStream = /*#__PURE__*/ function(AbstractAssistantStreamRunner) {
|
|
|
11290
11290
|
value: function createToolAssistantStream(threadId, runId, runs, body, options) {
|
|
11291
11291
|
var runner = new AssistantStream();
|
|
11292
11292
|
runner._run(function() {
|
|
11293
|
-
return runner._runToolAssistantStream(threadId, runId, runs, body, _object_spread_props$
|
|
11294
|
-
headers: _object_spread_props$
|
|
11293
|
+
return runner._runToolAssistantStream(threadId, runId, runs, body, _object_spread_props$M(_object_spread$11({}, options), {
|
|
11294
|
+
headers: _object_spread_props$M(_object_spread$11({}, options === null || options === void 0 ? void 0 : options.headers), {
|
|
11295
11295
|
"X-Stainless-Helper-Method": "stream"
|
|
11296
11296
|
})
|
|
11297
11297
|
}));
|
|
@@ -11304,8 +11304,8 @@ var AssistantStream = /*#__PURE__*/ function(AbstractAssistantStreamRunner) {
|
|
|
11304
11304
|
value: function createThreadAssistantStream(body, thread, options) {
|
|
11305
11305
|
var runner = new AssistantStream();
|
|
11306
11306
|
runner._run(function() {
|
|
11307
|
-
return runner._threadAssistantStream(body, thread, _object_spread_props$
|
|
11308
|
-
headers: _object_spread_props$
|
|
11307
|
+
return runner._threadAssistantStream(body, thread, _object_spread_props$M(_object_spread$11({}, options), {
|
|
11308
|
+
headers: _object_spread_props$M(_object_spread$11({}, options === null || options === void 0 ? void 0 : options.headers), {
|
|
11309
11309
|
"X-Stainless-Helper-Method": "stream"
|
|
11310
11310
|
})
|
|
11311
11311
|
}));
|
|
@@ -11318,8 +11318,8 @@ var AssistantStream = /*#__PURE__*/ function(AbstractAssistantStreamRunner) {
|
|
|
11318
11318
|
value: function createAssistantStream(threadId, runs, params, options) {
|
|
11319
11319
|
var runner = new AssistantStream();
|
|
11320
11320
|
runner._run(function() {
|
|
11321
|
-
return runner._runAssistantStream(threadId, runs, params, _object_spread_props$
|
|
11322
|
-
headers: _object_spread_props$
|
|
11321
|
+
return runner._runAssistantStream(threadId, runs, params, _object_spread_props$M(_object_spread$11({}, options), {
|
|
11322
|
+
headers: _object_spread_props$M(_object_spread$11({}, options === null || options === void 0 ? void 0 : options.headers), {
|
|
11323
11323
|
"X-Stainless-Helper-Method": "stream"
|
|
11324
11324
|
})
|
|
11325
11325
|
}));
|
|
@@ -11781,7 +11781,7 @@ function _object_spread$10(target) {
|
|
|
11781
11781
|
}
|
|
11782
11782
|
return target;
|
|
11783
11783
|
}
|
|
11784
|
-
function ownKeys$
|
|
11784
|
+
function ownKeys$L(object, enumerableOnly) {
|
|
11785
11785
|
var keys = Object.keys(object);
|
|
11786
11786
|
if (Object.getOwnPropertySymbols) {
|
|
11787
11787
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -11794,12 +11794,12 @@ function ownKeys$K(object, enumerableOnly) {
|
|
|
11794
11794
|
}
|
|
11795
11795
|
return keys;
|
|
11796
11796
|
}
|
|
11797
|
-
function _object_spread_props$
|
|
11797
|
+
function _object_spread_props$L(target, source) {
|
|
11798
11798
|
source = source != null ? source : {};
|
|
11799
11799
|
if (Object.getOwnPropertyDescriptors) {
|
|
11800
11800
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
11801
11801
|
} else {
|
|
11802
|
-
ownKeys$
|
|
11802
|
+
ownKeys$L(Object(source)).forEach(function(key) {
|
|
11803
11803
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
11804
11804
|
});
|
|
11805
11805
|
}
|
|
@@ -11859,7 +11859,7 @@ var Messages = /*#__PURE__*/ function(APIResource) {
|
|
|
11859
11859
|
* Create a message.
|
|
11860
11860
|
*/ key: "create",
|
|
11861
11861
|
value: function create(threadId, body, options) {
|
|
11862
|
-
return this._client.post("/threads/".concat(threadId, "/messages"), _object_spread_props$
|
|
11862
|
+
return this._client.post("/threads/".concat(threadId, "/messages"), _object_spread_props$L(_object_spread$10({
|
|
11863
11863
|
body: body
|
|
11864
11864
|
}, options), {
|
|
11865
11865
|
headers: _object_spread$10({
|
|
@@ -11873,7 +11873,7 @@ var Messages = /*#__PURE__*/ function(APIResource) {
|
|
|
11873
11873
|
* Retrieve a message.
|
|
11874
11874
|
*/ key: "retrieve",
|
|
11875
11875
|
value: function retrieve(threadId, messageId, options) {
|
|
11876
|
-
return this._client.get("/threads/".concat(threadId, "/messages/").concat(messageId), _object_spread_props$
|
|
11876
|
+
return this._client.get("/threads/".concat(threadId, "/messages/").concat(messageId), _object_spread_props$L(_object_spread$10({}, options), {
|
|
11877
11877
|
headers: _object_spread$10({
|
|
11878
11878
|
"OpenAI-Beta": "assistants=v2"
|
|
11879
11879
|
}, options === null || options === void 0 ? void 0 : options.headers)
|
|
@@ -11885,7 +11885,7 @@ var Messages = /*#__PURE__*/ function(APIResource) {
|
|
|
11885
11885
|
* Modifies a message.
|
|
11886
11886
|
*/ key: "update",
|
|
11887
11887
|
value: function update(threadId, messageId, body, options) {
|
|
11888
|
-
return this._client.post("/threads/".concat(threadId, "/messages/").concat(messageId), _object_spread_props$
|
|
11888
|
+
return this._client.post("/threads/".concat(threadId, "/messages/").concat(messageId), _object_spread_props$L(_object_spread$10({
|
|
11889
11889
|
body: body
|
|
11890
11890
|
}, options), {
|
|
11891
11891
|
headers: _object_spread$10({
|
|
@@ -11901,7 +11901,7 @@ var Messages = /*#__PURE__*/ function(APIResource) {
|
|
|
11901
11901
|
if (isRequestOptions(query)) {
|
|
11902
11902
|
return this.list(threadId, {}, query);
|
|
11903
11903
|
}
|
|
11904
|
-
return this._client.getAPIList("/threads/".concat(threadId, "/messages"), MessagesPage, _object_spread_props$
|
|
11904
|
+
return this._client.getAPIList("/threads/".concat(threadId, "/messages"), MessagesPage, _object_spread_props$L(_object_spread$10({
|
|
11905
11905
|
query: query
|
|
11906
11906
|
}, options), {
|
|
11907
11907
|
headers: _object_spread$10({
|
|
@@ -11915,7 +11915,7 @@ var Messages = /*#__PURE__*/ function(APIResource) {
|
|
|
11915
11915
|
* Deletes a message.
|
|
11916
11916
|
*/ key: "del",
|
|
11917
11917
|
value: function del(threadId, messageId, options) {
|
|
11918
|
-
return this._client.delete("/threads/".concat(threadId, "/messages/").concat(messageId), _object_spread_props$
|
|
11918
|
+
return this._client.delete("/threads/".concat(threadId, "/messages/").concat(messageId), _object_spread_props$L(_object_spread$10({}, options), {
|
|
11919
11919
|
headers: _object_spread$10({
|
|
11920
11920
|
"OpenAI-Beta": "assistants=v2"
|
|
11921
11921
|
}, options === null || options === void 0 ? void 0 : options.headers)
|
|
@@ -12011,7 +12011,7 @@ function _object_spread$$(target) {
|
|
|
12011
12011
|
}
|
|
12012
12012
|
return target;
|
|
12013
12013
|
}
|
|
12014
|
-
function ownKeys$
|
|
12014
|
+
function ownKeys$K(object, enumerableOnly) {
|
|
12015
12015
|
var keys = Object.keys(object);
|
|
12016
12016
|
if (Object.getOwnPropertySymbols) {
|
|
12017
12017
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -12024,12 +12024,12 @@ function ownKeys$J(object, enumerableOnly) {
|
|
|
12024
12024
|
}
|
|
12025
12025
|
return keys;
|
|
12026
12026
|
}
|
|
12027
|
-
function _object_spread_props$
|
|
12027
|
+
function _object_spread_props$K(target, source) {
|
|
12028
12028
|
source = source != null ? source : {};
|
|
12029
12029
|
if (Object.getOwnPropertyDescriptors) {
|
|
12030
12030
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
12031
12031
|
} else {
|
|
12032
|
-
ownKeys$
|
|
12032
|
+
ownKeys$K(Object(source)).forEach(function(key) {
|
|
12033
12033
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
12034
12034
|
});
|
|
12035
12035
|
}
|
|
@@ -12089,7 +12089,7 @@ var Steps = /*#__PURE__*/ function(APIResource) {
|
|
|
12089
12089
|
* Retrieves a run step.
|
|
12090
12090
|
*/ key: "retrieve",
|
|
12091
12091
|
value: function retrieve(threadId, runId, stepId, options) {
|
|
12092
|
-
return this._client.get("/threads/".concat(threadId, "/runs/").concat(runId, "/steps/").concat(stepId), _object_spread_props$
|
|
12092
|
+
return this._client.get("/threads/".concat(threadId, "/runs/").concat(runId, "/steps/").concat(stepId), _object_spread_props$K(_object_spread$$({}, options), {
|
|
12093
12093
|
headers: _object_spread$$({
|
|
12094
12094
|
"OpenAI-Beta": "assistants=v2"
|
|
12095
12095
|
}, options === null || options === void 0 ? void 0 : options.headers)
|
|
@@ -12103,7 +12103,7 @@ var Steps = /*#__PURE__*/ function(APIResource) {
|
|
|
12103
12103
|
if (isRequestOptions(query)) {
|
|
12104
12104
|
return this.list(threadId, runId, {}, query);
|
|
12105
12105
|
}
|
|
12106
|
-
return this._client.getAPIList("/threads/".concat(threadId, "/runs/").concat(runId, "/steps"), RunStepsPage, _object_spread_props$
|
|
12106
|
+
return this._client.getAPIList("/threads/".concat(threadId, "/runs/").concat(runId, "/steps"), RunStepsPage, _object_spread_props$K(_object_spread$$({
|
|
12107
12107
|
query: query
|
|
12108
12108
|
}, options), {
|
|
12109
12109
|
headers: _object_spread$$({
|
|
@@ -12230,7 +12230,7 @@ function _object_spread$_(target) {
|
|
|
12230
12230
|
}
|
|
12231
12231
|
return target;
|
|
12232
12232
|
}
|
|
12233
|
-
function ownKeys$
|
|
12233
|
+
function ownKeys$J(object, enumerableOnly) {
|
|
12234
12234
|
var keys = Object.keys(object);
|
|
12235
12235
|
if (Object.getOwnPropertySymbols) {
|
|
12236
12236
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -12243,12 +12243,12 @@ function ownKeys$I(object, enumerableOnly) {
|
|
|
12243
12243
|
}
|
|
12244
12244
|
return keys;
|
|
12245
12245
|
}
|
|
12246
|
-
function _object_spread_props$
|
|
12246
|
+
function _object_spread_props$J(target, source) {
|
|
12247
12247
|
source = source != null ? source : {};
|
|
12248
12248
|
if (Object.getOwnPropertyDescriptors) {
|
|
12249
12249
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
12250
12250
|
} else {
|
|
12251
|
-
ownKeys$
|
|
12251
|
+
ownKeys$J(Object(source)).forEach(function(key) {
|
|
12252
12252
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
12253
12253
|
});
|
|
12254
12254
|
}
|
|
@@ -12407,7 +12407,7 @@ var Runs = /*#__PURE__*/ function(APIResource) {
|
|
|
12407
12407
|
key: "create",
|
|
12408
12408
|
value: function create(threadId, body, options) {
|
|
12409
12409
|
var _body_stream;
|
|
12410
|
-
return this._client.post("/threads/".concat(threadId, "/runs"), _object_spread_props$
|
|
12410
|
+
return this._client.post("/threads/".concat(threadId, "/runs"), _object_spread_props$J(_object_spread$_({
|
|
12411
12411
|
body: body
|
|
12412
12412
|
}, options), {
|
|
12413
12413
|
headers: _object_spread$_({
|
|
@@ -12422,7 +12422,7 @@ var Runs = /*#__PURE__*/ function(APIResource) {
|
|
|
12422
12422
|
* Retrieves a run.
|
|
12423
12423
|
*/ key: "retrieve",
|
|
12424
12424
|
value: function retrieve(threadId, runId, options) {
|
|
12425
|
-
return this._client.get("/threads/".concat(threadId, "/runs/").concat(runId), _object_spread_props$
|
|
12425
|
+
return this._client.get("/threads/".concat(threadId, "/runs/").concat(runId), _object_spread_props$J(_object_spread$_({}, options), {
|
|
12426
12426
|
headers: _object_spread$_({
|
|
12427
12427
|
"OpenAI-Beta": "assistants=v2"
|
|
12428
12428
|
}, options === null || options === void 0 ? void 0 : options.headers)
|
|
@@ -12434,7 +12434,7 @@ var Runs = /*#__PURE__*/ function(APIResource) {
|
|
|
12434
12434
|
* Modifies a run.
|
|
12435
12435
|
*/ key: "update",
|
|
12436
12436
|
value: function update(threadId, runId, body, options) {
|
|
12437
|
-
return this._client.post("/threads/".concat(threadId, "/runs/").concat(runId), _object_spread_props$
|
|
12437
|
+
return this._client.post("/threads/".concat(threadId, "/runs/").concat(runId), _object_spread_props$J(_object_spread$_({
|
|
12438
12438
|
body: body
|
|
12439
12439
|
}, options), {
|
|
12440
12440
|
headers: _object_spread$_({
|
|
@@ -12450,7 +12450,7 @@ var Runs = /*#__PURE__*/ function(APIResource) {
|
|
|
12450
12450
|
if (isRequestOptions(query)) {
|
|
12451
12451
|
return this.list(threadId, {}, query);
|
|
12452
12452
|
}
|
|
12453
|
-
return this._client.getAPIList("/threads/".concat(threadId, "/runs"), RunsPage, _object_spread_props$
|
|
12453
|
+
return this._client.getAPIList("/threads/".concat(threadId, "/runs"), RunsPage, _object_spread_props$J(_object_spread$_({
|
|
12454
12454
|
query: query
|
|
12455
12455
|
}, options), {
|
|
12456
12456
|
headers: _object_spread$_({
|
|
@@ -12464,7 +12464,7 @@ var Runs = /*#__PURE__*/ function(APIResource) {
|
|
|
12464
12464
|
* Cancels a run that is `in_progress`.
|
|
12465
12465
|
*/ key: "cancel",
|
|
12466
12466
|
value: function cancel(threadId, runId, options) {
|
|
12467
|
-
return this._client.post("/threads/".concat(threadId, "/runs/").concat(runId, "/cancel"), _object_spread_props$
|
|
12467
|
+
return this._client.post("/threads/".concat(threadId, "/runs/").concat(runId, "/cancel"), _object_spread_props$J(_object_spread$_({}, options), {
|
|
12468
12468
|
headers: _object_spread$_({
|
|
12469
12469
|
"OpenAI-Beta": "assistants=v2"
|
|
12470
12470
|
}, options === null || options === void 0 ? void 0 : options.headers)
|
|
@@ -12527,7 +12527,7 @@ var Runs = /*#__PURE__*/ function(APIResource) {
|
|
|
12527
12527
|
return _ts_generator$E(this, function(_state) {
|
|
12528
12528
|
switch(_state.label){
|
|
12529
12529
|
case 0:
|
|
12530
|
-
headers = _object_spread_props$
|
|
12530
|
+
headers = _object_spread_props$J(_object_spread$_({}, options === null || options === void 0 ? void 0 : options.headers), {
|
|
12531
12531
|
"X-Stainless-Poll-Helper": "true"
|
|
12532
12532
|
});
|
|
12533
12533
|
if (options === null || options === void 0 ? void 0 : options.pollIntervalMs) {
|
|
@@ -12537,7 +12537,7 @@ var Runs = /*#__PURE__*/ function(APIResource) {
|
|
|
12537
12537
|
case 1:
|
|
12538
12538
|
return [
|
|
12539
12539
|
4,
|
|
12540
|
-
_this.retrieve(threadId, runId, _object_spread_props$
|
|
12540
|
+
_this.retrieve(threadId, runId, _object_spread_props$J(_object_spread$_({}, options), {
|
|
12541
12541
|
headers: _object_spread$_({}, options === null || options === void 0 ? void 0 : options.headers, headers)
|
|
12542
12542
|
})).withResponse()
|
|
12543
12543
|
];
|
|
@@ -12649,7 +12649,7 @@ var Runs = /*#__PURE__*/ function(APIResource) {
|
|
|
12649
12649
|
key: "submitToolOutputs",
|
|
12650
12650
|
value: function submitToolOutputs(threadId, runId, body, options) {
|
|
12651
12651
|
var _body_stream;
|
|
12652
|
-
return this._client.post("/threads/".concat(threadId, "/runs/").concat(runId, "/submit_tool_outputs"), _object_spread_props$
|
|
12652
|
+
return this._client.post("/threads/".concat(threadId, "/runs/").concat(runId, "/submit_tool_outputs"), _object_spread_props$J(_object_spread$_({
|
|
12653
12653
|
body: body
|
|
12654
12654
|
}, options), {
|
|
12655
12655
|
headers: _object_spread$_({
|
|
@@ -12822,7 +12822,7 @@ function _object_spread$Z(target) {
|
|
|
12822
12822
|
}
|
|
12823
12823
|
return target;
|
|
12824
12824
|
}
|
|
12825
|
-
function ownKeys$
|
|
12825
|
+
function ownKeys$I(object, enumerableOnly) {
|
|
12826
12826
|
var keys = Object.keys(object);
|
|
12827
12827
|
if (Object.getOwnPropertySymbols) {
|
|
12828
12828
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -12835,12 +12835,12 @@ function ownKeys$H(object, enumerableOnly) {
|
|
|
12835
12835
|
}
|
|
12836
12836
|
return keys;
|
|
12837
12837
|
}
|
|
12838
|
-
function _object_spread_props$
|
|
12838
|
+
function _object_spread_props$I(target, source) {
|
|
12839
12839
|
source = source != null ? source : {};
|
|
12840
12840
|
if (Object.getOwnPropertyDescriptors) {
|
|
12841
12841
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
12842
12842
|
} else {
|
|
12843
|
-
ownKeys$
|
|
12843
|
+
ownKeys$I(Object(source)).forEach(function(key) {
|
|
12844
12844
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
12845
12845
|
});
|
|
12846
12846
|
}
|
|
@@ -13003,7 +13003,7 @@ var Threads = /*#__PURE__*/ function(APIResource) {
|
|
|
13003
13003
|
if (isRequestOptions(body)) {
|
|
13004
13004
|
return this.create({}, body);
|
|
13005
13005
|
}
|
|
13006
|
-
return this._client.post("/threads", _object_spread_props$
|
|
13006
|
+
return this._client.post("/threads", _object_spread_props$I(_object_spread$Z({
|
|
13007
13007
|
body: body
|
|
13008
13008
|
}, options), {
|
|
13009
13009
|
headers: _object_spread$Z({
|
|
@@ -13017,7 +13017,7 @@ var Threads = /*#__PURE__*/ function(APIResource) {
|
|
|
13017
13017
|
* Retrieves a thread.
|
|
13018
13018
|
*/ key: "retrieve",
|
|
13019
13019
|
value: function retrieve(threadId, options) {
|
|
13020
|
-
return this._client.get("/threads/".concat(threadId), _object_spread_props$
|
|
13020
|
+
return this._client.get("/threads/".concat(threadId), _object_spread_props$I(_object_spread$Z({}, options), {
|
|
13021
13021
|
headers: _object_spread$Z({
|
|
13022
13022
|
"OpenAI-Beta": "assistants=v2"
|
|
13023
13023
|
}, options === null || options === void 0 ? void 0 : options.headers)
|
|
@@ -13029,7 +13029,7 @@ var Threads = /*#__PURE__*/ function(APIResource) {
|
|
|
13029
13029
|
* Modifies a thread.
|
|
13030
13030
|
*/ key: "update",
|
|
13031
13031
|
value: function update(threadId, body, options) {
|
|
13032
|
-
return this._client.post("/threads/".concat(threadId), _object_spread_props$
|
|
13032
|
+
return this._client.post("/threads/".concat(threadId), _object_spread_props$I(_object_spread$Z({
|
|
13033
13033
|
body: body
|
|
13034
13034
|
}, options), {
|
|
13035
13035
|
headers: _object_spread$Z({
|
|
@@ -13043,7 +13043,7 @@ var Threads = /*#__PURE__*/ function(APIResource) {
|
|
|
13043
13043
|
* Delete a thread.
|
|
13044
13044
|
*/ key: "del",
|
|
13045
13045
|
value: function del(threadId, options) {
|
|
13046
|
-
return this._client.delete("/threads/".concat(threadId), _object_spread_props$
|
|
13046
|
+
return this._client.delete("/threads/".concat(threadId), _object_spread_props$I(_object_spread$Z({}, options), {
|
|
13047
13047
|
headers: _object_spread$Z({
|
|
13048
13048
|
"OpenAI-Beta": "assistants=v2"
|
|
13049
13049
|
}, options === null || options === void 0 ? void 0 : options.headers)
|
|
@@ -13054,7 +13054,7 @@ var Threads = /*#__PURE__*/ function(APIResource) {
|
|
|
13054
13054
|
key: "createAndRun",
|
|
13055
13055
|
value: function createAndRun(body, options) {
|
|
13056
13056
|
var _body_stream;
|
|
13057
|
-
return this._client.post("/threads/runs", _object_spread_props$
|
|
13057
|
+
return this._client.post("/threads/runs", _object_spread_props$I(_object_spread$Z({
|
|
13058
13058
|
body: body
|
|
13059
13059
|
}, options), {
|
|
13060
13060
|
headers: _object_spread$Z({
|
|
@@ -13417,7 +13417,7 @@ function _object_spread$Y(target) {
|
|
|
13417
13417
|
}
|
|
13418
13418
|
return target;
|
|
13419
13419
|
}
|
|
13420
|
-
function ownKeys$
|
|
13420
|
+
function ownKeys$H(object, enumerableOnly) {
|
|
13421
13421
|
var keys = Object.keys(object);
|
|
13422
13422
|
if (Object.getOwnPropertySymbols) {
|
|
13423
13423
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -13430,12 +13430,12 @@ function ownKeys$G(object, enumerableOnly) {
|
|
|
13430
13430
|
}
|
|
13431
13431
|
return keys;
|
|
13432
13432
|
}
|
|
13433
|
-
function _object_spread_props$
|
|
13433
|
+
function _object_spread_props$H(target, source) {
|
|
13434
13434
|
source = source != null ? source : {};
|
|
13435
13435
|
if (Object.getOwnPropertyDescriptors) {
|
|
13436
13436
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
13437
13437
|
} else {
|
|
13438
|
-
ownKeys$
|
|
13438
|
+
ownKeys$H(Object(source)).forEach(function(key) {
|
|
13439
13439
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
13440
13440
|
});
|
|
13441
13441
|
}
|
|
@@ -13592,7 +13592,7 @@ var Files$1 = /*#__PURE__*/ function(APIResource) {
|
|
|
13592
13592
|
* [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object).
|
|
13593
13593
|
*/ key: "create",
|
|
13594
13594
|
value: function create(vectorStoreId, body, options) {
|
|
13595
|
-
return this._client.post("/vector_stores/".concat(vectorStoreId, "/files"), _object_spread_props$
|
|
13595
|
+
return this._client.post("/vector_stores/".concat(vectorStoreId, "/files"), _object_spread_props$H(_object_spread$Y({
|
|
13596
13596
|
body: body
|
|
13597
13597
|
}, options), {
|
|
13598
13598
|
headers: _object_spread$Y({
|
|
@@ -13606,7 +13606,7 @@ var Files$1 = /*#__PURE__*/ function(APIResource) {
|
|
|
13606
13606
|
* Retrieves a vector store file.
|
|
13607
13607
|
*/ key: "retrieve",
|
|
13608
13608
|
value: function retrieve(vectorStoreId, fileId, options) {
|
|
13609
|
-
return this._client.get("/vector_stores/".concat(vectorStoreId, "/files/").concat(fileId), _object_spread_props$
|
|
13609
|
+
return this._client.get("/vector_stores/".concat(vectorStoreId, "/files/").concat(fileId), _object_spread_props$H(_object_spread$Y({}, options), {
|
|
13610
13610
|
headers: _object_spread$Y({
|
|
13611
13611
|
"OpenAI-Beta": "assistants=v2"
|
|
13612
13612
|
}, options === null || options === void 0 ? void 0 : options.headers)
|
|
@@ -13620,7 +13620,7 @@ var Files$1 = /*#__PURE__*/ function(APIResource) {
|
|
|
13620
13620
|
if (isRequestOptions(query)) {
|
|
13621
13621
|
return this.list(vectorStoreId, {}, query);
|
|
13622
13622
|
}
|
|
13623
|
-
return this._client.getAPIList("/vector_stores/".concat(vectorStoreId, "/files"), VectorStoreFilesPage, _object_spread_props$
|
|
13623
|
+
return this._client.getAPIList("/vector_stores/".concat(vectorStoreId, "/files"), VectorStoreFilesPage, _object_spread_props$H(_object_spread$Y({
|
|
13624
13624
|
query: query
|
|
13625
13625
|
}, options), {
|
|
13626
13626
|
headers: _object_spread$Y({
|
|
@@ -13637,7 +13637,7 @@ var Files$1 = /*#__PURE__*/ function(APIResource) {
|
|
|
13637
13637
|
* endpoint.
|
|
13638
13638
|
*/ key: "del",
|
|
13639
13639
|
value: function del(vectorStoreId, fileId, options) {
|
|
13640
|
-
return this._client.delete("/vector_stores/".concat(vectorStoreId, "/files/").concat(fileId), _object_spread_props$
|
|
13640
|
+
return this._client.delete("/vector_stores/".concat(vectorStoreId, "/files/").concat(fileId), _object_spread_props$H(_object_spread$Y({}, options), {
|
|
13641
13641
|
headers: _object_spread$Y({
|
|
13642
13642
|
"OpenAI-Beta": "assistants=v2"
|
|
13643
13643
|
}, options === null || options === void 0 ? void 0 : options.headers)
|
|
@@ -13689,7 +13689,7 @@ var Files$1 = /*#__PURE__*/ function(APIResource) {
|
|
|
13689
13689
|
return _ts_generator$B(this, function(_state) {
|
|
13690
13690
|
switch(_state.label){
|
|
13691
13691
|
case 0:
|
|
13692
|
-
headers = _object_spread_props$
|
|
13692
|
+
headers = _object_spread_props$H(_object_spread$Y({}, options === null || options === void 0 ? void 0 : options.headers), {
|
|
13693
13693
|
"X-Stainless-Poll-Helper": "true"
|
|
13694
13694
|
});
|
|
13695
13695
|
if (options === null || options === void 0 ? void 0 : options.pollIntervalMs) {
|
|
@@ -13699,7 +13699,7 @@ var Files$1 = /*#__PURE__*/ function(APIResource) {
|
|
|
13699
13699
|
case 1:
|
|
13700
13700
|
return [
|
|
13701
13701
|
4,
|
|
13702
|
-
_this.retrieve(vectorStoreId, fileId, _object_spread_props$
|
|
13702
|
+
_this.retrieve(vectorStoreId, fileId, _object_spread_props$H(_object_spread$Y({}, options), {
|
|
13703
13703
|
headers: headers
|
|
13704
13704
|
})).withResponse()
|
|
13705
13705
|
];
|
|
@@ -13967,7 +13967,7 @@ function _object_spread$X(target) {
|
|
|
13967
13967
|
}
|
|
13968
13968
|
return target;
|
|
13969
13969
|
}
|
|
13970
|
-
function ownKeys$
|
|
13970
|
+
function ownKeys$G(object, enumerableOnly) {
|
|
13971
13971
|
var keys = Object.keys(object);
|
|
13972
13972
|
if (Object.getOwnPropertySymbols) {
|
|
13973
13973
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -13980,12 +13980,12 @@ function ownKeys$F(object, enumerableOnly) {
|
|
|
13980
13980
|
}
|
|
13981
13981
|
return keys;
|
|
13982
13982
|
}
|
|
13983
|
-
function _object_spread_props$
|
|
13983
|
+
function _object_spread_props$G(target, source) {
|
|
13984
13984
|
source = source != null ? source : {};
|
|
13985
13985
|
if (Object.getOwnPropertyDescriptors) {
|
|
13986
13986
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
13987
13987
|
} else {
|
|
13988
|
-
ownKeys$
|
|
13988
|
+
ownKeys$G(Object(source)).forEach(function(key) {
|
|
13989
13989
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
13990
13990
|
});
|
|
13991
13991
|
}
|
|
@@ -14151,7 +14151,7 @@ var FileBatches = /*#__PURE__*/ function(APIResource) {
|
|
|
14151
14151
|
* Create a vector store file batch.
|
|
14152
14152
|
*/ key: "create",
|
|
14153
14153
|
value: function create(vectorStoreId, body, options) {
|
|
14154
|
-
return this._client.post("/vector_stores/".concat(vectorStoreId, "/file_batches"), _object_spread_props$
|
|
14154
|
+
return this._client.post("/vector_stores/".concat(vectorStoreId, "/file_batches"), _object_spread_props$G(_object_spread$X({
|
|
14155
14155
|
body: body
|
|
14156
14156
|
}, options), {
|
|
14157
14157
|
headers: _object_spread$X({
|
|
@@ -14165,7 +14165,7 @@ var FileBatches = /*#__PURE__*/ function(APIResource) {
|
|
|
14165
14165
|
* Retrieves a vector store file batch.
|
|
14166
14166
|
*/ key: "retrieve",
|
|
14167
14167
|
value: function retrieve(vectorStoreId, batchId, options) {
|
|
14168
|
-
return this._client.get("/vector_stores/".concat(vectorStoreId, "/file_batches/").concat(batchId), _object_spread_props$
|
|
14168
|
+
return this._client.get("/vector_stores/".concat(vectorStoreId, "/file_batches/").concat(batchId), _object_spread_props$G(_object_spread$X({}, options), {
|
|
14169
14169
|
headers: _object_spread$X({
|
|
14170
14170
|
"OpenAI-Beta": "assistants=v2"
|
|
14171
14171
|
}, options === null || options === void 0 ? void 0 : options.headers)
|
|
@@ -14178,7 +14178,7 @@ var FileBatches = /*#__PURE__*/ function(APIResource) {
|
|
|
14178
14178
|
* files in this batch as soon as possible.
|
|
14179
14179
|
*/ key: "cancel",
|
|
14180
14180
|
value: function cancel(vectorStoreId, batchId, options) {
|
|
14181
|
-
return this._client.post("/vector_stores/".concat(vectorStoreId, "/file_batches/").concat(batchId, "/cancel"), _object_spread_props$
|
|
14181
|
+
return this._client.post("/vector_stores/".concat(vectorStoreId, "/file_batches/").concat(batchId, "/cancel"), _object_spread_props$G(_object_spread$X({}, options), {
|
|
14182
14182
|
headers: _object_spread$X({
|
|
14183
14183
|
"OpenAI-Beta": "assistants=v2"
|
|
14184
14184
|
}, options === null || options === void 0 ? void 0 : options.headers)
|
|
@@ -14223,7 +14223,7 @@ var FileBatches = /*#__PURE__*/ function(APIResource) {
|
|
|
14223
14223
|
if (isRequestOptions(query)) {
|
|
14224
14224
|
return this.listFiles(vectorStoreId, batchId, {}, query);
|
|
14225
14225
|
}
|
|
14226
|
-
return this._client.getAPIList("/vector_stores/".concat(vectorStoreId, "/file_batches/").concat(batchId, "/files"), VectorStoreFilesPage, _object_spread_props$
|
|
14226
|
+
return this._client.getAPIList("/vector_stores/".concat(vectorStoreId, "/file_batches/").concat(batchId, "/files"), VectorStoreFilesPage, _object_spread_props$G(_object_spread$X({
|
|
14227
14227
|
query: query
|
|
14228
14228
|
}, options), {
|
|
14229
14229
|
headers: _object_spread$X({
|
|
@@ -14246,7 +14246,7 @@ var FileBatches = /*#__PURE__*/ function(APIResource) {
|
|
|
14246
14246
|
return _ts_generator$A(this, function(_state) {
|
|
14247
14247
|
switch(_state.label){
|
|
14248
14248
|
case 0:
|
|
14249
|
-
headers = _object_spread_props$
|
|
14249
|
+
headers = _object_spread_props$G(_object_spread$X({}, options === null || options === void 0 ? void 0 : options.headers), {
|
|
14250
14250
|
"X-Stainless-Poll-Helper": "true"
|
|
14251
14251
|
});
|
|
14252
14252
|
if (options === null || options === void 0 ? void 0 : options.pollIntervalMs) {
|
|
@@ -14256,7 +14256,7 @@ var FileBatches = /*#__PURE__*/ function(APIResource) {
|
|
|
14256
14256
|
case 1:
|
|
14257
14257
|
return [
|
|
14258
14258
|
4,
|
|
14259
|
-
_this.retrieve(vectorStoreId, batchId, _object_spread_props$
|
|
14259
|
+
_this.retrieve(vectorStoreId, batchId, _object_spread_props$G(_object_spread$X({}, options), {
|
|
14260
14260
|
headers: headers
|
|
14261
14261
|
})).withResponse()
|
|
14262
14262
|
];
|
|
@@ -14537,7 +14537,7 @@ function _object_spread$W(target) {
|
|
|
14537
14537
|
}
|
|
14538
14538
|
return target;
|
|
14539
14539
|
}
|
|
14540
|
-
function ownKeys$
|
|
14540
|
+
function ownKeys$F(object, enumerableOnly) {
|
|
14541
14541
|
var keys = Object.keys(object);
|
|
14542
14542
|
if (Object.getOwnPropertySymbols) {
|
|
14543
14543
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -14550,12 +14550,12 @@ function ownKeys$E(object, enumerableOnly) {
|
|
|
14550
14550
|
}
|
|
14551
14551
|
return keys;
|
|
14552
14552
|
}
|
|
14553
|
-
function _object_spread_props$
|
|
14553
|
+
function _object_spread_props$F(target, source) {
|
|
14554
14554
|
source = source != null ? source : {};
|
|
14555
14555
|
if (Object.getOwnPropertyDescriptors) {
|
|
14556
14556
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
14557
14557
|
} else {
|
|
14558
|
-
ownKeys$
|
|
14558
|
+
ownKeys$F(Object(source)).forEach(function(key) {
|
|
14559
14559
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
14560
14560
|
});
|
|
14561
14561
|
}
|
|
@@ -14621,7 +14621,7 @@ var VectorStores = /*#__PURE__*/ function(APIResource) {
|
|
|
14621
14621
|
* Create a vector store.
|
|
14622
14622
|
*/ key: "create",
|
|
14623
14623
|
value: function create(body, options) {
|
|
14624
|
-
return this._client.post("/vector_stores", _object_spread_props$
|
|
14624
|
+
return this._client.post("/vector_stores", _object_spread_props$F(_object_spread$W({
|
|
14625
14625
|
body: body
|
|
14626
14626
|
}, options), {
|
|
14627
14627
|
headers: _object_spread$W({
|
|
@@ -14635,7 +14635,7 @@ var VectorStores = /*#__PURE__*/ function(APIResource) {
|
|
|
14635
14635
|
* Retrieves a vector store.
|
|
14636
14636
|
*/ key: "retrieve",
|
|
14637
14637
|
value: function retrieve(vectorStoreId, options) {
|
|
14638
|
-
return this._client.get("/vector_stores/".concat(vectorStoreId), _object_spread_props$
|
|
14638
|
+
return this._client.get("/vector_stores/".concat(vectorStoreId), _object_spread_props$F(_object_spread$W({}, options), {
|
|
14639
14639
|
headers: _object_spread$W({
|
|
14640
14640
|
"OpenAI-Beta": "assistants=v2"
|
|
14641
14641
|
}, options === null || options === void 0 ? void 0 : options.headers)
|
|
@@ -14647,7 +14647,7 @@ var VectorStores = /*#__PURE__*/ function(APIResource) {
|
|
|
14647
14647
|
* Modifies a vector store.
|
|
14648
14648
|
*/ key: "update",
|
|
14649
14649
|
value: function update(vectorStoreId, body, options) {
|
|
14650
|
-
return this._client.post("/vector_stores/".concat(vectorStoreId), _object_spread_props$
|
|
14650
|
+
return this._client.post("/vector_stores/".concat(vectorStoreId), _object_spread_props$F(_object_spread$W({
|
|
14651
14651
|
body: body
|
|
14652
14652
|
}, options), {
|
|
14653
14653
|
headers: _object_spread$W({
|
|
@@ -14663,7 +14663,7 @@ var VectorStores = /*#__PURE__*/ function(APIResource) {
|
|
|
14663
14663
|
if (isRequestOptions(query)) {
|
|
14664
14664
|
return this.list({}, query);
|
|
14665
14665
|
}
|
|
14666
|
-
return this._client.getAPIList("/vector_stores", VectorStoresPage, _object_spread_props$
|
|
14666
|
+
return this._client.getAPIList("/vector_stores", VectorStoresPage, _object_spread_props$F(_object_spread$W({
|
|
14667
14667
|
query: query
|
|
14668
14668
|
}, options), {
|
|
14669
14669
|
headers: _object_spread$W({
|
|
@@ -14677,7 +14677,7 @@ var VectorStores = /*#__PURE__*/ function(APIResource) {
|
|
|
14677
14677
|
* Delete a vector store.
|
|
14678
14678
|
*/ key: "del",
|
|
14679
14679
|
value: function del(vectorStoreId, options) {
|
|
14680
|
-
return this._client.delete("/vector_stores/".concat(vectorStoreId), _object_spread_props$
|
|
14680
|
+
return this._client.delete("/vector_stores/".concat(vectorStoreId), _object_spread_props$F(_object_spread$W({}, options), {
|
|
14681
14681
|
headers: _object_spread$W({
|
|
14682
14682
|
"OpenAI-Beta": "assistants=v2"
|
|
14683
14683
|
}, options === null || options === void 0 ? void 0 : options.headers)
|
|
@@ -14874,7 +14874,7 @@ function _object_spread$V(target) {
|
|
|
14874
14874
|
}
|
|
14875
14875
|
return target;
|
|
14876
14876
|
}
|
|
14877
|
-
function ownKeys$
|
|
14877
|
+
function ownKeys$E(object, enumerableOnly) {
|
|
14878
14878
|
var keys = Object.keys(object);
|
|
14879
14879
|
if (Object.getOwnPropertySymbols) {
|
|
14880
14880
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -14887,12 +14887,12 @@ function ownKeys$D(object, enumerableOnly) {
|
|
|
14887
14887
|
}
|
|
14888
14888
|
return keys;
|
|
14889
14889
|
}
|
|
14890
|
-
function _object_spread_props$
|
|
14890
|
+
function _object_spread_props$E(target, source) {
|
|
14891
14891
|
source = source != null ? source : {};
|
|
14892
14892
|
if (Object.getOwnPropertyDescriptors) {
|
|
14893
14893
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
14894
14894
|
} else {
|
|
14895
|
-
ownKeys$
|
|
14895
|
+
ownKeys$E(Object(source)).forEach(function(key) {
|
|
14896
14896
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
14897
14897
|
});
|
|
14898
14898
|
}
|
|
@@ -14951,7 +14951,7 @@ var Completions = /*#__PURE__*/ function(APIResource) {
|
|
|
14951
14951
|
key: "create",
|
|
14952
14952
|
value: function create(body, options) {
|
|
14953
14953
|
var _body_stream;
|
|
14954
|
-
return this._client.post("/completions", _object_spread_props$
|
|
14954
|
+
return this._client.post("/completions", _object_spread_props$E(_object_spread$V({
|
|
14955
14955
|
body: body
|
|
14956
14956
|
}, options), {
|
|
14957
14957
|
stream: (_body_stream = body.stream) !== null && _body_stream !== void 0 ? _body_stream : false
|
|
@@ -15036,6 +15036,30 @@ function _object_spread$U(target) {
|
|
|
15036
15036
|
}
|
|
15037
15037
|
return target;
|
|
15038
15038
|
}
|
|
15039
|
+
function ownKeys$D(object, enumerableOnly) {
|
|
15040
|
+
var keys = Object.keys(object);
|
|
15041
|
+
if (Object.getOwnPropertySymbols) {
|
|
15042
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
15043
|
+
if (enumerableOnly) {
|
|
15044
|
+
symbols = symbols.filter(function(sym) {
|
|
15045
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
15046
|
+
});
|
|
15047
|
+
}
|
|
15048
|
+
keys.push.apply(keys, symbols);
|
|
15049
|
+
}
|
|
15050
|
+
return keys;
|
|
15051
|
+
}
|
|
15052
|
+
function _object_spread_props$D(target, source) {
|
|
15053
|
+
source = source != null ? source : {};
|
|
15054
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
15055
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
15056
|
+
} else {
|
|
15057
|
+
ownKeys$D(Object(source)).forEach(function(key) {
|
|
15058
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
15059
|
+
});
|
|
15060
|
+
}
|
|
15061
|
+
return target;
|
|
15062
|
+
}
|
|
15039
15063
|
function _possible_constructor_return$K(self, call) {
|
|
15040
15064
|
if (call && (_type_of$R(call) === "object" || typeof call === "function")) {
|
|
15041
15065
|
return call;
|
|
@@ -15090,9 +15114,18 @@ var Embeddings$1 = /*#__PURE__*/ function(APIResource) {
|
|
|
15090
15114
|
* Creates an embedding vector representing the input text.
|
|
15091
15115
|
*/ key: "create",
|
|
15092
15116
|
value: function create(body, options) {
|
|
15093
|
-
|
|
15117
|
+
console.log("embeddings", {
|
|
15118
|
+
body: body,
|
|
15119
|
+
options: options
|
|
15120
|
+
});
|
|
15121
|
+
return this._client.post("/embeddings", _object_spread_props$D(_object_spread$U({
|
|
15094
15122
|
body: body
|
|
15095
|
-
}, options)
|
|
15123
|
+
}, options), {
|
|
15124
|
+
headers: {
|
|
15125
|
+
"Content-Type": "application/json",
|
|
15126
|
+
"Authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJ2WFdSMGVlazhRZC1RVGNsMUQ4LUlBcFNTSk1rMk1pa19YbDk3NVpodXA4In0.eyJleHAiOjE3Mjk1MDYyNDcsImlhdCI6MTcyOTUwNTM0NywiYXV0aF90aW1lIjoxNzI5NDk0OTczLCJqdGkiOiJiMDE4NzU3Yi05YzIxLTQ4ZTUtOTJmNS1jZTE4MzY0NmMyNDciLCJpc3MiOiJodHRwczovL2Rldi5rZXljbG9hay50YXJkaWdyYWRlLm5ldC9yZWFsbXMvZGV2IiwiYXVkIjpbImdyYXZpdGVlIiwiYWNjb3VudCJdLCJzdWIiOiI2ZWM2MGNiZi1mY2U3LTRhNmEtOTM5MS1mNGE2NWZhNTNjNmEiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJ0YXJkaS1jaGF0Ym90Iiwibm9uY2UiOiI3NTg2MzVkNS02OGE1LTQxYWMtODE4NS0zNzU2NTIwZDhmNWYiLCJzZXNzaW9uX3N0YXRlIjoiMDcyZTliYzYtMzQzYS00OTAyLTlkZTUtMTk4MzBjNDU3MGY1IiwiYWNyIjoiMCIsImFsbG93ZWQtb3JpZ2lucyI6WyIqIl0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJkZWZhdWx0LXJvbGVzLWRldiIsIkNIQVRCT1RfQUNDRVNTIiwiU0lNUExFWF9DUkVBVEVfQUNDRVNTIiwiQ0hBVEJPVF9BRE1JTiIsInJlYWRlciIsIm9mZmxpbmVfYWNjZXNzIiwid3JpdGVyIiwidW1hX2F1dGhvcml6YXRpb24iXX0sInJlc291cmNlX2FjY2VzcyI6eyJncmF2aXRlZSI6eyJyb2xlcyI6WyJHUkFWSVRFRV9BRE1JTiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJvcGVuaWQgZW1haWwgcHJvZmlsZSIsInNpZCI6IjA3MmU5YmM2LTM0M2EtNDkwMi05ZGU1LTE5ODMwYzQ1NzBmNSIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwibmFtZSI6Ik1hcmMgQlVJTFMiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJleHQtbWJ1aWxzIiwiZ2l2ZW5fbmFtZSI6Ik1hcmMiLCJmYW1pbHlfbmFtZSI6IkJVSUxTIiwiZW1haWwiOiJtYXJjLmJ1aWxzQHByZXN0YS50ZXNzaS5mciJ9.v4npG5s9INNkpyyRgPoHAz9hg1fQBVilQ037M5pHbTcowIs8hEWA6ObgCUWkGnnvbVdXo9EZ-_DbN_izceFRAssvbXkD64VIwG1Nnvqbt6mdL_HzhCtUKrCvXGua8CdR7PDLsi3h1p0mTzOPeSJibx95l6wDoD1FQmnopd9Hxia2aLDA_TXaiQNRfK8x_o5sn4QOprZ7p_mSTMAcUErYGZkbcjX3Hwb9jD_khYrvycQBi4pSDlYRPCl4y1Nq57Ymh_7DT2hRyCJQdToT3bcUNeTR9qMe7B2fDjNGZHj99ZQwlKs90uGVEkXzHDYrY-eTR_nWbORzEihSR2XjIJLItg"
|
|
15127
|
+
}
|
|
15128
|
+
}));
|
|
15096
15129
|
}
|
|
15097
15130
|
}
|
|
15098
15131
|
]);
|
|
@@ -67285,6 +67318,7 @@ function _ts_generator$1(thisArg, body) {
|
|
|
67285
67318
|
if (_this.dimensions) {
|
|
67286
67319
|
params.dimensions = _this.dimensions;
|
|
67287
67320
|
}
|
|
67321
|
+
console.log("params", params);
|
|
67288
67322
|
return [
|
|
67289
67323
|
4,
|
|
67290
67324
|
_this.embeddingWithRetry(params)
|
|
@@ -67341,6 +67375,7 @@ function _ts_generator$1(thisArg, body) {
|
|
|
67341
67375
|
"api-version": _this.azureOpenAIApiVersion
|
|
67342
67376
|
}, requestOptions.query);
|
|
67343
67377
|
}
|
|
67378
|
+
console.log("request", request, requestOptions);
|
|
67344
67379
|
return [
|
|
67345
67380
|
2,
|
|
67346
67381
|
_this.caller.call(/*#__PURE__*/ _async_to_generator$1(function() {
|
|
@@ -67354,18 +67389,22 @@ function _ts_generator$1(thisArg, body) {
|
|
|
67354
67389
|
,
|
|
67355
67390
|
3
|
|
67356
67391
|
]);
|
|
67392
|
+
console.log("request call", request, requestOptions);
|
|
67393
|
+
console.log("this.client.embeddings.create", _this.client.embeddings.create);
|
|
67357
67394
|
return [
|
|
67358
67395
|
4,
|
|
67359
67396
|
_this.client.embeddings.create(request, requestOptions)
|
|
67360
67397
|
];
|
|
67361
67398
|
case 1:
|
|
67362
67399
|
res = _state.sent();
|
|
67400
|
+
console.log("res", res);
|
|
67363
67401
|
return [
|
|
67364
67402
|
2,
|
|
67365
67403
|
res
|
|
67366
67404
|
];
|
|
67367
67405
|
case 2:
|
|
67368
67406
|
e = _state.sent();
|
|
67407
|
+
console.log("error", e);
|
|
67369
67408
|
error = wrapOpenAIClientError(e);
|
|
67370
67409
|
throw error;
|
|
67371
67410
|
case 3:
|