openai 4.36.0 → 4.37.1
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 +16 -0
- package/README.md +16 -2
- package/lib/AssistantStream.d.ts +2 -2
- package/lib/AssistantStream.d.ts.map +1 -1
- package/lib/Util.d.ts +5 -0
- package/lib/Util.d.ts.map +1 -0
- package/lib/Util.js +26 -0
- package/lib/Util.js.map +1 -0
- package/lib/Util.mjs +22 -0
- package/lib/Util.mjs.map +1 -0
- package/package.json +1 -1
- package/resources/beta/{assistants/assistants.d.ts → assistants.d.ts} +248 -41
- package/resources/beta/assistants.d.ts.map +1 -0
- package/resources/beta/{assistants/assistants.js → assistants.js} +6 -13
- package/resources/beta/assistants.js.map +1 -0
- package/resources/beta/{assistants/assistants.mjs → assistants.mjs} +6 -13
- package/resources/beta/assistants.mjs.map +1 -0
- package/resources/beta/beta.d.ts +11 -2
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js +5 -1
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +5 -1
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/index.d.ts +2 -1
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js +11 -8
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs +2 -1
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/threads/index.d.ts +1 -1
- package/resources/beta/threads/index.d.ts.map +1 -1
- package/resources/beta/threads/index.js +6 -6
- package/resources/beta/threads/index.js.map +1 -1
- package/resources/beta/threads/index.mjs +1 -1
- package/resources/beta/threads/{messages/messages.d.ts → messages.d.ts} +27 -28
- package/resources/beta/threads/messages.d.ts.map +1 -0
- package/resources/beta/threads/{messages/messages.js → messages.js} +5 -12
- package/resources/beta/threads/messages.js.map +1 -0
- package/resources/beta/threads/{messages/messages.mjs → messages.mjs} +5 -12
- package/resources/beta/threads/messages.mjs.map +1 -0
- package/resources/beta/threads/runs/index.d.ts +1 -1
- package/resources/beta/threads/runs/index.d.ts.map +1 -1
- package/resources/beta/threads/runs/runs.d.ts +141 -47
- package/resources/beta/threads/runs/runs.d.ts.map +1 -1
- package/resources/beta/threads/runs/runs.js +6 -6
- package/resources/beta/threads/runs/runs.js.map +1 -1
- package/resources/beta/threads/runs/runs.mjs +6 -6
- package/resources/beta/threads/runs/runs.mjs.map +1 -1
- package/resources/beta/threads/runs/steps.d.ts +40 -40
- package/resources/beta/threads/runs/steps.d.ts.map +1 -1
- package/resources/beta/threads/runs/steps.js +2 -2
- package/resources/beta/threads/runs/steps.mjs +2 -2
- package/resources/beta/threads/threads.d.ts +536 -40
- package/resources/beta/threads/threads.d.ts.map +1 -1
- package/resources/beta/threads/threads.js +6 -6
- package/resources/beta/threads/threads.js.map +1 -1
- package/resources/beta/threads/threads.mjs +6 -6
- package/resources/beta/threads/threads.mjs.map +1 -1
- package/resources/beta/vector-stores/file-batches.d.ts +142 -0
- package/resources/beta/vector-stores/file-batches.d.ts.map +1 -0
- package/resources/beta/vector-stores/file-batches.js +128 -0
- package/resources/beta/vector-stores/file-batches.js.map +1 -0
- package/resources/beta/vector-stores/file-batches.mjs +124 -0
- package/resources/beta/vector-stores/file-batches.mjs.map +1 -0
- package/resources/beta/vector-stores/files.d.ts +148 -0
- package/resources/beta/vector-stores/files.d.ts.map +1 -0
- package/resources/beta/vector-stores/files.js +148 -0
- package/resources/beta/vector-stores/files.js.map +1 -0
- package/resources/beta/vector-stores/files.mjs +120 -0
- package/resources/beta/vector-stores/files.mjs.map +1 -0
- package/resources/beta/vector-stores/index.d.ts +4 -0
- package/resources/beta/vector-stores/index.d.ts.map +1 -0
- package/resources/beta/vector-stores/index.js +13 -0
- package/resources/beta/vector-stores/index.js.map +1 -0
- package/resources/beta/vector-stores/index.mjs +5 -0
- package/resources/beta/vector-stores/index.mjs.map +1 -0
- package/resources/beta/vector-stores/vector-stores.d.ts +233 -0
- package/resources/beta/vector-stores/vector-stores.d.ts.map +1 -0
- package/resources/beta/vector-stores/vector-stores.js +99 -0
- package/resources/beta/vector-stores/vector-stores.js.map +1 -0
- package/resources/beta/vector-stores/vector-stores.mjs +71 -0
- package/resources/beta/vector-stores/vector-stores.mjs.map +1 -0
- package/resources/fine-tuning/jobs/jobs.d.ts +1 -1
- package/src/lib/AssistantStream.ts +2 -2
- package/src/lib/Util.ts +23 -0
- package/src/resources/beta/{assistants/assistants.ts → assistants.ts} +288 -58
- package/src/resources/beta/beta.ts +11 -2
- package/src/resources/beta/index.ts +11 -2
- package/src/resources/beta/threads/index.ts +1 -1
- package/src/resources/beta/threads/{messages/messages.ts → messages.ts} +39 -38
- package/src/resources/beta/threads/runs/index.ts +2 -2
- package/src/resources/beta/threads/runs/runs.ts +160 -54
- package/src/resources/beta/threads/runs/steps.ts +49 -49
- package/src/resources/beta/threads/threads.ts +609 -45
- package/src/resources/beta/vector-stores/file-batches.ts +292 -0
- package/src/resources/beta/vector-stores/files.ts +277 -0
- package/src/resources/beta/vector-stores/index.ts +25 -0
- package/src/resources/beta/vector-stores/vector-stores.ts +318 -0
- package/src/resources/fine-tuning/jobs/jobs.ts +1 -1
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/beta/assistants/assistants.d.ts.map +0 -1
- package/resources/beta/assistants/assistants.js.map +0 -1
- package/resources/beta/assistants/assistants.mjs.map +0 -1
- package/resources/beta/assistants/files.d.ts +0 -88
- package/resources/beta/assistants/files.d.ts.map +0 -1
- package/resources/beta/assistants/files.js +0 -81
- package/resources/beta/assistants/files.js.map +0 -1
- package/resources/beta/assistants/files.mjs +0 -53
- package/resources/beta/assistants/files.mjs.map +0 -1
- package/resources/beta/assistants/index.d.ts +0 -3
- package/resources/beta/assistants/index.d.ts.map +0 -1
- package/resources/beta/assistants/index.js +0 -11
- package/resources/beta/assistants/index.js.map +0 -1
- package/resources/beta/assistants/index.mjs +0 -4
- package/resources/beta/assistants/index.mjs.map +0 -1
- package/resources/beta/threads/messages/files.d.ts +0 -60
- package/resources/beta/threads/messages/files.d.ts.map +0 -1
- package/resources/beta/threads/messages/files.js +0 -60
- package/resources/beta/threads/messages/files.js.map +0 -1
- package/resources/beta/threads/messages/files.mjs +0 -32
- package/resources/beta/threads/messages/files.mjs.map +0 -1
- package/resources/beta/threads/messages/index.d.ts +0 -3
- package/resources/beta/threads/messages/index.d.ts.map +0 -1
- package/resources/beta/threads/messages/index.js +0 -11
- package/resources/beta/threads/messages/index.js.map +0 -1
- package/resources/beta/threads/messages/index.mjs +0 -4
- package/resources/beta/threads/messages/index.mjs.map +0 -1
- package/resources/beta/threads/messages/messages.d.ts.map +0 -1
- package/resources/beta/threads/messages/messages.js.map +0 -1
- package/resources/beta/threads/messages/messages.mjs.map +0 -1
- package/src/resources/beta/assistants/files.ts +0 -154
- package/src/resources/beta/assistants/index.ts +0 -28
- package/src/resources/beta/threads/messages/files.ts +0 -105
- package/src/resources/beta/threads/messages/index.ts +0 -30
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.37.1 (2024-04-17)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v4.37.0...v4.37.1](https://github.com/openai/openai-node/compare/v4.37.0...v4.37.1)
|
|
6
|
+
|
|
7
|
+
### Chores
|
|
8
|
+
|
|
9
|
+
* **api:** docs and response_format response property ([#778](https://github.com/openai/openai-node/issues/778)) ([78f5c35](https://github.com/openai/openai-node/commit/78f5c3568d95d8e854c04049dc7d5643aa49e93f))
|
|
10
|
+
|
|
11
|
+
## 4.37.0 (2024-04-17)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v4.36.0...v4.37.0](https://github.com/openai/openai-node/compare/v4.36.0...v4.37.0)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **api:** add vector stores ([#776](https://github.com/openai/openai-node/issues/776)) ([8bb929b](https://github.com/openai/openai-node/commit/8bb929b2ee91c1bec0a00347bf4f7628652d1be3))
|
|
18
|
+
|
|
3
19
|
## 4.36.0 (2024-04-16)
|
|
4
20
|
|
|
5
21
|
Full Changelog: [v4.35.0...v4.36.0](https://github.com/openai/openai-node/compare/v4.35.0...v4.36.0)
|
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ You can import in Deno via:
|
|
|
19
19
|
<!-- x-release-please-start-version -->
|
|
20
20
|
|
|
21
21
|
```ts
|
|
22
|
-
import OpenAI from 'https://deno.land/x/openai@v4.
|
|
22
|
+
import OpenAI from 'https://deno.land/x/openai@v4.37.1/mod.ts';
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
<!-- x-release-please-end -->
|
|
@@ -102,7 +102,7 @@ Documentation for each method, request param, and response field are available i
|
|
|
102
102
|
|
|
103
103
|
### Polling Helpers
|
|
104
104
|
|
|
105
|
-
When interacting with the API some actions such as starting a Run
|
|
105
|
+
When interacting with the API some actions such as starting a Run and adding files to vector stores are asynchronous and take time to complete. The SDK includes
|
|
106
106
|
helper functions which will poll the status until it reaches a terminal state and then return the resulting object.
|
|
107
107
|
If an API method results in an action which could benefit from polling there will be a corresponding version of the
|
|
108
108
|
method ending in 'AndPoll'.
|
|
@@ -117,6 +117,20 @@ const run = await openai.beta.threads.runs.createAndPoll(thread.id, {
|
|
|
117
117
|
|
|
118
118
|
More information on the lifecycle of a Run can be found in the [Run Lifecycle Documentation](https://platform.openai.com/docs/assistants/how-it-works/run-lifecycle)
|
|
119
119
|
|
|
120
|
+
### Bulk Upload Helpers
|
|
121
|
+
|
|
122
|
+
When creating an interacting with vector stores, you can use the polling helpers to monitor the status of operations.
|
|
123
|
+
For convenience, we also provide a bulk upload helper to allow you to simultaneously upload several files at once.
|
|
124
|
+
|
|
125
|
+
```ts
|
|
126
|
+
const fileList = [
|
|
127
|
+
createReadStream('/home/data/example.pdf'),
|
|
128
|
+
...
|
|
129
|
+
];
|
|
130
|
+
|
|
131
|
+
const batch = await openai.vectorStores.fileBatches.uploadAndPoll(vectorStore.id, fileList);
|
|
132
|
+
```
|
|
133
|
+
|
|
120
134
|
### Streaming Helpers
|
|
121
135
|
|
|
122
136
|
The SDK also includes helpers to process streams and handle the incoming events.
|
package/lib/AssistantStream.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Message, Text, ImageFile, TextDelta, Messages } from 'openai/resources/beta/threads/messages
|
|
1
|
+
import { Message, Text, ImageFile, TextDelta, Messages } from 'openai/resources/beta/threads/messages';
|
|
2
2
|
import * as Core from 'openai/core';
|
|
3
3
|
import { RequestOptions } from 'openai/core';
|
|
4
4
|
import { Run, RunCreateParamsBase, Runs, RunSubmitToolOutputsParamsBase } from 'openai/resources/beta/threads/runs/runs';
|
|
5
5
|
import { AbstractAssistantRunnerEvents, AbstractAssistantStreamRunner } from "./AbstractAssistantStreamRunner.js";
|
|
6
6
|
import { type ReadableStream } from 'openai/_shims/index';
|
|
7
|
-
import { AssistantStreamEvent } from 'openai/resources/beta/assistants
|
|
7
|
+
import { AssistantStreamEvent } from 'openai/resources/beta/assistants';
|
|
8
8
|
import { RunStep, RunStepDelta, ToolCall, ToolCallDelta } from 'openai/resources/beta/threads/runs/steps';
|
|
9
9
|
import { ThreadCreateAndRunParamsBase, Threads } from 'openai/resources/beta/threads/threads';
|
|
10
10
|
import MessageDelta = Messages.MessageDelta;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantStream.d.ts","sourceRoot":"","sources":["../src/lib/AssistantStream.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,OAAO,EAEP,IAAI,EACJ,SAAS,EACT,SAAS,EACT,QAAQ,EACT,MAAM,
|
|
1
|
+
{"version":3,"file":"AssistantStream.d.ts","sourceRoot":"","sources":["../src/lib/AssistantStream.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,OAAO,EAEP,IAAI,EACJ,SAAS,EACT,SAAS,EACT,QAAQ,EACT,MAAM,wCAAwC,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IAmUf,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAgElG"}
|
package/lib/Util.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Util.d.ts","sourceRoot":"","sources":["../src/lib/Util.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,mBAAmB,6CAmB/B,CAAC"}
|
package/lib/Util.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.allSettledWithThrow = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Like `Promise.allSettled()` but throws an error if any promises are rejected.
|
|
6
|
+
*/
|
|
7
|
+
const allSettledWithThrow = async (promises) => {
|
|
8
|
+
const results = await Promise.allSettled(promises);
|
|
9
|
+
const rejected = results.filter((result) => result.status === 'rejected');
|
|
10
|
+
if (rejected.length) {
|
|
11
|
+
for (const result of rejected) {
|
|
12
|
+
console.error(result.reason);
|
|
13
|
+
}
|
|
14
|
+
throw new Error(`${rejected.length} promise(s) failed - see the above errors`);
|
|
15
|
+
}
|
|
16
|
+
// Note: TS was complaining about using `.filter().map()` here for some reason
|
|
17
|
+
const values = [];
|
|
18
|
+
for (const result of results) {
|
|
19
|
+
if (result.status === 'fulfilled') {
|
|
20
|
+
values.push(result.value);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return values;
|
|
24
|
+
};
|
|
25
|
+
exports.allSettledWithThrow = allSettledWithThrow;
|
|
26
|
+
//# sourceMappingURL=Util.js.map
|
package/lib/Util.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Util.js","sourceRoot":"","sources":["../src/lib/Util.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACI,MAAM,mBAAmB,GAAG,KAAK,EAAK,QAAsB,EAAgB,EAAE;IACnF,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IACnD,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAmC,EAAE,CAAC,MAAM,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC;IAC3G,IAAI,QAAQ,CAAC,MAAM,EAAE;QACnB,KAAK,MAAM,MAAM,IAAI,QAAQ,EAAE;YAC7B,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;SAC9B;QAED,MAAM,IAAI,KAAK,CAAC,GAAG,QAAQ,CAAC,MAAM,2CAA2C,CAAC,CAAC;KAChF;IAED,8EAA8E;IAC9E,MAAM,MAAM,GAAQ,EAAE,CAAC;IACvB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;QAC5B,IAAI,MAAM,CAAC,MAAM,KAAK,WAAW,EAAE;YACjC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SAC3B;KACF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAnBW,QAAA,mBAAmB,uBAmB9B"}
|
package/lib/Util.mjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Like `Promise.allSettled()` but throws an error if any promises are rejected.
|
|
3
|
+
*/
|
|
4
|
+
export const allSettledWithThrow = async (promises) => {
|
|
5
|
+
const results = await Promise.allSettled(promises);
|
|
6
|
+
const rejected = results.filter((result) => result.status === 'rejected');
|
|
7
|
+
if (rejected.length) {
|
|
8
|
+
for (const result of rejected) {
|
|
9
|
+
console.error(result.reason);
|
|
10
|
+
}
|
|
11
|
+
throw new Error(`${rejected.length} promise(s) failed - see the above errors`);
|
|
12
|
+
}
|
|
13
|
+
// Note: TS was complaining about using `.filter().map()` here for some reason
|
|
14
|
+
const values = [];
|
|
15
|
+
for (const result of results) {
|
|
16
|
+
if (result.status === 'fulfilled') {
|
|
17
|
+
values.push(result.value);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return values;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=Util.mjs.map
|
package/lib/Util.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Util.mjs","sourceRoot":"","sources":["../src/lib/Util.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EAAK,QAAsB,EAAgB,EAAE;IACnF,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IACnD,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAmC,EAAE,CAAC,MAAM,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC;IAC3G,IAAI,QAAQ,CAAC,MAAM,EAAE;QACnB,KAAK,MAAM,MAAM,IAAI,QAAQ,EAAE;YAC7B,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;SAC9B;QAED,MAAM,IAAI,KAAK,CAAC,GAAG,QAAQ,CAAC,MAAM,2CAA2C,CAAC,CAAC;KAChF;IAED,8EAA8E;IAC9E,MAAM,MAAM,GAAQ,EAAE,CAAC;IACvB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;QAC5B,IAAI,MAAM,CAAC,MAAM,KAAK,WAAW,EAAE;YACjC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SAC3B;KACF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import * as Core from 'openai/core';
|
|
2
2
|
import { APIResource } from 'openai/resource';
|
|
3
|
-
import * as AssistantsAPI from 'openai/resources/beta/assistants
|
|
3
|
+
import * as AssistantsAPI from 'openai/resources/beta/assistants';
|
|
4
4
|
import * as Shared from 'openai/resources/shared';
|
|
5
|
-
import * as
|
|
5
|
+
import * as MessagesAPI from 'openai/resources/beta/threads/messages';
|
|
6
6
|
import * as ThreadsAPI from 'openai/resources/beta/threads/threads';
|
|
7
|
-
import * as MessagesAPI from 'openai/resources/beta/threads/messages/messages';
|
|
8
7
|
import * as RunsAPI from 'openai/resources/beta/threads/runs/runs';
|
|
9
8
|
import * as StepsAPI from 'openai/resources/beta/threads/runs/steps';
|
|
10
9
|
import { CursorPage, type CursorPageParams } from 'openai/pagination';
|
|
11
10
|
export declare class Assistants extends APIResource {
|
|
12
|
-
files: FilesAPI.Files;
|
|
13
11
|
/**
|
|
14
12
|
* Create an assistant with a model and instructions.
|
|
15
13
|
*/
|
|
@@ -50,12 +48,6 @@ export interface Assistant {
|
|
|
50
48
|
* The description of the assistant. The maximum length is 512 characters.
|
|
51
49
|
*/
|
|
52
50
|
description: string | null;
|
|
53
|
-
/**
|
|
54
|
-
* A list of [file](https://platform.openai.com/docs/api-reference/files) IDs
|
|
55
|
-
* attached to this assistant. There can be a maximum of 20 files attached to the
|
|
56
|
-
* assistant. Files are ordered by their creation date in ascending order.
|
|
57
|
-
*/
|
|
58
|
-
file_ids: Array<string>;
|
|
59
51
|
/**
|
|
60
52
|
* The system instructions that the assistant uses. The maximum length is 256,000
|
|
61
53
|
* characters.
|
|
@@ -86,9 +78,79 @@ export interface Assistant {
|
|
|
86
78
|
object: 'assistant';
|
|
87
79
|
/**
|
|
88
80
|
* A list of tool enabled on the assistant. There can be a maximum of 128 tools per
|
|
89
|
-
* assistant. Tools can be of types `code_interpreter`, `
|
|
81
|
+
* assistant. Tools can be of types `code_interpreter`, `file_search`, or
|
|
82
|
+
* `function`.
|
|
90
83
|
*/
|
|
91
84
|
tools: Array<AssistantTool>;
|
|
85
|
+
/**
|
|
86
|
+
* Specifies the format that the model must output. Compatible with
|
|
87
|
+
* [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo) and
|
|
88
|
+
* all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
|
|
89
|
+
*
|
|
90
|
+
* Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the
|
|
91
|
+
* message the model generates is valid JSON.
|
|
92
|
+
*
|
|
93
|
+
* **Important:** when using JSON mode, you **must** also instruct the model to
|
|
94
|
+
* produce JSON yourself via a system or user message. Without this, the model may
|
|
95
|
+
* generate an unending stream of whitespace until the generation reaches the token
|
|
96
|
+
* limit, resulting in a long-running and seemingly "stuck" request. Also note that
|
|
97
|
+
* the message content may be partially cut off if `finish_reason="length"`, which
|
|
98
|
+
* indicates the generation exceeded `max_tokens` or the conversation exceeded the
|
|
99
|
+
* max context length.
|
|
100
|
+
*/
|
|
101
|
+
response_format?: ThreadsAPI.AssistantResponseFormatOption | null;
|
|
102
|
+
/**
|
|
103
|
+
* What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
|
|
104
|
+
* make the output more random, while lower values like 0.2 will make it more
|
|
105
|
+
* focused and deterministic.
|
|
106
|
+
*/
|
|
107
|
+
temperature?: number | null;
|
|
108
|
+
/**
|
|
109
|
+
* A set of resources that are used by the assistant's tools. The resources are
|
|
110
|
+
* specific to the type of tool. For example, the `code_interpreter` tool requires
|
|
111
|
+
* a list of file IDs, while the `file_search` tool requires a list of vector store
|
|
112
|
+
* IDs.
|
|
113
|
+
*/
|
|
114
|
+
tool_resources?: Assistant.ToolResources | null;
|
|
115
|
+
/**
|
|
116
|
+
* An alternative to sampling with temperature, called nucleus sampling, where the
|
|
117
|
+
* model considers the results of the tokens with top_p probability mass. So 0.1
|
|
118
|
+
* means only the tokens comprising the top 10% probability mass are considered.
|
|
119
|
+
*
|
|
120
|
+
* We generally recommend altering this or temperature but not both.
|
|
121
|
+
*/
|
|
122
|
+
top_p?: number | null;
|
|
123
|
+
}
|
|
124
|
+
export declare namespace Assistant {
|
|
125
|
+
/**
|
|
126
|
+
* A set of resources that are used by the assistant's tools. The resources are
|
|
127
|
+
* specific to the type of tool. For example, the `code_interpreter` tool requires
|
|
128
|
+
* a list of file IDs, while the `file_search` tool requires a list of vector store
|
|
129
|
+
* IDs.
|
|
130
|
+
*/
|
|
131
|
+
interface ToolResources {
|
|
132
|
+
code_interpreter?: ToolResources.CodeInterpreter;
|
|
133
|
+
file_search?: ToolResources.FileSearch;
|
|
134
|
+
}
|
|
135
|
+
namespace ToolResources {
|
|
136
|
+
interface CodeInterpreter {
|
|
137
|
+
/**
|
|
138
|
+
* A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
|
|
139
|
+
* available to the `code_interpreter`` tool. There can be a maximum of 20 files
|
|
140
|
+
* associated with the tool.
|
|
141
|
+
*/
|
|
142
|
+
file_ids?: Array<string>;
|
|
143
|
+
}
|
|
144
|
+
interface FileSearch {
|
|
145
|
+
/**
|
|
146
|
+
* The ID of the
|
|
147
|
+
* [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
|
|
148
|
+
* attached to this assistant. There can be a maximum of 1 vector store attached to
|
|
149
|
+
* the assistant.
|
|
150
|
+
*/
|
|
151
|
+
vector_store_ids?: Array<string>;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
92
154
|
}
|
|
93
155
|
export interface AssistantDeleted {
|
|
94
156
|
id: string;
|
|
@@ -400,13 +462,19 @@ export declare namespace AssistantStreamEvent {
|
|
|
400
462
|
event: 'error';
|
|
401
463
|
}
|
|
402
464
|
}
|
|
403
|
-
export type AssistantTool = CodeInterpreterTool |
|
|
465
|
+
export type AssistantTool = CodeInterpreterTool | FileSearchTool | FunctionTool;
|
|
404
466
|
export interface CodeInterpreterTool {
|
|
405
467
|
/**
|
|
406
468
|
* The type of tool being defined: `code_interpreter`
|
|
407
469
|
*/
|
|
408
470
|
type: 'code_interpreter';
|
|
409
471
|
}
|
|
472
|
+
export interface FileSearchTool {
|
|
473
|
+
/**
|
|
474
|
+
* The type of tool being defined: `file_search`
|
|
475
|
+
*/
|
|
476
|
+
type: 'file_search';
|
|
477
|
+
}
|
|
410
478
|
export interface FunctionTool {
|
|
411
479
|
function: Shared.FunctionDefinition;
|
|
412
480
|
/**
|
|
@@ -487,12 +555,6 @@ export declare namespace MessageStreamEvent {
|
|
|
487
555
|
event: 'thread.message.incomplete';
|
|
488
556
|
}
|
|
489
557
|
}
|
|
490
|
-
export interface RetrievalTool {
|
|
491
|
-
/**
|
|
492
|
-
* The type of tool being defined: `retrieval`
|
|
493
|
-
*/
|
|
494
|
-
type: 'retrieval';
|
|
495
|
-
}
|
|
496
558
|
/**
|
|
497
559
|
* Occurs when a
|
|
498
560
|
* [run step](https://platform.openai.com/docs/api-reference/runs/step-object) is
|
|
@@ -727,12 +789,6 @@ export interface AssistantCreateParams {
|
|
|
727
789
|
* The description of the assistant. The maximum length is 512 characters.
|
|
728
790
|
*/
|
|
729
791
|
description?: string | null;
|
|
730
|
-
/**
|
|
731
|
-
* A list of [file](https://platform.openai.com/docs/api-reference/files) IDs
|
|
732
|
-
* attached to this assistant. There can be a maximum of 20 files attached to the
|
|
733
|
-
* assistant. Files are ordered by their creation date in ascending order.
|
|
734
|
-
*/
|
|
735
|
-
file_ids?: Array<string>;
|
|
736
792
|
/**
|
|
737
793
|
* The system instructions that the assistant uses. The maximum length is 256,000
|
|
738
794
|
* characters.
|
|
@@ -749,25 +805,111 @@ export interface AssistantCreateParams {
|
|
|
749
805
|
* The name of the assistant. The maximum length is 256 characters.
|
|
750
806
|
*/
|
|
751
807
|
name?: string | null;
|
|
808
|
+
/**
|
|
809
|
+
* Specifies the format that the model must output. Compatible with
|
|
810
|
+
* [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo) and
|
|
811
|
+
* all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
|
|
812
|
+
*
|
|
813
|
+
* Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the
|
|
814
|
+
* message the model generates is valid JSON.
|
|
815
|
+
*
|
|
816
|
+
* **Important:** when using JSON mode, you **must** also instruct the model to
|
|
817
|
+
* produce JSON yourself via a system or user message. Without this, the model may
|
|
818
|
+
* generate an unending stream of whitespace until the generation reaches the token
|
|
819
|
+
* limit, resulting in a long-running and seemingly "stuck" request. Also note that
|
|
820
|
+
* the message content may be partially cut off if `finish_reason="length"`, which
|
|
821
|
+
* indicates the generation exceeded `max_tokens` or the conversation exceeded the
|
|
822
|
+
* max context length.
|
|
823
|
+
*/
|
|
824
|
+
response_format?: ThreadsAPI.AssistantResponseFormatOption | null;
|
|
825
|
+
/**
|
|
826
|
+
* What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
|
|
827
|
+
* make the output more random, while lower values like 0.2 will make it more
|
|
828
|
+
* focused and deterministic.
|
|
829
|
+
*/
|
|
830
|
+
temperature?: number | null;
|
|
831
|
+
/**
|
|
832
|
+
* A set of resources that are used by the assistant's tools. The resources are
|
|
833
|
+
* specific to the type of tool. For example, the `code_interpreter` tool requires
|
|
834
|
+
* a list of file IDs, while the `file_search` tool requires a list of vector store
|
|
835
|
+
* IDs.
|
|
836
|
+
*/
|
|
837
|
+
tool_resources?: AssistantCreateParams.ToolResources | null;
|
|
752
838
|
/**
|
|
753
839
|
* A list of tool enabled on the assistant. There can be a maximum of 128 tools per
|
|
754
|
-
* assistant. Tools can be of types `code_interpreter`, `
|
|
840
|
+
* assistant. Tools can be of types `code_interpreter`, `file_search`, or
|
|
841
|
+
* `function`.
|
|
755
842
|
*/
|
|
756
843
|
tools?: Array<AssistantTool>;
|
|
844
|
+
/**
|
|
845
|
+
* An alternative to sampling with temperature, called nucleus sampling, where the
|
|
846
|
+
* model considers the results of the tokens with top_p probability mass. So 0.1
|
|
847
|
+
* means only the tokens comprising the top 10% probability mass are considered.
|
|
848
|
+
*
|
|
849
|
+
* We generally recommend altering this or temperature but not both.
|
|
850
|
+
*/
|
|
851
|
+
top_p?: number | null;
|
|
852
|
+
}
|
|
853
|
+
export declare namespace AssistantCreateParams {
|
|
854
|
+
/**
|
|
855
|
+
* A set of resources that are used by the assistant's tools. The resources are
|
|
856
|
+
* specific to the type of tool. For example, the `code_interpreter` tool requires
|
|
857
|
+
* a list of file IDs, while the `file_search` tool requires a list of vector store
|
|
858
|
+
* IDs.
|
|
859
|
+
*/
|
|
860
|
+
interface ToolResources {
|
|
861
|
+
code_interpreter?: ToolResources.CodeInterpreter;
|
|
862
|
+
file_search?: ToolResources.FileSearch;
|
|
863
|
+
}
|
|
864
|
+
namespace ToolResources {
|
|
865
|
+
interface CodeInterpreter {
|
|
866
|
+
/**
|
|
867
|
+
* A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
|
|
868
|
+
* available to the `code_interpreter` tool. There can be a maximum of 20 files
|
|
869
|
+
* associated with the tool.
|
|
870
|
+
*/
|
|
871
|
+
file_ids?: Array<string>;
|
|
872
|
+
}
|
|
873
|
+
interface FileSearch {
|
|
874
|
+
/**
|
|
875
|
+
* The
|
|
876
|
+
* [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
|
|
877
|
+
* attached to this assistant. There can be a maximum of 1 vector store attached to
|
|
878
|
+
* the assistant.
|
|
879
|
+
*/
|
|
880
|
+
vector_store_ids?: Array<string>;
|
|
881
|
+
/**
|
|
882
|
+
* A helper to create a
|
|
883
|
+
* [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
|
|
884
|
+
* with file_ids and attach it to this assistant. There can be a maximum of 1
|
|
885
|
+
* vector store attached to the assistant.
|
|
886
|
+
*/
|
|
887
|
+
vector_stores?: Array<FileSearch.VectorStore>;
|
|
888
|
+
}
|
|
889
|
+
namespace FileSearch {
|
|
890
|
+
interface VectorStore {
|
|
891
|
+
/**
|
|
892
|
+
* A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to
|
|
893
|
+
* add to the vector store. There can be a maximum of 10000 files in a vector
|
|
894
|
+
* store.
|
|
895
|
+
*/
|
|
896
|
+
file_ids?: Array<string>;
|
|
897
|
+
/**
|
|
898
|
+
* Set of 16 key-value pairs that can be attached to a vector store. This can be
|
|
899
|
+
* useful for storing additional information about the vector store in a structured
|
|
900
|
+
* format. Keys can be a maximum of 64 characters long and values can be a maxium
|
|
901
|
+
* of 512 characters long.
|
|
902
|
+
*/
|
|
903
|
+
metadata?: unknown;
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
}
|
|
757
907
|
}
|
|
758
908
|
export interface AssistantUpdateParams {
|
|
759
909
|
/**
|
|
760
910
|
* The description of the assistant. The maximum length is 512 characters.
|
|
761
911
|
*/
|
|
762
912
|
description?: string | null;
|
|
763
|
-
/**
|
|
764
|
-
* A list of [File](https://platform.openai.com/docs/api-reference/files) IDs
|
|
765
|
-
* attached to this assistant. There can be a maximum of 20 files attached to the
|
|
766
|
-
* assistant. Files are ordered by their creation date in ascending order. If a
|
|
767
|
-
* file was previously attached to the list but does not show up in the list, it
|
|
768
|
-
* will be deleted from the assistant.
|
|
769
|
-
*/
|
|
770
|
-
file_ids?: Array<string>;
|
|
771
913
|
/**
|
|
772
914
|
* The system instructions that the assistant uses. The maximum length is 256,000
|
|
773
915
|
* characters.
|
|
@@ -792,11 +934,82 @@ export interface AssistantUpdateParams {
|
|
|
792
934
|
* The name of the assistant. The maximum length is 256 characters.
|
|
793
935
|
*/
|
|
794
936
|
name?: string | null;
|
|
937
|
+
/**
|
|
938
|
+
* Specifies the format that the model must output. Compatible with
|
|
939
|
+
* [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo) and
|
|
940
|
+
* all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
|
|
941
|
+
*
|
|
942
|
+
* Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the
|
|
943
|
+
* message the model generates is valid JSON.
|
|
944
|
+
*
|
|
945
|
+
* **Important:** when using JSON mode, you **must** also instruct the model to
|
|
946
|
+
* produce JSON yourself via a system or user message. Without this, the model may
|
|
947
|
+
* generate an unending stream of whitespace until the generation reaches the token
|
|
948
|
+
* limit, resulting in a long-running and seemingly "stuck" request. Also note that
|
|
949
|
+
* the message content may be partially cut off if `finish_reason="length"`, which
|
|
950
|
+
* indicates the generation exceeded `max_tokens` or the conversation exceeded the
|
|
951
|
+
* max context length.
|
|
952
|
+
*/
|
|
953
|
+
response_format?: ThreadsAPI.AssistantResponseFormatOption | null;
|
|
954
|
+
/**
|
|
955
|
+
* What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
|
|
956
|
+
* make the output more random, while lower values like 0.2 will make it more
|
|
957
|
+
* focused and deterministic.
|
|
958
|
+
*/
|
|
959
|
+
temperature?: number | null;
|
|
960
|
+
/**
|
|
961
|
+
* A set of resources that are used by the assistant's tools. The resources are
|
|
962
|
+
* specific to the type of tool. For example, the `code_interpreter` tool requires
|
|
963
|
+
* a list of file IDs, while the `file_search` tool requires a list of vector store
|
|
964
|
+
* IDs.
|
|
965
|
+
*/
|
|
966
|
+
tool_resources?: AssistantUpdateParams.ToolResources | null;
|
|
795
967
|
/**
|
|
796
968
|
* A list of tool enabled on the assistant. There can be a maximum of 128 tools per
|
|
797
|
-
* assistant. Tools can be of types `code_interpreter`, `
|
|
969
|
+
* assistant. Tools can be of types `code_interpreter`, `file_search`, or
|
|
970
|
+
* `function`.
|
|
798
971
|
*/
|
|
799
972
|
tools?: Array<AssistantTool>;
|
|
973
|
+
/**
|
|
974
|
+
* An alternative to sampling with temperature, called nucleus sampling, where the
|
|
975
|
+
* model considers the results of the tokens with top_p probability mass. So 0.1
|
|
976
|
+
* means only the tokens comprising the top 10% probability mass are considered.
|
|
977
|
+
*
|
|
978
|
+
* We generally recommend altering this or temperature but not both.
|
|
979
|
+
*/
|
|
980
|
+
top_p?: number | null;
|
|
981
|
+
}
|
|
982
|
+
export declare namespace AssistantUpdateParams {
|
|
983
|
+
/**
|
|
984
|
+
* A set of resources that are used by the assistant's tools. The resources are
|
|
985
|
+
* specific to the type of tool. For example, the `code_interpreter` tool requires
|
|
986
|
+
* a list of file IDs, while the `file_search` tool requires a list of vector store
|
|
987
|
+
* IDs.
|
|
988
|
+
*/
|
|
989
|
+
interface ToolResources {
|
|
990
|
+
code_interpreter?: ToolResources.CodeInterpreter;
|
|
991
|
+
file_search?: ToolResources.FileSearch;
|
|
992
|
+
}
|
|
993
|
+
namespace ToolResources {
|
|
994
|
+
interface CodeInterpreter {
|
|
995
|
+
/**
|
|
996
|
+
* Overrides the list of
|
|
997
|
+
* [file](https://platform.openai.com/docs/api-reference/files) IDs made available
|
|
998
|
+
* to the `code_interpreter` tool. There can be a maximum of 20 files associated
|
|
999
|
+
* with the tool.
|
|
1000
|
+
*/
|
|
1001
|
+
file_ids?: Array<string>;
|
|
1002
|
+
}
|
|
1003
|
+
interface FileSearch {
|
|
1004
|
+
/**
|
|
1005
|
+
* Overrides the
|
|
1006
|
+
* [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
|
|
1007
|
+
* attached to this assistant. There can be a maximum of 1 vector store attached to
|
|
1008
|
+
* the assistant.
|
|
1009
|
+
*/
|
|
1010
|
+
vector_store_ids?: Array<string>;
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
800
1013
|
}
|
|
801
1014
|
export interface AssistantListParams extends CursorPageParams {
|
|
802
1015
|
/**
|
|
@@ -818,9 +1031,9 @@ export declare namespace Assistants {
|
|
|
818
1031
|
export import AssistantStreamEvent = AssistantsAPI.AssistantStreamEvent;
|
|
819
1032
|
export import AssistantTool = AssistantsAPI.AssistantTool;
|
|
820
1033
|
export import CodeInterpreterTool = AssistantsAPI.CodeInterpreterTool;
|
|
1034
|
+
export import FileSearchTool = AssistantsAPI.FileSearchTool;
|
|
821
1035
|
export import FunctionTool = AssistantsAPI.FunctionTool;
|
|
822
1036
|
export import MessageStreamEvent = AssistantsAPI.MessageStreamEvent;
|
|
823
|
-
export import RetrievalTool = AssistantsAPI.RetrievalTool;
|
|
824
1037
|
export import RunStepStreamEvent = AssistantsAPI.RunStepStreamEvent;
|
|
825
1038
|
export import RunStreamEvent = AssistantsAPI.RunStreamEvent;
|
|
826
1039
|
export import ThreadStreamEvent = AssistantsAPI.ThreadStreamEvent;
|
|
@@ -828,11 +1041,5 @@ export declare namespace Assistants {
|
|
|
828
1041
|
export import AssistantCreateParams = AssistantsAPI.AssistantCreateParams;
|
|
829
1042
|
export import AssistantUpdateParams = AssistantsAPI.AssistantUpdateParams;
|
|
830
1043
|
export import AssistantListParams = AssistantsAPI.AssistantListParams;
|
|
831
|
-
export import Files = FilesAPI.Files;
|
|
832
|
-
export import AssistantFile = FilesAPI.AssistantFile;
|
|
833
|
-
export import FileDeleteResponse = FilesAPI.FileDeleteResponse;
|
|
834
|
-
export import AssistantFilesPage = FilesAPI.AssistantFilesPage;
|
|
835
|
-
export import FileCreateParams = FilesAPI.FileCreateParams;
|
|
836
|
-
export import FileListParams = FilesAPI.FileListParams;
|
|
837
1044
|
}
|
|
838
1045
|
//# sourceMappingURL=assistants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistants.d.ts","sourceRoot":"","sources":["../../src/resources/beta/assistants.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,KAAK,aAAa,MAAM,kCAAkC,CAAC;AAClE,OAAO,KAAK,MAAM,MAAM,yBAAyB,CAAC;AAClD,OAAO,KAAK,WAAW,MAAM,wCAAwC,CAAC;AACtE,OAAO,KAAK,UAAU,MAAM,uCAAuC,CAAC;AACpE,OAAO,KAAK,OAAO,MAAM,yCAAyC,CAAC;AACnE,OAAO,KAAK,QAAQ,MAAM,0CAA0C,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEtE,qBAAa,UAAW,SAAQ,WAAW;IACzC;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,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MAAM,QAAQ,qBAAqB,GAAG,aAAa,CAAC,qBAAqB,CAAC;IAC1E,MAAM,QAAQ,mBAAmB,GAAG,aAAa,CAAC,mBAAmB,CAAC;CACvE"}
|
|
@@ -27,14 +27,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
27
27
|
exports.AssistantsPage = exports.Assistants = void 0;
|
|
28
28
|
const resource_1 = require("openai/resource");
|
|
29
29
|
const core_1 = require("openai/core");
|
|
30
|
-
const AssistantsAPI = __importStar(require("openai/resources/beta/assistants
|
|
31
|
-
const FilesAPI = __importStar(require("openai/resources/beta/assistants/files"));
|
|
30
|
+
const AssistantsAPI = __importStar(require("openai/resources/beta/assistants"));
|
|
32
31
|
const pagination_1 = require("openai/pagination");
|
|
33
32
|
class Assistants extends resource_1.APIResource {
|
|
34
|
-
constructor() {
|
|
35
|
-
super(...arguments);
|
|
36
|
-
this.files = new FilesAPI.Files(this._client);
|
|
37
|
-
}
|
|
38
33
|
/**
|
|
39
34
|
* Create an assistant with a model and instructions.
|
|
40
35
|
*/
|
|
@@ -42,7 +37,7 @@ class Assistants extends resource_1.APIResource {
|
|
|
42
37
|
return this._client.post('/assistants', {
|
|
43
38
|
body,
|
|
44
39
|
...options,
|
|
45
|
-
headers: { 'OpenAI-Beta': 'assistants=
|
|
40
|
+
headers: { 'OpenAI-Beta': 'assistants=v2', ...options?.headers },
|
|
46
41
|
});
|
|
47
42
|
}
|
|
48
43
|
/**
|
|
@@ -51,7 +46,7 @@ class Assistants extends resource_1.APIResource {
|
|
|
51
46
|
retrieve(assistantId, options) {
|
|
52
47
|
return this._client.get(`/assistants/${assistantId}`, {
|
|
53
48
|
...options,
|
|
54
|
-
headers: { 'OpenAI-Beta': 'assistants=
|
|
49
|
+
headers: { 'OpenAI-Beta': 'assistants=v2', ...options?.headers },
|
|
55
50
|
});
|
|
56
51
|
}
|
|
57
52
|
/**
|
|
@@ -61,7 +56,7 @@ class Assistants extends resource_1.APIResource {
|
|
|
61
56
|
return this._client.post(`/assistants/${assistantId}`, {
|
|
62
57
|
body,
|
|
63
58
|
...options,
|
|
64
|
-
headers: { 'OpenAI-Beta': 'assistants=
|
|
59
|
+
headers: { 'OpenAI-Beta': 'assistants=v2', ...options?.headers },
|
|
65
60
|
});
|
|
66
61
|
}
|
|
67
62
|
list(query = {}, options) {
|
|
@@ -71,7 +66,7 @@ class Assistants extends resource_1.APIResource {
|
|
|
71
66
|
return this._client.getAPIList('/assistants', AssistantsPage, {
|
|
72
67
|
query,
|
|
73
68
|
...options,
|
|
74
|
-
headers: { 'OpenAI-Beta': 'assistants=
|
|
69
|
+
headers: { 'OpenAI-Beta': 'assistants=v2', ...options?.headers },
|
|
75
70
|
});
|
|
76
71
|
}
|
|
77
72
|
/**
|
|
@@ -80,7 +75,7 @@ class Assistants extends resource_1.APIResource {
|
|
|
80
75
|
del(assistantId, options) {
|
|
81
76
|
return this._client.delete(`/assistants/${assistantId}`, {
|
|
82
77
|
...options,
|
|
83
|
-
headers: { 'OpenAI-Beta': 'assistants=
|
|
78
|
+
headers: { 'OpenAI-Beta': 'assistants=v2', ...options?.headers },
|
|
84
79
|
});
|
|
85
80
|
}
|
|
86
81
|
}
|
|
@@ -90,7 +85,5 @@ class AssistantsPage extends pagination_1.CursorPage {
|
|
|
90
85
|
exports.AssistantsPage = AssistantsPage;
|
|
91
86
|
(function (Assistants) {
|
|
92
87
|
Assistants.AssistantsPage = AssistantsAPI.AssistantsPage;
|
|
93
|
-
Assistants.Files = FilesAPI.Files;
|
|
94
|
-
Assistants.AssistantFilesPage = FilesAPI.AssistantFilesPage;
|
|
95
88
|
})(Assistants = exports.Assistants || (exports.Assistants = {}));
|
|
96
89
|
//# sourceMappingURL=assistants.js.map
|