/
opt
/
canhelp
/
node_modules
/
openai
/
core
/
/opt/canhelp/node_modules/openai/core
mkdir
upload
Name
Size
Mode
Actions
api-promise.d.mts
2389
0644
edit
dl
rm
api-promise.d.mts.map
1492
0644
edit
dl
rm
api-promise.d.ts
2385
0644
edit
dl
rm
api-promise.d.ts.map
1491
0644
edit
dl
rm
api-promise.js
3187
0644
edit
dl
rm
api-promise.js.map
1713
0644
edit
dl
rm
api-promise.mjs
3078
0644
edit
dl
rm
api-promise.mjs.map
1717
0644
edit
dl
rm
error.d.mts
2451
0644
edit
dl
rm
error.d.mts.map
1983
0644
edit
dl
rm
error.d.ts
2450
0644
edit
dl
rm
error.d.ts.map
1982
0644
edit
dl
rm
error.js
5289
0644
edit
dl
rm
error.js.map
3792
0644
edit
dl
rm
error.mjs
4028
0644
edit
dl
rm
error.mjs.map
3676
0644
edit
dl
rm
EventEmitter.d.mts
2690
0644
edit
dl
rm
EventEmitter.d.mts.map
1347
0644
edit
dl
rm
EventEmitter.d.ts
2689
0644
edit
dl
rm
EventEmitter.d.ts.map
1346
0644
edit
dl
rm
EventEmitter.js
3516
0644
edit
dl
rm
EventEmitter.js.map
1742
0644
edit
dl
rm
EventEmitter.mjs
3330
0644
edit
dl
rm
EventEmitter.mjs.map
1732
0644
edit
dl
rm
pagination.d.mts
3570
0644
edit
dl
rm
pagination.d.mts.map
2807
0644
edit
dl
rm
pagination.d.ts
3565
0644
edit
dl
rm
pagination.d.ts.map
2806
0644
edit
dl
rm
pagination.js
5029
0644
edit
dl
rm
pagination.js.map
3788
0644
edit
dl
rm
pagination.mjs
4657
0644
edit
dl
rm
pagination.mjs.map
3760
0644
edit
dl
rm
resource.d.mts
194
0644
edit
dl
rm
resource.d.mts.map
221
0644
edit
dl
rm
resource.d.ts
192
0644
edit
dl
rm
resource.d.ts.map
220
0644
edit
dl
rm
resource.js
350
0644
edit
dl
rm
resource.js.map
223
0644
edit
dl
rm
resource.mjs
216
0644
edit
dl
rm
resource.mjs.map
215
0644
edit
dl
rm
streaming.d.mts
1489
0644
edit
dl
rm
streaming.d.mts.map
1076
0644
edit
dl
rm
streaming.d.ts
1486
0644
edit
dl
rm
streaming.d.ts.map
1075
0644
edit
dl
rm
streaming.js
10845
0644
edit
dl
rm
streaming.js.map
8594
0644
edit
dl
rm
streaming.mjs
10603
0644
edit
dl
rm
streaming.mjs.map
8600
0644
edit
dl
rm
uploads.d.mts
165
0644
edit
dl
rm
uploads.d.mts.map
174
0644
edit
dl
rm
uploads.d.ts
162
0644
edit
dl
rm
uploads.d.ts.map
173
0644
edit
dl
rm
uploads.js
299
0644
edit
dl
rm
uploads.js.map
147
0644
edit
dl
rm
uploads.mjs
86
0644
edit
dl
rm
uploads.mjs.map
132
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/openai/core/api-promise.js
(3187B)
"use strict"; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. var _APIPromise_client; Object.defineProperty(exports, "__esModule", { value: true }); exports.APIPromise = void 0; const tslib_1 = require("../internal/tslib.js"); const parse_1 = require("../internal/parse.js"); /** * A subclass of `Promise` providing additional helper methods * for interacting with the SDK. */ class APIPromise extends Promise { constructor(client, responsePromise, parseResponse = parse_1.defaultParseResponse) { super((resolve) => { // this is maybe a bit weird but this has to be a no-op to not implicitly // parse the response body; instead .then, .catch, .finally are overridden // to parse the response resolve(null); }); this.responsePromise = responsePromise; this.parseResponse = parseResponse; _APIPromise_client.set(this, void 0); tslib_1.__classPrivateFieldSet(this, _APIPromise_client, client, "f"); } _thenUnwrap(transform) { return new APIPromise(tslib_1.__classPrivateFieldGet(this, _APIPromise_client, "f"), this.responsePromise, async (client, props) => (0, parse_1.addRequestID)(transform(await this.parseResponse(client, props), props), props.response)); } /** * Gets the raw `Response` instance instead of parsing the response * data. * * If you want to parse the response body but still get the `Response` * instance, you can use {@link withResponse()}. * * 👋 Getting the wrong TypeScript type for `Response`? * Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]` * to your `tsconfig.json`. */ asResponse() { return this.responsePromise.then((p) => p.response); } /** * Gets the parsed response data, the raw `Response` instance and the ID of the request, * returned via the X-Request-ID header which is useful for debugging requests and reporting * issues to OpenAI. * * If you just want to get the raw `Response` instance without parsing it, * you can use {@link asResponse()}. * * 👋 Getting the wrong TypeScript type for `Response`? * Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]` * to your `tsconfig.json`. */ async withResponse() { const [data, response] = await Promise.all([this.parse(), this.asResponse()]); return { data, response, request_id: response.headers.get('x-request-id') }; } parse() { if (!this.parsedPromise) { this.parsedPromise = this.responsePromise.then((data) => this.parseResponse(tslib_1.__classPrivateFieldGet(this, _APIPromise_client, "f"), data)); } return this.parsedPromise; } then(onfulfilled, onrejected) { return this.parse().then(onfulfilled, onrejected); } catch(onrejected) { return this.parse().catch(onrejected); } finally(onfinally) { return this.parse().finally(onfinally); } } exports.APIPromise = APIPromise; _APIPromise_client = new WeakMap(); //# sourceMappingURL=api-promise.js.map
Save
cmd:
run