openai 4.78.0 → 4.79.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.
- package/CHANGELOG.md +29 -0
- package/README.md +87 -0
- package/beta/realtime/index.d.ts +2 -0
- package/beta/realtime/index.d.ts.map +1 -0
- package/beta/realtime/index.js +6 -0
- package/beta/realtime/index.js.map +1 -0
- package/beta/realtime/index.mjs +2 -0
- package/beta/realtime/index.mjs.map +1 -0
- package/beta/realtime/internal-base.d.ts +47 -0
- package/beta/realtime/internal-base.d.ts.map +1 -0
- package/beta/realtime/internal-base.js +43 -0
- package/beta/realtime/internal-base.js.map +1 -0
- package/beta/realtime/internal-base.mjs +37 -0
- package/beta/realtime/internal-base.mjs.map +1 -0
- package/beta/realtime/websocket.d.ts +22 -0
- package/beta/realtime/websocket.d.ts.map +1 -0
- package/beta/realtime/websocket.js +91 -0
- package/beta/realtime/websocket.js.map +1 -0
- package/beta/realtime/websocket.mjs +64 -0
- package/beta/realtime/websocket.mjs.map +1 -0
- package/beta/realtime/ws.d.ts +19 -0
- package/beta/realtime/ws.d.ts.map +1 -0
- package/beta/realtime/ws.js +66 -0
- package/beta/realtime/ws.js.map +1 -0
- package/beta/realtime/ws.mjs +59 -0
- package/beta/realtime/ws.mjs.map +1 -0
- package/core.d.ts.map +1 -1
- package/core.js +28 -1
- package/core.js.map +1 -1
- package/core.mjs +28 -1
- package/core.mjs.map +1 -1
- package/index.d.mts +6 -6
- package/index.d.ts +6 -6
- package/index.d.ts.map +1 -1
- package/lib/EventEmitter.d.ts +45 -0
- package/lib/EventEmitter.d.ts.map +1 -0
- package/lib/EventEmitter.js +83 -0
- package/lib/EventEmitter.js.map +1 -0
- package/lib/EventEmitter.mjs +79 -0
- package/lib/EventEmitter.mjs.map +1 -0
- package/package.json +5 -1
- package/resources/audio/speech.d.ts.map +1 -1
- package/resources/audio/speech.js +6 -1
- package/resources/audio/speech.js.map +1 -1
- package/resources/audio/speech.mjs +6 -1
- package/resources/audio/speech.mjs.map +1 -1
- package/resources/beta/beta.d.ts +2 -2
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/index.d.ts +1 -1
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/vector-stores/index.d.ts +1 -1
- package/resources/beta/vector-stores/index.d.ts.map +1 -1
- package/resources/beta/vector-stores/vector-stores.d.ts +3 -3
- package/resources/beta/vector-stores/vector-stores.d.ts.map +1 -1
- package/resources/files.d.ts.map +1 -1
- package/resources/files.js +6 -5
- package/resources/files.js.map +1 -1
- package/resources/files.mjs +6 -5
- package/resources/files.mjs.map +1 -1
- package/src/beta/realtime/index.ts +1 -0
- package/src/beta/realtime/internal-base.ts +83 -0
- package/src/beta/realtime/websocket.ts +97 -0
- package/src/beta/realtime/ws.ts +69 -0
- package/src/core.ts +35 -1
- package/src/index.ts +6 -6
- package/src/lib/EventEmitter.ts +98 -0
- package/src/resources/audio/speech.ts +6 -1
- package/src/resources/beta/beta.ts +2 -2
- package/src/resources/beta/index.ts +1 -1
- package/src/resources/beta/vector-stores/index.ts +1 -1
- package/src/resources/beta/vector-stores/vector-stores.ts +3 -3
- package/src/resources/files.ts +6 -5
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
type EventListener<Events, EventType extends keyof Events> = Events[EventType];
|
|
2
|
+
export type EventParameters<Events, EventType extends keyof Events> = {
|
|
3
|
+
[Event in EventType]: EventListener<Events, EventType> extends (...args: infer P) => any ? P : never;
|
|
4
|
+
}[EventType];
|
|
5
|
+
export declare class EventEmitter<EventTypes extends Record<string, (...args: any) => any>> {
|
|
6
|
+
#private;
|
|
7
|
+
/**
|
|
8
|
+
* Adds the listener function to the end of the listeners array for the event.
|
|
9
|
+
* No checks are made to see if the listener has already been added. Multiple calls passing
|
|
10
|
+
* the same combination of event and listener will result in the listener being added, and
|
|
11
|
+
* called, multiple times.
|
|
12
|
+
* @returns this, so that calls can be chained
|
|
13
|
+
*/
|
|
14
|
+
on<Event extends keyof EventTypes>(event: Event, listener: EventListener<EventTypes, Event>): this;
|
|
15
|
+
/**
|
|
16
|
+
* Removes the specified listener from the listener array for the event.
|
|
17
|
+
* off() will remove, at most, one instance of a listener from the listener array. If any single
|
|
18
|
+
* listener has been added multiple times to the listener array for the specified event, then
|
|
19
|
+
* off() must be called multiple times to remove each instance.
|
|
20
|
+
* @returns this, so that calls can be chained
|
|
21
|
+
*/
|
|
22
|
+
off<Event extends keyof EventTypes>(event: Event, listener: EventListener<EventTypes, Event>): this;
|
|
23
|
+
/**
|
|
24
|
+
* Adds a one-time listener function for the event. The next time the event is triggered,
|
|
25
|
+
* this listener is removed and then invoked.
|
|
26
|
+
* @returns this, so that calls can be chained
|
|
27
|
+
*/
|
|
28
|
+
once<Event extends keyof EventTypes>(event: Event, listener: EventListener<EventTypes, Event>): this;
|
|
29
|
+
/**
|
|
30
|
+
* This is similar to `.once()`, but returns a Promise that resolves the next time
|
|
31
|
+
* the event is triggered, instead of calling a listener callback.
|
|
32
|
+
* @returns a Promise that resolves the next time given event is triggered,
|
|
33
|
+
* or rejects if an error is emitted. (If you request the 'error' event,
|
|
34
|
+
* returns a promise that resolves with the error).
|
|
35
|
+
*
|
|
36
|
+
* Example:
|
|
37
|
+
*
|
|
38
|
+
* const message = await stream.emitted('message') // rejects if the stream errors
|
|
39
|
+
*/
|
|
40
|
+
emitted<Event extends keyof EventTypes>(event: Event): Promise<EventParameters<EventTypes, Event> extends [infer Param] ? Param : EventParameters<EventTypes, Event> extends [] ? void : EventParameters<EventTypes, Event>>;
|
|
41
|
+
protected _emit<Event extends keyof EventTypes>(this: EventEmitter<EventTypes>, event: Event, ...args: EventParameters<EventTypes, Event>): void;
|
|
42
|
+
protected _hasListener(event: keyof EventTypes): boolean;
|
|
43
|
+
}
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=EventEmitter.d.ts.map
|
|
@@ -0,0 +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AS,EAAE,GAAG,IAAI,GACpD,eAAe,CAAC,UAAU,EAAE,KAAK,CAAC,CACrC;IAOD,SAAS,CAAC,KAAK,CAAC,KAAK,SAAS,MAAM,UAAU,EAC5C,IAAI,EAAE,YAAY,CAAC,UAAU,CAAC,EAC9B,KAAK,EAAE,KAAK,EACZ,GAAG,IAAI,EAAE,eAAe,CAAC,UAAU,EAAE,KAAK,CAAC;IAS7C,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,UAAU,GAAG,OAAO;CAIzD"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
+
};
|
|
7
|
+
var _EventEmitter_listeners;
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.EventEmitter = void 0;
|
|
10
|
+
class EventEmitter {
|
|
11
|
+
constructor() {
|
|
12
|
+
_EventEmitter_listeners.set(this, {});
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Adds the listener function to the end of the listeners array for the event.
|
|
16
|
+
* No checks are made to see if the listener has already been added. Multiple calls passing
|
|
17
|
+
* the same combination of event and listener will result in the listener being added, and
|
|
18
|
+
* called, multiple times.
|
|
19
|
+
* @returns this, so that calls can be chained
|
|
20
|
+
*/
|
|
21
|
+
on(event, listener) {
|
|
22
|
+
const listeners = __classPrivateFieldGet(this, _EventEmitter_listeners, "f")[event] || (__classPrivateFieldGet(this, _EventEmitter_listeners, "f")[event] = []);
|
|
23
|
+
listeners.push({ listener });
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Removes the specified listener from the listener array for the event.
|
|
28
|
+
* off() will remove, at most, one instance of a listener from the listener array. If any single
|
|
29
|
+
* listener has been added multiple times to the listener array for the specified event, then
|
|
30
|
+
* off() must be called multiple times to remove each instance.
|
|
31
|
+
* @returns this, so that calls can be chained
|
|
32
|
+
*/
|
|
33
|
+
off(event, listener) {
|
|
34
|
+
const listeners = __classPrivateFieldGet(this, _EventEmitter_listeners, "f")[event];
|
|
35
|
+
if (!listeners)
|
|
36
|
+
return this;
|
|
37
|
+
const index = listeners.findIndex((l) => l.listener === listener);
|
|
38
|
+
if (index >= 0)
|
|
39
|
+
listeners.splice(index, 1);
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Adds a one-time listener function for the event. The next time the event is triggered,
|
|
44
|
+
* this listener is removed and then invoked.
|
|
45
|
+
* @returns this, so that calls can be chained
|
|
46
|
+
*/
|
|
47
|
+
once(event, listener) {
|
|
48
|
+
const listeners = __classPrivateFieldGet(this, _EventEmitter_listeners, "f")[event] || (__classPrivateFieldGet(this, _EventEmitter_listeners, "f")[event] = []);
|
|
49
|
+
listeners.push({ listener, once: true });
|
|
50
|
+
return this;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* This is similar to `.once()`, but returns a Promise that resolves the next time
|
|
54
|
+
* the event is triggered, instead of calling a listener callback.
|
|
55
|
+
* @returns a Promise that resolves the next time given event is triggered,
|
|
56
|
+
* or rejects if an error is emitted. (If you request the 'error' event,
|
|
57
|
+
* returns a promise that resolves with the error).
|
|
58
|
+
*
|
|
59
|
+
* Example:
|
|
60
|
+
*
|
|
61
|
+
* const message = await stream.emitted('message') // rejects if the stream errors
|
|
62
|
+
*/
|
|
63
|
+
emitted(event) {
|
|
64
|
+
return new Promise((resolve, reject) => {
|
|
65
|
+
// TODO: handle errors
|
|
66
|
+
this.once(event, resolve);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
_emit(event, ...args) {
|
|
70
|
+
const listeners = __classPrivateFieldGet(this, _EventEmitter_listeners, "f")[event];
|
|
71
|
+
if (listeners) {
|
|
72
|
+
__classPrivateFieldGet(this, _EventEmitter_listeners, "f")[event] = listeners.filter((l) => !l.once);
|
|
73
|
+
listeners.forEach(({ listener }) => listener(...args));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
_hasListener(event) {
|
|
77
|
+
const listeners = __classPrivateFieldGet(this, _EventEmitter_listeners, "f")[event];
|
|
78
|
+
return listeners && listeners.length > 0;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.EventEmitter = EventEmitter;
|
|
82
|
+
_EventEmitter_listeners = new WeakMap();
|
|
83
|
+
//# sourceMappingURL=EventEmitter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventEmitter.js","sourceRoot":"","sources":["../src/lib/EventEmitter.ts"],"names":[],"mappings":";;;;;;;;;AAWA,MAAa,YAAY;IAAzB;QACE,kCAEI,EAAE,EAAC;IAmFT,CAAC;IAjFC;;;;;;OAMG;IACH,EAAE,CAAiC,KAAY,EAAE,QAA0C;QACzF,MAAM,SAAS,GACb,uBAAA,IAAI,+BAAW,CAAC,KAAK,CAAC,IAAI,CAAC,uBAAA,IAAI,+BAAW,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;QAC1D,SAAS,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;OAMG;IACH,GAAG,CAAiC,KAAY,EAAE,QAA0C;QAC1F,MAAM,SAAS,GAAG,uBAAA,IAAI,+BAAW,CAAC,KAAK,CAAC,CAAC;QACzC,IAAI,CAAC,SAAS;YAAE,OAAO,IAAI,CAAC;QAC5B,MAAM,KAAK,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK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AAC,CAAC;IAC3C,CAAC;CACF;AAtFD,oCAsFC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
+
};
|
|
6
|
+
var _EventEmitter_listeners;
|
|
7
|
+
export class EventEmitter {
|
|
8
|
+
constructor() {
|
|
9
|
+
_EventEmitter_listeners.set(this, {});
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Adds the listener function to the end of the listeners array for the event.
|
|
13
|
+
* No checks are made to see if the listener has already been added. Multiple calls passing
|
|
14
|
+
* the same combination of event and listener will result in the listener being added, and
|
|
15
|
+
* called, multiple times.
|
|
16
|
+
* @returns this, so that calls can be chained
|
|
17
|
+
*/
|
|
18
|
+
on(event, listener) {
|
|
19
|
+
const listeners = __classPrivateFieldGet(this, _EventEmitter_listeners, "f")[event] || (__classPrivateFieldGet(this, _EventEmitter_listeners, "f")[event] = []);
|
|
20
|
+
listeners.push({ listener });
|
|
21
|
+
return this;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Removes the specified listener from the listener array for the event.
|
|
25
|
+
* off() will remove, at most, one instance of a listener from the listener array. If any single
|
|
26
|
+
* listener has been added multiple times to the listener array for the specified event, then
|
|
27
|
+
* off() must be called multiple times to remove each instance.
|
|
28
|
+
* @returns this, so that calls can be chained
|
|
29
|
+
*/
|
|
30
|
+
off(event, listener) {
|
|
31
|
+
const listeners = __classPrivateFieldGet(this, _EventEmitter_listeners, "f")[event];
|
|
32
|
+
if (!listeners)
|
|
33
|
+
return this;
|
|
34
|
+
const index = listeners.findIndex((l) => l.listener === listener);
|
|
35
|
+
if (index >= 0)
|
|
36
|
+
listeners.splice(index, 1);
|
|
37
|
+
return this;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Adds a one-time listener function for the event. The next time the event is triggered,
|
|
41
|
+
* this listener is removed and then invoked.
|
|
42
|
+
* @returns this, so that calls can be chained
|
|
43
|
+
*/
|
|
44
|
+
once(event, listener) {
|
|
45
|
+
const listeners = __classPrivateFieldGet(this, _EventEmitter_listeners, "f")[event] || (__classPrivateFieldGet(this, _EventEmitter_listeners, "f")[event] = []);
|
|
46
|
+
listeners.push({ listener, once: true });
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* This is similar to `.once()`, but returns a Promise that resolves the next time
|
|
51
|
+
* the event is triggered, instead of calling a listener callback.
|
|
52
|
+
* @returns a Promise that resolves the next time given event is triggered,
|
|
53
|
+
* or rejects if an error is emitted. (If you request the 'error' event,
|
|
54
|
+
* returns a promise that resolves with the error).
|
|
55
|
+
*
|
|
56
|
+
* Example:
|
|
57
|
+
*
|
|
58
|
+
* const message = await stream.emitted('message') // rejects if the stream errors
|
|
59
|
+
*/
|
|
60
|
+
emitted(event) {
|
|
61
|
+
return new Promise((resolve, reject) => {
|
|
62
|
+
// TODO: handle errors
|
|
63
|
+
this.once(event, resolve);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
_emit(event, ...args) {
|
|
67
|
+
const listeners = __classPrivateFieldGet(this, _EventEmitter_listeners, "f")[event];
|
|
68
|
+
if (listeners) {
|
|
69
|
+
__classPrivateFieldGet(this, _EventEmitter_listeners, "f")[event] = listeners.filter((l) => !l.once);
|
|
70
|
+
listeners.forEach(({ listener }) => listener(...args));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
_hasListener(event) {
|
|
74
|
+
const listeners = __classPrivateFieldGet(this, _EventEmitter_listeners, "f")[event];
|
|
75
|
+
return listeners && listeners.length > 0;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
_EventEmitter_listeners = new WeakMap();
|
|
79
|
+
//# sourceMappingURL=EventEmitter.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventEmitter.mjs","sourceRoot":"","sources":["../src/lib/EventEmitter.ts"],"names":[],"mappings":";;;;;;AAWA,MAAM,OAAO,YAAY;IAAzB;QACE,kCAEI,EAAE,EAAC;IAmFT,CAAC;IAjFC;;;;;;OAMG;IACH,EAAE,CAAiC,KAAY,EAAE,QAA0C;QACzF,MAAM,SAAS,GACb,uBAAA,IAAI,+BAAW,CAAC,KAAK,CAAC,IAAI,CAAC,uBAAA,IAAI,+BAAW,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;QAC1D,SAAS,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;OAMG;IACH,GAAG,CAAiC,KAAY,EAAE,QAA0C;QAC1F,MAAM,SAAS,GAAG,uBAAA,IAAI,+BAAW,CAAC,KAAK,CAAC,CAAC;QACzC,IAAI,CAAC,SAAS;YAAE,OAAO,IAAI,CAAC;QAC5B,MAAM,KAAK,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC;QAClE,IAAI,KAAK,IAAI,CAAC;YAAE,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,IAAI,CAAiC,KAAY,EAAE,QAA0C;QAC3F,MAAM,SAAS,GACb,uBAAA,IAAI,+BAAW,CAAC,KAAK,CAAC,IAAI,CAAC,uBAAA,IAAI,+BAAW,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;QAC1D,SAAS,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;;;OAUG;IACH,OAAO,CACL,KAAY;QAMZ,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,sBAAsB;YACtB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,OAAc,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;IACL,CAAC;IAES,KAAK,CAEb,KAAY,EACZ,GAAG,IAAwC;QAE3C,MAAM,SAAS,GAAkD,uBAAA,IAAI,+BAAW,CAAC,KAAK,CAAC,CAAC;QACxF,IAAI,SAAS,EAAE;YACb,uBAAA,IAAI,+BAAW,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAQ,CAAC;YACjE,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAO,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAI,IAAY,CAAC,CAAC,CAAC;SACtE;IACH,CAAC;IAES,YAAY,CAAC,KAAuB;QAC5C,MAAM,SAAS,GAAG,uBAAA,IAAI,+BAAW,CAAC,KAAK,CAAC,CAAC;QACzC,OAAO,SAAS,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;IAC3C,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openai",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.79.0",
|
|
4
4
|
"description": "The official TypeScript library for the OpenAI API",
|
|
5
5
|
"author": "OpenAI <support@openai.com>",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -102,9 +102,13 @@
|
|
|
102
102
|
},
|
|
103
103
|
"bin": "./bin/cli",
|
|
104
104
|
"peerDependencies": {
|
|
105
|
+
"ws": "^8.18.0",
|
|
105
106
|
"zod": "^3.23.8"
|
|
106
107
|
},
|
|
107
108
|
"peerDependenciesMeta": {
|
|
109
|
+
"ws": {
|
|
110
|
+
"optional": true
|
|
111
|
+
},
|
|
108
112
|
"zod": {
|
|
109
113
|
"optional": true
|
|
110
114
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speech.d.ts","sourceRoot":"","sources":["../../src/resources/audio/speech.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,qBAAa,MAAO,SAAQ,WAAW;IACrC;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"speech.d.ts","sourceRoot":"","sources":["../../src/resources/audio/speech.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,qBAAa,MAAO,SAAQ,WAAW;IACrC;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;CAQ3F;AAED,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,UAAU,CAAC;AAE/C,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,KAAK,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,WAAW,CAAC;IAEnC;;;;;OAKG;IACH,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAEhE;;;OAGG;IACH,eAAe,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;IAElE;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EAAE,KAAK,WAAW,IAAI,WAAW,EAAE,KAAK,kBAAkB,IAAI,kBAAkB,EAAE,CAAC;CAC3F"}
|
|
@@ -8,7 +8,12 @@ class Speech extends resource_1.APIResource {
|
|
|
8
8
|
* Generates audio from the input text.
|
|
9
9
|
*/
|
|
10
10
|
create(body, options) {
|
|
11
|
-
return this._client.post('/audio/speech', {
|
|
11
|
+
return this._client.post('/audio/speech', {
|
|
12
|
+
body,
|
|
13
|
+
...options,
|
|
14
|
+
headers: { Accept: 'application/octet-stream', ...options?.headers },
|
|
15
|
+
__binaryResponse: true,
|
|
16
|
+
});
|
|
12
17
|
}
|
|
13
18
|
}
|
|
14
19
|
exports.Speech = Speech;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speech.js","sourceRoot":"","sources":["../../src/resources/audio/speech.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAI7C,MAAa,MAAO,SAAQ,sBAAW;IACrC;;OAEG;IACH,MAAM,CAAC,IAAwB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"speech.js","sourceRoot":"","sources":["../../src/resources/audio/speech.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAI7C,MAAa,MAAO,SAAQ,sBAAW;IACrC;;OAEG;IACH,MAAM,CAAC,IAAwB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE;YACxC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,0BAA0B,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;YACpE,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;CACF;AAZD,wBAYC"}
|
|
@@ -5,7 +5,12 @@ export class Speech extends APIResource {
|
|
|
5
5
|
* Generates audio from the input text.
|
|
6
6
|
*/
|
|
7
7
|
create(body, options) {
|
|
8
|
-
return this._client.post('/audio/speech', {
|
|
8
|
+
return this._client.post('/audio/speech', {
|
|
9
|
+
body,
|
|
10
|
+
...options,
|
|
11
|
+
headers: { Accept: 'application/octet-stream', ...options?.headers },
|
|
12
|
+
__binaryResponse: true,
|
|
13
|
+
});
|
|
9
14
|
}
|
|
10
15
|
}
|
|
11
16
|
//# sourceMappingURL=speech.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speech.mjs","sourceRoot":"","sources":["../../src/resources/audio/speech.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;OAEG;IACH,MAAM,CAAC,IAAwB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"speech.mjs","sourceRoot":"","sources":["../../src/resources/audio/speech.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;OAEG;IACH,MAAM,CAAC,IAAwB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE;YACxC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,0BAA0B,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;YACpE,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/resources/beta/beta.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { Realtime } from "./realtime/realtime.js";
|
|
|
7
7
|
import * as ThreadsAPI from "./threads/threads.js";
|
|
8
8
|
import { AssistantResponseFormatOption, AssistantToolChoice, AssistantToolChoiceFunction, AssistantToolChoiceOption, Thread, ThreadCreateAndRunParams, ThreadCreateAndRunParamsNonStreaming, ThreadCreateAndRunParamsStreaming, ThreadCreateAndRunPollParams, ThreadCreateAndRunStreamParams, ThreadCreateParams, ThreadDeleted, ThreadUpdateParams, Threads } from "./threads/threads.js";
|
|
9
9
|
import * as VectorStoresAPI from "./vector-stores/vector-stores.js";
|
|
10
|
-
import { AutoFileChunkingStrategyParam, FileChunkingStrategy, FileChunkingStrategyParam, OtherFileChunkingStrategyObject, StaticFileChunkingStrategy, StaticFileChunkingStrategyObject,
|
|
10
|
+
import { AutoFileChunkingStrategyParam, FileChunkingStrategy, FileChunkingStrategyParam, OtherFileChunkingStrategyObject, StaticFileChunkingStrategy, StaticFileChunkingStrategyObject, StaticFileChunkingStrategyObjectParam, VectorStore, VectorStoreCreateParams, VectorStoreDeleted, VectorStoreListParams, VectorStoreUpdateParams, VectorStores, VectorStoresPage } from "./vector-stores/vector-stores.js";
|
|
11
11
|
import { Chat } from "./chat/chat.js";
|
|
12
12
|
export declare class Beta extends APIResource {
|
|
13
13
|
realtime: RealtimeAPI.Realtime;
|
|
@@ -18,7 +18,7 @@ export declare class Beta extends APIResource {
|
|
|
18
18
|
}
|
|
19
19
|
export declare namespace Beta {
|
|
20
20
|
export { Realtime as Realtime };
|
|
21
|
-
export { VectorStores as VectorStores, type AutoFileChunkingStrategyParam as AutoFileChunkingStrategyParam, type FileChunkingStrategy as FileChunkingStrategy, type FileChunkingStrategyParam as FileChunkingStrategyParam, type OtherFileChunkingStrategyObject as OtherFileChunkingStrategyObject, type StaticFileChunkingStrategy as StaticFileChunkingStrategy, type StaticFileChunkingStrategyObject as StaticFileChunkingStrategyObject, type
|
|
21
|
+
export { VectorStores as VectorStores, type AutoFileChunkingStrategyParam as AutoFileChunkingStrategyParam, type FileChunkingStrategy as FileChunkingStrategy, type FileChunkingStrategyParam as FileChunkingStrategyParam, type OtherFileChunkingStrategyObject as OtherFileChunkingStrategyObject, type StaticFileChunkingStrategy as StaticFileChunkingStrategy, type StaticFileChunkingStrategyObject as StaticFileChunkingStrategyObject, type StaticFileChunkingStrategyObjectParam as StaticFileChunkingStrategyObjectParam, type VectorStore as VectorStore, type VectorStoreDeleted as VectorStoreDeleted, VectorStoresPage as VectorStoresPage, type VectorStoreCreateParams as VectorStoreCreateParams, type VectorStoreUpdateParams as VectorStoreUpdateParams, type VectorStoreListParams as VectorStoreListParams, };
|
|
22
22
|
export { Chat };
|
|
23
23
|
export { Assistants as Assistants, type Assistant as Assistant, type AssistantDeleted as AssistantDeleted, type AssistantStreamEvent as AssistantStreamEvent, type AssistantTool as AssistantTool, type CodeInterpreterTool as CodeInterpreterTool, type FileSearchTool as FileSearchTool, type FunctionTool as FunctionTool, type MessageStreamEvent as MessageStreamEvent, type RunStepStreamEvent as RunStepStreamEvent, type RunStreamEvent as RunStreamEvent, type ThreadStreamEvent as ThreadStreamEvent, AssistantsPage as AssistantsPage, type AssistantCreateParams as AssistantCreateParams, type AssistantUpdateParams as AssistantUpdateParams, type AssistantListParams as AssistantListParams, };
|
|
24
24
|
export { Threads as Threads, type AssistantResponseFormatOption as AssistantResponseFormatOption, type AssistantToolChoice as AssistantToolChoice, type AssistantToolChoiceFunction as AssistantToolChoiceFunction, type AssistantToolChoiceOption as AssistantToolChoiceOption, type Thread as Thread, type ThreadDeleted as ThreadDeleted, type ThreadCreateParams as ThreadCreateParams, type ThreadUpdateParams as ThreadUpdateParams, type ThreadCreateAndRunParams as ThreadCreateAndRunParams, type ThreadCreateAndRunParamsNonStreaming as ThreadCreateAndRunParamsNonStreaming, type ThreadCreateAndRunParamsStreaming as ThreadCreateAndRunParamsStreaming, type ThreadCreateAndRunPollParams, type ThreadCreateAndRunStreamParams, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beta.d.ts","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,aAAa,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,OAAO,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,SAAS,EACT,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,qBAAqB,EACrB,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,WAAW,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAChD,OAAO,EACL,6BAA6B,EAC7B,mBAAmB,EACnB,2BAA2B,EAC3B,yBAAyB,EACzB,MAAM,EACN,wBAAwB,EACxB,oCAAoC,EACpC,iCAAiC,EACjC,4BAA4B,EAC5B,8BAA8B,EAC9B,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,OAAO,EACR,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,eAAe,MAAM,+BAA+B,CAAC;AACjE,OAAO,EACL,6BAA6B,EAC7B,oBAAoB,EACpB,yBAAyB,EACzB,+BAA+B,EAC/B,0BAA0B,EAC1B,gCAAgC,EAChC
|
|
1
|
+
{"version":3,"file":"beta.d.ts","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,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AAC;IAEF,OAAO,EACL,OAAO,IAAI,OAAO,EAClB,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,oCAAoC,IAAI,oCAAoC,EACjF,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,4BAA4B,EACjC,KAAK,8BAA8B,GACpC,CAAC;CACH"}
|
|
@@ -3,5 +3,5 @@ export { Beta } from "./beta.js";
|
|
|
3
3
|
export { Realtime } from "./realtime/index.js";
|
|
4
4
|
export { Chat } from "./chat/index.js";
|
|
5
5
|
export { Threads, type AssistantResponseFormatOption, type AssistantToolChoice, type AssistantToolChoiceFunction, type AssistantToolChoiceOption, type Thread, type ThreadDeleted, type ThreadCreateParams, type ThreadUpdateParams, type ThreadCreateAndRunParams, type ThreadCreateAndRunParamsNonStreaming, type ThreadCreateAndRunParamsStreaming, type ThreadCreateAndRunPollParams, type ThreadCreateAndRunStreamParams, } from "./threads/index.js";
|
|
6
|
-
export { VectorStoresPage, VectorStores, type AutoFileChunkingStrategyParam, type FileChunkingStrategy, type FileChunkingStrategyParam, type OtherFileChunkingStrategyObject, type StaticFileChunkingStrategy, type StaticFileChunkingStrategyObject, type
|
|
6
|
+
export { VectorStoresPage, VectorStores, type AutoFileChunkingStrategyParam, type FileChunkingStrategy, type FileChunkingStrategyParam, type OtherFileChunkingStrategyObject, type StaticFileChunkingStrategy, type StaticFileChunkingStrategyObject, type StaticFileChunkingStrategyObjectParam, type VectorStore, type VectorStoreDeleted, type VectorStoreCreateParams, type VectorStoreUpdateParams, type VectorStoreListParams, } from "./vector-stores/index.js";
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,cAAc,EACd,UAAU,EACV,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,GACzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EACL,OAAO,EACP,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC9B,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,oCAAoC,EACzC,KAAK,iCAAiC,EACtC,KAAK,4BAA4B,EACjC,KAAK,8BAA8B,GACpC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,KAAK,6BAA6B,EAClC,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EACpC,KAAK,0BAA0B,EAC/B,KAAK,gCAAgC,EACrC,KAAK
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,cAAc,EACd,UAAU,EACV,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,GACzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EACL,OAAO,EACP,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC9B,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,oCAAoC,EACzC,KAAK,iCAAiC,EACtC,KAAK,4BAA4B,EACjC,KAAK,8BAA8B,GACpC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,KAAK,6BAA6B,EAClC,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EACpC,KAAK,0BAA0B,EAC/B,KAAK,gCAAgC,EACrC,KAAK,qCAAqC,EAC1C,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,GAC3B,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { FileBatches, type VectorStoreFileBatch, type FileBatchCreateParams, type FileBatchListFilesParams, } from "./file-batches.js";
|
|
2
2
|
export { VectorStoreFilesPage, Files, type VectorStoreFile, type VectorStoreFileDeleted, type FileCreateParams, type FileListParams, } from "./files.js";
|
|
3
|
-
export { VectorStoresPage, VectorStores, type AutoFileChunkingStrategyParam, type FileChunkingStrategy, type FileChunkingStrategyParam, type OtherFileChunkingStrategyObject, type StaticFileChunkingStrategy, type StaticFileChunkingStrategyObject, type
|
|
3
|
+
export { VectorStoresPage, VectorStores, type AutoFileChunkingStrategyParam, type FileChunkingStrategy, type FileChunkingStrategyParam, type OtherFileChunkingStrategyObject, type StaticFileChunkingStrategy, type StaticFileChunkingStrategyObject, type StaticFileChunkingStrategyObjectParam, type VectorStore, type VectorStoreDeleted, type VectorStoreCreateParams, type VectorStoreUpdateParams, type VectorStoreListParams, } from "./vector-stores.js";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/vector-stores/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,GAC9B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,oBAAoB,EACpB,KAAK,EACL,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,cAAc,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,KAAK,6BAA6B,EAClC,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EACpC,KAAK,0BAA0B,EAC/B,KAAK,gCAAgC,EACrC,KAAK
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/vector-stores/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,GAC9B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,oBAAoB,EACpB,KAAK,EACL,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,cAAc,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,KAAK,6BAA6B,EAClC,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EACpC,KAAK,0BAA0B,EAC/B,KAAK,gCAAgC,EACrC,KAAK,qCAAqC,EAC1C,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,GAC3B,MAAM,iBAAiB,CAAC"}
|
|
@@ -50,7 +50,7 @@ export type FileChunkingStrategy = StaticFileChunkingStrategyObject | OtherFileC
|
|
|
50
50
|
* The chunking strategy used to chunk the file(s). If not set, will use the `auto`
|
|
51
51
|
* strategy. Only applicable if `file_ids` is non-empty.
|
|
52
52
|
*/
|
|
53
|
-
export type FileChunkingStrategyParam = AutoFileChunkingStrategyParam |
|
|
53
|
+
export type FileChunkingStrategyParam = AutoFileChunkingStrategyParam | StaticFileChunkingStrategyObjectParam;
|
|
54
54
|
/**
|
|
55
55
|
* This is returned when the chunking strategy is unknown. Typically, this is
|
|
56
56
|
* because the file was indexed before the `chunking_strategy` concept was
|
|
@@ -82,7 +82,7 @@ export interface StaticFileChunkingStrategyObject {
|
|
|
82
82
|
*/
|
|
83
83
|
type: 'static';
|
|
84
84
|
}
|
|
85
|
-
export interface
|
|
85
|
+
export interface StaticFileChunkingStrategyObjectParam {
|
|
86
86
|
static: StaticFileChunkingStrategy;
|
|
87
87
|
/**
|
|
88
88
|
* Always `static`.
|
|
@@ -276,7 +276,7 @@ export interface VectorStoreListParams extends CursorPageParams {
|
|
|
276
276
|
order?: 'asc' | 'desc';
|
|
277
277
|
}
|
|
278
278
|
export declare namespace VectorStores {
|
|
279
|
-
export { type AutoFileChunkingStrategyParam as AutoFileChunkingStrategyParam, type FileChunkingStrategy as FileChunkingStrategy, type FileChunkingStrategyParam as FileChunkingStrategyParam, type OtherFileChunkingStrategyObject as OtherFileChunkingStrategyObject, type StaticFileChunkingStrategy as StaticFileChunkingStrategy, type StaticFileChunkingStrategyObject as StaticFileChunkingStrategyObject, type
|
|
279
|
+
export { type AutoFileChunkingStrategyParam as AutoFileChunkingStrategyParam, type FileChunkingStrategy as FileChunkingStrategy, type FileChunkingStrategyParam as FileChunkingStrategyParam, type OtherFileChunkingStrategyObject as OtherFileChunkingStrategyObject, type StaticFileChunkingStrategy as StaticFileChunkingStrategy, type StaticFileChunkingStrategyObject as StaticFileChunkingStrategyObject, type StaticFileChunkingStrategyObjectParam as StaticFileChunkingStrategyObjectParam, type VectorStore as VectorStore, type VectorStoreDeleted as VectorStoreDeleted, VectorStoresPage as VectorStoresPage, type VectorStoreCreateParams as VectorStoreCreateParams, type VectorStoreUpdateParams as VectorStoreUpdateParams, type VectorStoreListParams as VectorStoreListParams, };
|
|
280
280
|
export { Files as Files, type VectorStoreFile as VectorStoreFile, type VectorStoreFileDeleted as VectorStoreFileDeleted, VectorStoreFilesPage as VectorStoreFilesPage, type FileCreateParams as FileCreateParams, type FileListParams as FileListParams, };
|
|
281
281
|
export { FileBatches as FileBatches, type VectorStoreFileBatch as VectorStoreFileBatch, type FileBatchCreateParams as FileBatchCreateParams, type FileBatchListFilesParams as FileBatchListFilesParams, };
|
|
282
282
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vector-stores.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/vector-stores/vector-stores.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,cAAc,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,WAAW,EACX,oBAAoB,EACrB,MAA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Q,UAAU,CAAC,WAAW,CAAC;CAAG;AAEhE;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC5C;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,gCAAgC,GAAG,+BAA+B,CAAC;AAEtG;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG,6BAA6B,GAAG
|
|
1
|
+
{"version":3,"file":"vector-stores.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/vector-stores/vector-stores.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,cAAc,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,WAAW,EACX,oBAAoB,EACrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,QAAQ,MAAM,SAAS,CAAC;AACpC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,KAAK,EACL,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAExE,qBAAa,YAAa,SAAQ,WAAW;IAC3C,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAoC;IACzD,WAAW,EAAE,cAAc,CAAC,WAAW,CAAgD;IAEvF;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,uBAAuB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;IAQlG;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;IAO5F;;OAEG;IACH,MAAM,CACJ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AE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,OAAO,EACH,YAAY,GACZ,mBAAmB,GACnB,OAAO,GACP,cAAc,GACd,WAAW,GACX,mBAAmB,GACnB,QAAQ,CAAC;IAEb;;;OAGG;IACH,MAAM,EAAE,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC;IAE3C;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,OAAO,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE1E,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC;IAEtB;;;;;;;;;OASG;IACH,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,cAAe,SAAQ,gBAAgB;IACtD;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAEvB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAID,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,WAAW,IAAI,WAAW,EAC/B,eAAe,IAAI,eAAe,EAClC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,GACtC,CAAC;CACH"}
|
package/resources/files.js
CHANGED
|
@@ -80,7 +80,11 @@ class Files extends resource_1.APIResource {
|
|
|
80
80
|
* Returns the contents of the specified file.
|
|
81
81
|
*/
|
|
82
82
|
content(fileId, options) {
|
|
83
|
-
return this._client.get(`/files/${fileId}/content`, {
|
|
83
|
+
return this._client.get(`/files/${fileId}/content`, {
|
|
84
|
+
...options,
|
|
85
|
+
headers: { Accept: 'application/binary', ...options?.headers },
|
|
86
|
+
__binaryResponse: true,
|
|
87
|
+
});
|
|
84
88
|
}
|
|
85
89
|
/**
|
|
86
90
|
* Returns the contents of the specified file.
|
|
@@ -88,10 +92,7 @@ class Files extends resource_1.APIResource {
|
|
|
88
92
|
* @deprecated The `.content()` method should be used instead
|
|
89
93
|
*/
|
|
90
94
|
retrieveContent(fileId, options) {
|
|
91
|
-
return this._client.get(`/files/${fileId}/content`,
|
|
92
|
-
...options,
|
|
93
|
-
headers: { Accept: 'application/json', ...options?.headers },
|
|
94
|
-
});
|
|
95
|
+
return this._client.get(`/files/${fileId}/content`, options);
|
|
95
96
|
}
|
|
96
97
|
/**
|
|
97
98
|
* Waits for the given file to be processed, default timeout is 30 mins.
|
package/resources/files.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.js","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,6CAA0C;AAC1C,qCAA2C;AAC3C,qCAAgC;AAChC,uCAAqD;AACrD,iDAAgC;AAChC,iDAAkE;AAGlE,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,MAAM,CAAC,IAAsB,EAAE,OAA6B;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,2BAA2B,CAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC;IAC7F,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,MAAc,EAAE,OAA6B;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;IAOD,IAAI,CACF,QAA8C,EAAE,EAChD,OAA6B;QAE7B,IAAI,IAAA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,MAAM,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YACxD,MAAM,IAAA,YAAK,EAAC,YAAY,CAAC,CAAC;YAE1B,IAAI,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;YAC/B,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,OAAO,EAAE;gBAChC,MAAM,IAAI,iCAAyB,CAAC;oBAClC,OAAO,EAAE,iCAAiC,EAAE,+BAA+B,OAAO,gBAAgB;iBACnG,CAAC,CAAC;aACJ;SACF;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAtGD,sBAsGC;AAED,MAAa,eAAgB,SAAQ,uBAAsB;CAAG;AAA9D,0CAA8D;AAgH9D,KAAK,CAAC,eAAe,GAAG,eAAe,CAAC"}
|
package/resources/files.mjs
CHANGED
|
@@ -54,7 +54,11 @@ export class Files extends APIResource {
|
|
|
54
54
|
* Returns the contents of the specified file.
|
|
55
55
|
*/
|
|
56
56
|
content(fileId, options) {
|
|
57
|
-
return this._client.get(`/files/${fileId}/content`, {
|
|
57
|
+
return this._client.get(`/files/${fileId}/content`, {
|
|
58
|
+
...options,
|
|
59
|
+
headers: { Accept: 'application/binary', ...options?.headers },
|
|
60
|
+
__binaryResponse: true,
|
|
61
|
+
});
|
|
58
62
|
}
|
|
59
63
|
/**
|
|
60
64
|
* Returns the contents of the specified file.
|
|
@@ -62,10 +66,7 @@ export class Files extends APIResource {
|
|
|
62
66
|
* @deprecated The `.content()` method should be used instead
|
|
63
67
|
*/
|
|
64
68
|
retrieveContent(fileId, options) {
|
|
65
|
-
return this._client.get(`/files/${fileId}/content`,
|
|
66
|
-
...options,
|
|
67
|
-
headers: { Accept: 'application/json', ...options?.headers },
|
|
68
|
-
});
|
|
69
|
+
return this._client.get(`/files/${fileId}/content`, options);
|
|
69
70
|
}
|
|
70
71
|
/**
|
|
71
72
|
* Waits for the given file to be processed, default timeout is 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B;CAAG;AAgH9D,KAAK,CAAC,eAAe,GAAG,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { OpenAIRealtimeError } from './internal-base';
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { RealtimeClientEvent, RealtimeServerEvent, ErrorEvent } from '../../resources/beta/realtime/realtime';
|
|
2
|
+
import { EventEmitter } from '../../lib/EventEmitter';
|
|
3
|
+
import { OpenAIError } from '../../error';
|
|
4
|
+
|
|
5
|
+
export class OpenAIRealtimeError extends OpenAIError {
|
|
6
|
+
/**
|
|
7
|
+
* The error data that the API sent back in an `error` event.
|
|
8
|
+
*/
|
|
9
|
+
error?: ErrorEvent.Error | undefined;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The unique ID of the server event.
|
|
13
|
+
*/
|
|
14
|
+
event_id?: string | undefined;
|
|
15
|
+
|
|
16
|
+
constructor(message: string, event: ErrorEvent | null) {
|
|
17
|
+
super(message);
|
|
18
|
+
|
|
19
|
+
this.error = event?.error;
|
|
20
|
+
this.event_id = event?.event_id;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
|
|
25
|
+
|
|
26
|
+
type RealtimeEvents = Simplify<
|
|
27
|
+
{
|
|
28
|
+
event: (event: RealtimeServerEvent) => void;
|
|
29
|
+
error: (error: OpenAIRealtimeError) => void;
|
|
30
|
+
} & {
|
|
31
|
+
[EventType in Exclude<RealtimeServerEvent['type'], 'error'>]: (
|
|
32
|
+
event: Extract<RealtimeServerEvent, { type: EventType }>,
|
|
33
|
+
) => unknown;
|
|
34
|
+
}
|
|
35
|
+
>;
|
|
36
|
+
|
|
37
|
+
export abstract class OpenAIRealtimeEmitter extends EventEmitter<RealtimeEvents> {
|
|
38
|
+
/**
|
|
39
|
+
* Send an event to the API.
|
|
40
|
+
*/
|
|
41
|
+
abstract send(event: RealtimeClientEvent): void;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Close the websocket connection.
|
|
45
|
+
*/
|
|
46
|
+
abstract close(props?: { code: number; reason: string }): void;
|
|
47
|
+
|
|
48
|
+
protected _onError(event: null, message: string, cause: any): void;
|
|
49
|
+
protected _onError(event: ErrorEvent, message?: string | undefined): void;
|
|
50
|
+
protected _onError(event: ErrorEvent | null, message?: string | undefined, cause?: any): void {
|
|
51
|
+
message =
|
|
52
|
+
event?.error ?
|
|
53
|
+
`${event.error.message} code=${event.error.code} param=${event.error.param} type=${event.error.type} event_id=${event.error.event_id}`
|
|
54
|
+
: message ?? 'unknown error';
|
|
55
|
+
|
|
56
|
+
if (!this._hasListener('error')) {
|
|
57
|
+
const error = new OpenAIRealtimeError(
|
|
58
|
+
message +
|
|
59
|
+
`\n\nTo resolve these unhandled rejection errors you should bind an \`error\` callback, e.g. \`rt.on('error', (error) => ...)\` `,
|
|
60
|
+
event,
|
|
61
|
+
);
|
|
62
|
+
// @ts-ignore
|
|
63
|
+
error.cause = cause;
|
|
64
|
+
Promise.reject(error);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const error = new OpenAIRealtimeError(message, event);
|
|
69
|
+
// @ts-ignore
|
|
70
|
+
error.cause = cause;
|
|
71
|
+
|
|
72
|
+
this._emit('error', error);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function buildRealtimeURL(props: { baseURL: string; model: string }): URL {
|
|
77
|
+
const path = '/realtime';
|
|
78
|
+
|
|
79
|
+
const url = new URL(props.baseURL + (props.baseURL.endsWith('/') ? path.slice(1) : path));
|
|
80
|
+
url.protocol = 'wss';
|
|
81
|
+
url.searchParams.set('model', props.model);
|
|
82
|
+
return url;
|
|
83
|
+
}
|