Skip to content

Commit 8281dc9

Browse files
feat(api): updates (#1314)
1 parent 595e6b8 commit 8281dc9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2923
-124
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
configured_endpoints: 51
1+
configured_endpoints: 52

api.md

+33-7
Original file line numberDiff line numberDiff line change
@@ -159,16 +159,34 @@ Methods:
159159
Types:
160160

161161
```python
162-
from openai.types.fine_tuning import FineTuningJob, FineTuningJobEvent
162+
from openai.types.fine_tuning import (
163+
FineTuningJob,
164+
FineTuningJobEvent,
165+
FineTuningJobIntegration,
166+
FineTuningJobWandbIntegration,
167+
FineTuningJobWandbIntegrationObject,
168+
)
169+
```
170+
171+
Methods:
172+
173+
- <code title="post /fine_tuning/jobs">client.fine_tuning.jobs.<a href="./src/openai/resources/fine_tuning/jobs/jobs.py">create</a>(\*\*<a href="src/openai/types/fine_tuning/job_create_params.py">params</a>) -> <a href="./src/openai/types/fine_tuning/fine_tuning_job.py">FineTuningJob</a></code>
174+
- <code title="get /fine_tuning/jobs/{fine_tuning_job_id}">client.fine_tuning.jobs.<a href="./src/openai/resources/fine_tuning/jobs/jobs.py">retrieve</a>(fine_tuning_job_id) -> <a href="./src/openai/types/fine_tuning/fine_tuning_job.py">FineTuningJob</a></code>
175+
- <code title="get /fine_tuning/jobs">client.fine_tuning.jobs.<a href="./src/openai/resources/fine_tuning/jobs/jobs.py">list</a>(\*\*<a href="src/openai/types/fine_tuning/job_list_params.py">params</a>) -> <a href="./src/openai/types/fine_tuning/fine_tuning_job.py">SyncCursorPage[FineTuningJob]</a></code>
176+
- <code title="post /fine_tuning/jobs/{fine_tuning_job_id}/cancel">client.fine_tuning.jobs.<a href="./src/openai/resources/fine_tuning/jobs/jobs.py">cancel</a>(fine_tuning_job_id) -> <a href="./src/openai/types/fine_tuning/fine_tuning_job.py">FineTuningJob</a></code>
177+
- <code title="get /fine_tuning/jobs/{fine_tuning_job_id}/events">client.fine_tuning.jobs.<a href="./src/openai/resources/fine_tuning/jobs/jobs.py">list_events</a>(fine_tuning_job_id, \*\*<a href="src/openai/types/fine_tuning/job_list_events_params.py">params</a>) -> <a href="./src/openai/types/fine_tuning/fine_tuning_job_event.py">SyncCursorPage[FineTuningJobEvent]</a></code>
178+
179+
### Checkpoints
180+
181+
Types:
182+
183+
```python
184+
from openai.types.fine_tuning.jobs import FineTuningJobCheckpoint
163185
```
164186

165187
Methods:
166188

167-
- <code title="post /fine_tuning/jobs">client.fine_tuning.jobs.<a href="./src/openai/resources/fine_tuning/jobs.py">create</a>(\*\*<a href="src/openai/types/fine_tuning/job_create_params.py">params</a>) -> <a href="./src/openai/types/fine_tuning/fine_tuning_job.py">FineTuningJob</a></code>
168-
- <code title="get /fine_tuning/jobs/{fine_tuning_job_id}">client.fine_tuning.jobs.<a href="./src/openai/resources/fine_tuning/jobs.py">retrieve</a>(fine_tuning_job_id) -> <a href="./src/openai/types/fine_tuning/fine_tuning_job.py">FineTuningJob</a></code>
169-
- <code title="get /fine_tuning/jobs">client.fine_tuning.jobs.<a href="./src/openai/resources/fine_tuning/jobs.py">list</a>(\*\*<a href="src/openai/types/fine_tuning/job_list_params.py">params</a>) -> <a href="./src/openai/types/fine_tuning/fine_tuning_job.py">SyncCursorPage[FineTuningJob]</a></code>
170-
- <code title="post /fine_tuning/jobs/{fine_tuning_job_id}/cancel">client.fine_tuning.jobs.<a href="./src/openai/resources/fine_tuning/jobs.py">cancel</a>(fine_tuning_job_id) -> <a href="./src/openai/types/fine_tuning/fine_tuning_job.py">FineTuningJob</a></code>
171-
- <code title="get /fine_tuning/jobs/{fine_tuning_job_id}/events">client.fine_tuning.jobs.<a href="./src/openai/resources/fine_tuning/jobs.py">list_events</a>(fine_tuning_job_id, \*\*<a href="src/openai/types/fine_tuning/job_list_events_params.py">params</a>) -> <a href="./src/openai/types/fine_tuning/fine_tuning_job_event.py">SyncCursorPage[FineTuningJobEvent]</a></code>
189+
- <code title="get /fine_tuning/jobs/{fine_tuning_job_id}/checkpoints">client.fine_tuning.jobs.checkpoints.<a href="./src/openai/resources/fine_tuning/jobs/checkpoints.py">list</a>(fine_tuning_job_id, \*\*<a href="src/openai/types/fine_tuning/jobs/checkpoint_list_params.py">params</a>) -> <a href="./src/openai/types/fine_tuning/jobs/fine_tuning_job_checkpoint.py">SyncCursorPage[FineTuningJobCheckpoint]</a></code>
172190

173191
# Beta
174192

@@ -220,7 +238,15 @@ Methods:
220238
Types:
221239

222240
```python
223-
from openai.types.beta import Thread, ThreadDeleted
241+
from openai.types.beta import (
242+
AssistantResponseFormat,
243+
AssistantResponseFormatOption,
244+
AssistantToolChoice,
245+
AssistantToolChoiceFunction,
246+
AssistantToolChoiceOption,
247+
Thread,
248+
ThreadDeleted,
249+
)
224250
```
225251

226252
Methods:

src/openai/resources/beta/assistants/assistants.py

+51-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import List, Iterable, Optional
5+
from typing import List, Union, Iterable, Optional
66
from typing_extensions import Literal
77

88
import httpx
@@ -57,7 +57,29 @@ def with_streaming_response(self) -> AssistantsWithStreamingResponse:
5757
def create(
5858
self,
5959
*,
60-
model: str,
60+
model: Union[
61+
str,
62+
Literal[
63+
"gpt-4-turbo",
64+
"gpt-4-turbo-2024-04-09",
65+
"gpt-4-0125-preview",
66+
"gpt-4-turbo-preview",
67+
"gpt-4-1106-preview",
68+
"gpt-4-vision-preview",
69+
"gpt-4",
70+
"gpt-4-0314",
71+
"gpt-4-0613",
72+
"gpt-4-32k",
73+
"gpt-4-32k-0314",
74+
"gpt-4-32k-0613",
75+
"gpt-3.5-turbo",
76+
"gpt-3.5-turbo-16k",
77+
"gpt-3.5-turbo-0613",
78+
"gpt-3.5-turbo-1106",
79+
"gpt-3.5-turbo-0125",
80+
"gpt-3.5-turbo-16k-0613",
81+
],
82+
],
6183
description: Optional[str] | NotGiven = NOT_GIVEN,
6284
file_ids: List[str] | NotGiven = NOT_GIVEN,
6385
instructions: Optional[str] | NotGiven = NOT_GIVEN,
@@ -87,7 +109,7 @@ def create(
87109
attached to this assistant. There can be a maximum of 20 files attached to the
88110
assistant. Files are ordered by their creation date in ascending order.
89111
90-
instructions: The system instructions that the assistant uses. The maximum length is 32768
112+
instructions: The system instructions that the assistant uses. The maximum length is 256,000
91113
characters.
92114
93115
metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful
@@ -194,7 +216,7 @@ def update(
194216
file was previously attached to the list but does not show up in the list, it
195217
will be deleted from the assistant.
196218
197-
instructions: The system instructions that the assistant uses. The maximum length is 32768
219+
instructions: The system instructions that the assistant uses. The maximum length is 256,000
198220
characters.
199221
200222
metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful
@@ -360,7 +382,29 @@ def with_streaming_response(self) -> AsyncAssistantsWithStreamingResponse:
360382
async def create(
361383
self,
362384
*,
363-
model: str,
385+
model: Union[
386+
str,
387+
Literal[
388+
"gpt-4-turbo",
389+
"gpt-4-turbo-2024-04-09",
390+
"gpt-4-0125-preview",
391+
"gpt-4-turbo-preview",
392+
"gpt-4-1106-preview",
393+
"gpt-4-vision-preview",
394+
"gpt-4",
395+
"gpt-4-0314",
396+
"gpt-4-0613",
397+
"gpt-4-32k",
398+
"gpt-4-32k-0314",
399+
"gpt-4-32k-0613",
400+
"gpt-3.5-turbo",
401+
"gpt-3.5-turbo-16k",
402+
"gpt-3.5-turbo-0613",
403+
"gpt-3.5-turbo-1106",
404+
"gpt-3.5-turbo-0125",
405+
"gpt-3.5-turbo-16k-0613",
406+
],
407+
],
364408
description: Optional[str] | NotGiven = NOT_GIVEN,
365409
file_ids: List[str] | NotGiven = NOT_GIVEN,
366410
instructions: Optional[str] | NotGiven = NOT_GIVEN,
@@ -390,7 +434,7 @@ async def create(
390434
attached to this assistant. There can be a maximum of 20 files attached to the
391435
assistant. Files are ordered by their creation date in ascending order.
392436
393-
instructions: The system instructions that the assistant uses. The maximum length is 32768
437+
instructions: The system instructions that the assistant uses. The maximum length is 256,000
394438
characters.
395439
396440
metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful
@@ -497,7 +541,7 @@ async def update(
497541
file was previously attached to the list but does not show up in the list, it
498542
will be deleted from the assistant.
499543
500-
instructions: The system instructions that the assistant uses. The maximum length is 32768
544+
instructions: The system instructions that the assistant uses. The maximum length is 256,000
501545
characters.
502546
503547
metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful

0 commit comments

Comments
 (0)