Skip to content

Commit 5aeeaae

Browse files
committed
SDK regeneration
1 parent e47e143 commit 5aeeaae

15 files changed

Lines changed: 252 additions & 79 deletions

poetry.lock

Lines changed: 71 additions & 73 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "cohere"
33

44
[tool.poetry]
55
name = "cohere"
6-
version = "5.16.1"
6+
version = "5.16.2"
77
description = ""
88
readme = "README.md"
99
authors = []

src/cohere/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
ChatContentStartEventDelta,
2828
ChatContentStartEventDeltaMessage,
2929
ChatContentStartEventDeltaMessageContent,
30+
ChatContentStartEventDeltaMessageContentType,
3031
ChatDataMetrics,
3132
ChatDebugEvent,
3233
ChatDocument,
@@ -205,6 +206,7 @@
205206
TextResponseFormatV2,
206207
TextSystemMessageV2ContentItem,
207208
TextToolContent,
209+
ThinkingAssistantMessageResponseContentItem,
208210
TokenizeResponse,
209211
Tool,
210212
ToolCall,
@@ -325,6 +327,7 @@
325327
"ChatContentStartEventDelta",
326328
"ChatContentStartEventDeltaMessage",
327329
"ChatContentStartEventDeltaMessageContent",
330+
"ChatContentStartEventDeltaMessageContentType",
328331
"ChatDataMetrics",
329332
"ChatDebugEvent",
330333
"ChatDocument",
@@ -536,6 +539,7 @@
536539
"TextResponseFormatV2",
537540
"TextSystemMessageV2ContentItem",
538541
"TextToolContent",
542+
"ThinkingAssistantMessageResponseContentItem",
539543
"TokenizeResponse",
540544
"TooManyRequestsError",
541545
"Tool",

src/cohere/core/client_wrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ def __init__(
2222

2323
def get_headers(self) -> typing.Dict[str, str]:
2424
headers: typing.Dict[str, str] = {
25-
"User-Agent": "cohere/5.16.1",
25+
"User-Agent": "cohere/5.16.2",
2626
"X-Fern-Language": "Python",
2727
"X-Fern-SDK-Name": "cohere",
28-
"X-Fern-SDK-Version": "5.16.1",
28+
"X-Fern-SDK-Version": "5.16.2",
2929
}
3030
if self._client_name is not None:
3131
headers["X-Client-Name"] = self._client_name

src/cohere/finetuning/client.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ def list_finetuned_models(
4444
request_options: typing.Optional[RequestOptions] = None,
4545
) -> ListFinetunedModelsResponse:
4646
"""
47+
Returns a list of fine-tuned models that the user has access to.
48+
4749
Parameters
4850
----------
4951
page_size : typing.Optional[int]
@@ -88,6 +90,8 @@ def create_finetuned_model(
8890
self, *, request: FinetunedModel, request_options: typing.Optional[RequestOptions] = None
8991
) -> CreateFinetunedModelResponse:
9092
"""
93+
Creates a new fine-tuned model. The model will be trained on the dataset specified in the request body. The training process may take some time, and the model will be available once the training is complete.
94+
9195
Parameters
9296
----------
9397
request : FinetunedModel
@@ -128,6 +132,8 @@ def get_finetuned_model(
128132
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
129133
) -> GetFinetunedModelResponse:
130134
"""
135+
Retrieve a fine-tuned model by its ID.
136+
131137
Parameters
132138
----------
133139
id : str
@@ -160,6 +166,9 @@ def delete_finetuned_model(
160166
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
161167
) -> DeleteFinetunedModelResponse:
162168
"""
169+
Deletes a fine-tuned model. The model will be removed from the system and will no longer be available for use.
170+
This operation is irreversible.
171+
163172
Parameters
164173
----------
165174
id : str
@@ -198,6 +207,8 @@ def update_finetuned_model(
198207
request_options: typing.Optional[RequestOptions] = None,
199208
) -> UpdateFinetunedModelResponse:
200209
"""
210+
Updates the fine-tuned model with the given ID. The model will be updated with the new settings and name provided in the request body.
211+
201212
Parameters
202213
----------
203214
id : str
@@ -255,6 +266,10 @@ def list_events(
255266
request_options: typing.Optional[RequestOptions] = None,
256267
) -> ListEventsResponse:
257268
"""
269+
Returns a list of events that occurred during the life-cycle of the fine-tuned model.
270+
The events are ordered by creation time, with the most recent event first.
271+
The list can be paginated using `page_size` and `page_token` parameters.
272+
258273
Parameters
259274
----------
260275
finetuned_model_id : str
@@ -313,6 +328,10 @@ def list_training_step_metrics(
313328
request_options: typing.Optional[RequestOptions] = None,
314329
) -> ListTrainingStepMetricsResponse:
315330
"""
331+
Returns a list of metrics measured during the training of a fine-tuned model.
332+
The metrics are ordered by step number, with the most recent step first.
333+
The list can be paginated using `page_size` and `page_token` parameters.
334+
316335
Parameters
317336
----------
318337
finetuned_model_id : str
@@ -375,6 +394,8 @@ async def list_finetuned_models(
375394
request_options: typing.Optional[RequestOptions] = None,
376395
) -> ListFinetunedModelsResponse:
377396
"""
397+
Returns a list of fine-tuned models that the user has access to.
398+
378399
Parameters
379400
----------
380401
page_size : typing.Optional[int]
@@ -427,6 +448,8 @@ async def create_finetuned_model(
427448
self, *, request: FinetunedModel, request_options: typing.Optional[RequestOptions] = None
428449
) -> CreateFinetunedModelResponse:
429450
"""
451+
Creates a new fine-tuned model. The model will be trained on the dataset specified in the request body. The training process may take some time, and the model will be available once the training is complete.
452+
430453
Parameters
431454
----------
432455
request : FinetunedModel
@@ -475,6 +498,8 @@ async def get_finetuned_model(
475498
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
476499
) -> GetFinetunedModelResponse:
477500
"""
501+
Retrieve a fine-tuned model by its ID.
502+
478503
Parameters
479504
----------
480505
id : str
@@ -515,6 +540,9 @@ async def delete_finetuned_model(
515540
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
516541
) -> DeleteFinetunedModelResponse:
517542
"""
543+
Deletes a fine-tuned model. The model will be removed from the system and will no longer be available for use.
544+
This operation is irreversible.
545+
518546
Parameters
519547
----------
520548
id : str
@@ -561,6 +589,8 @@ async def update_finetuned_model(
561589
request_options: typing.Optional[RequestOptions] = None,
562590
) -> UpdateFinetunedModelResponse:
563591
"""
592+
Updates the fine-tuned model with the given ID. The model will be updated with the new settings and name provided in the request body.
593+
564594
Parameters
565595
----------
566596
id : str
@@ -626,6 +656,10 @@ async def list_events(
626656
request_options: typing.Optional[RequestOptions] = None,
627657
) -> ListEventsResponse:
628658
"""
659+
Returns a list of events that occurred during the life-cycle of the fine-tuned model.
660+
The events are ordered by creation time, with the most recent event first.
661+
The list can be paginated using `page_size` and `page_token` parameters.
662+
629663
Parameters
630664
----------
631665
finetuned_model_id : str
@@ -692,6 +726,10 @@ async def list_training_step_metrics(
692726
request_options: typing.Optional[RequestOptions] = None,
693727
) -> ListTrainingStepMetricsResponse:
694728
"""
729+
Returns a list of metrics measured during the training of a fine-tuned model.
730+
The metrics are ordered by step number, with the most recent step first.
731+
The list can be paginated using `page_size` and `page_token` parameters.
732+
695733
Parameters
696734
----------
697735
finetuned_model_id : str

src/cohere/finetuning/raw_client.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ def list_finetuned_models(
4444
request_options: typing.Optional[RequestOptions] = None,
4545
) -> HttpResponse[ListFinetunedModelsResponse]:
4646
"""
47+
Returns a list of fine-tuned models that the user has access to.
48+
4749
Parameters
4850
----------
4951
page_size : typing.Optional[int]
@@ -164,6 +166,8 @@ def create_finetuned_model(
164166
self, *, request: FinetunedModel, request_options: typing.Optional[RequestOptions] = None
165167
) -> HttpResponse[CreateFinetunedModelResponse]:
166168
"""
169+
Creates a new fine-tuned model. The model will be trained on the dataset specified in the request body. The training process may take some time, and the model will be available once the training is complete.
170+
167171
Parameters
168172
----------
169173
request : FinetunedModel
@@ -271,6 +275,8 @@ def get_finetuned_model(
271275
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
272276
) -> HttpResponse[GetFinetunedModelResponse]:
273277
"""
278+
Retrieve a fine-tuned model by its ID.
279+
274280
Parameters
275281
----------
276282
id : str
@@ -374,6 +380,9 @@ def delete_finetuned_model(
374380
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
375381
) -> HttpResponse[DeleteFinetunedModelResponse]:
376382
"""
383+
Deletes a fine-tuned model. The model will be removed from the system and will no longer be available for use.
384+
This operation is irreversible.
385+
377386
Parameters
378387
----------
379388
id : str
@@ -483,6 +492,8 @@ def update_finetuned_model(
483492
request_options: typing.Optional[RequestOptions] = None,
484493
) -> HttpResponse[UpdateFinetunedModelResponse]:
485494
"""
495+
Updates the fine-tuned model with the given ID. The model will be updated with the new settings and name provided in the request body.
496+
486497
Parameters
487498
----------
488499
id : str
@@ -612,6 +623,10 @@ def list_events(
612623
request_options: typing.Optional[RequestOptions] = None,
613624
) -> HttpResponse[ListEventsResponse]:
614625
"""
626+
Returns a list of events that occurred during the life-cycle of the fine-tuned model.
627+
The events are ordered by creation time, with the most recent event first.
628+
The list can be paginated using `page_size` and `page_token` parameters.
629+
615630
Parameters
616631
----------
617632
finetuned_model_id : str
@@ -740,6 +755,10 @@ def list_training_step_metrics(
740755
request_options: typing.Optional[RequestOptions] = None,
741756
) -> HttpResponse[ListTrainingStepMetricsResponse]:
742757
"""
758+
Returns a list of metrics measured during the training of a fine-tuned model.
759+
The metrics are ordered by step number, with the most recent step first.
760+
The list can be paginated using `page_size` and `page_token` parameters.
761+
743762
Parameters
744763
----------
745764
finetuned_model_id : str
@@ -864,6 +883,8 @@ async def list_finetuned_models(
864883
request_options: typing.Optional[RequestOptions] = None,
865884
) -> AsyncHttpResponse[ListFinetunedModelsResponse]:
866885
"""
886+
Returns a list of fine-tuned models that the user has access to.
887+
867888
Parameters
868889
----------
869890
page_size : typing.Optional[int]
@@ -984,6 +1005,8 @@ async def create_finetuned_model(
9841005
self, *, request: FinetunedModel, request_options: typing.Optional[RequestOptions] = None
9851006
) -> AsyncHttpResponse[CreateFinetunedModelResponse]:
9861007
"""
1008+
Creates a new fine-tuned model. The model will be trained on the dataset specified in the request body. The training process may take some time, and the model will be available once the training is complete.
1009+
9871010
Parameters
9881011
----------
9891012
request : FinetunedModel
@@ -1091,6 +1114,8 @@ async def get_finetuned_model(
10911114
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
10921115
) -> AsyncHttpResponse[GetFinetunedModelResponse]:
10931116
"""
1117+
Retrieve a fine-tuned model by its ID.
1118+
10941119
Parameters
10951120
----------
10961121
id : str
@@ -1194,6 +1219,9 @@ async def delete_finetuned_model(
11941219
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
11951220
) -> AsyncHttpResponse[DeleteFinetunedModelResponse]:
11961221
"""
1222+
Deletes a fine-tuned model. The model will be removed from the system and will no longer be available for use.
1223+
This operation is irreversible.
1224+
11971225
Parameters
11981226
----------
11991227
id : str
@@ -1303,6 +1331,8 @@ async def update_finetuned_model(
13031331
request_options: typing.Optional[RequestOptions] = None,
13041332
) -> AsyncHttpResponse[UpdateFinetunedModelResponse]:
13051333
"""
1334+
Updates the fine-tuned model with the given ID. The model will be updated with the new settings and name provided in the request body.
1335+
13061336
Parameters
13071337
----------
13081338
id : str
@@ -1432,6 +1462,10 @@ async def list_events(
14321462
request_options: typing.Optional[RequestOptions] = None,
14331463
) -> AsyncHttpResponse[ListEventsResponse]:
14341464
"""
1465+
Returns a list of events that occurred during the life-cycle of the fine-tuned model.
1466+
The events are ordered by creation time, with the most recent event first.
1467+
The list can be paginated using `page_size` and `page_token` parameters.
1468+
14351469
Parameters
14361470
----------
14371471
finetuned_model_id : str
@@ -1560,6 +1594,10 @@ async def list_training_step_metrics(
15601594
request_options: typing.Optional[RequestOptions] = None,
15611595
) -> AsyncHttpResponse[ListTrainingStepMetricsResponse]:
15621596
"""
1597+
Returns a list of metrics measured during the training of a fine-tuned model.
1598+
The metrics are ordered by step number, with the most recent step first.
1599+
The list can be paginated using `page_size` and `page_token` parameters.
1600+
15631601
Parameters
15641602
----------
15651603
finetuned_model_id : str

src/cohere/types/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from .assistant_message_response_content_item import (
1212
AssistantMessageResponseContentItem,
1313
TextAssistantMessageResponseContentItem,
14+
ThinkingAssistantMessageResponseContentItem,
1415
)
1516
from .assistant_message_v2content import AssistantMessageV2Content
1617
from .assistant_message_v2content_item import AssistantMessageV2ContentItem, TextAssistantMessageV2ContentItem
@@ -28,6 +29,7 @@
2829
from .chat_content_start_event_delta import ChatContentStartEventDelta
2930
from .chat_content_start_event_delta_message import ChatContentStartEventDeltaMessage
3031
from .chat_content_start_event_delta_message_content import ChatContentStartEventDeltaMessageContent
32+
from .chat_content_start_event_delta_message_content_type import ChatContentStartEventDeltaMessageContentType
3133
from .chat_data_metrics import ChatDataMetrics
3234
from .chat_debug_event import ChatDebugEvent
3335
from .chat_document import ChatDocument
@@ -248,6 +250,7 @@
248250
"ChatContentStartEventDelta",
249251
"ChatContentStartEventDeltaMessage",
250252
"ChatContentStartEventDeltaMessageContent",
253+
"ChatContentStartEventDeltaMessageContentType",
251254
"ChatDataMetrics",
252255
"ChatDebugEvent",
253256
"ChatDocument",
@@ -426,6 +429,7 @@
426429
"TextResponseFormatV2",
427430
"TextSystemMessageV2ContentItem",
428431
"TextToolContent",
432+
"ThinkingAssistantMessageResponseContentItem",
429433
"TokenizeResponse",
430434
"Tool",
431435
"ToolCall",

src/cohere/types/assistant_message_response_content_item.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@ class Config:
2323
extra = pydantic.Extra.allow
2424

2525

26+
class ThinkingAssistantMessageResponseContentItem(UncheckedBaseModel):
27+
value: typing.Optional[typing.Any] = None
28+
type: typing.Literal["thinking"] = "thinking"
29+
30+
if not IS_PYDANTIC_V2:
31+
32+
class Config:
33+
smart_union = True
34+
35+
2636
AssistantMessageResponseContentItem = typing_extensions.Annotated[
27-
TextAssistantMessageResponseContentItem, UnionMetadata(discriminant="type")
37+
typing.Union[TextAssistantMessageResponseContentItem, ThinkingAssistantMessageResponseContentItem],
38+
UnionMetadata(discriminant="type"),
2839
]

src/cohere/types/chat_content_start_event_delta_message_content.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
import pydantic
66
from ..core.pydantic_utilities import IS_PYDANTIC_V2
77
from ..core.unchecked_base_model import UncheckedBaseModel
8+
from .chat_content_start_event_delta_message_content_type import ChatContentStartEventDeltaMessageContentType
89

910

1011
class ChatContentStartEventDeltaMessageContent(UncheckedBaseModel):
1112
text: typing.Optional[str] = None
12-
type: typing.Optional[typing.Literal["text"]] = None
13+
type: typing.Optional[ChatContentStartEventDeltaMessageContentType] = None
1314

1415
if IS_PYDANTIC_V2:
1516
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
import typing
4+
5+
ChatContentStartEventDeltaMessageContentType = typing.Union[typing.Literal["text", "thinking"], typing.Any]

0 commit comments

Comments
 (0)