Skip to content

Commit 9a52a66

Browse files
🌿 Fern Regeneration -- August 4, 2025 (#684)
* SDK regeneration * Update ci * Don't cd * Enhance CI workflow to ignore changes in poetry.lock and pyproject.toml for clean working tree checks * Update CI workflow to only fail on relevant changes, ignoring poetry.lock and pyproject.toml * Remove unnecessary set -eu command from CI workflow * Refactor CI workflow to reset poetry changes and improve clean working tree checks * Remove unnecessary directory change in langchain-cohere CI workflow --------- Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Co-authored-by: Billy Trend <[email protected]>
1 parent e47e143 commit 9a52a66

18 files changed

+323
-85
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,18 @@ jobs:
7171
poetry install --with test,test_integration
7272
7373
echo "Going to uninstall cohere package, and install the current version from the repo"
74-
cd ../../../cohere-python && echo "Current dir $(pwd)"
75-
echo "Current dir $(ls)"
76-
pip uninstall cohere
77-
pip install .
78-
cd ../langchain-cohere/libs/cohere
7974
80-
echo "Current cohere installation: $(pip freeze | grep cohere)"
75+
poetry remove cohere
76+
poetry add ../../../cohere-python
77+
78+
echo "Current cohere installation: $(poetry show cohere)"
8179
make test
8280
make integration_test
8381
echo "tests passed"
8482
83+
# reset poetry changes
84+
git checkout -- poetry.lock pyproject.toml
85+
8586
set -eu
8687
8788
STATUS="$(git status)"

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/base_client.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ def chat_stream(
146146
*,
147147
message: str,
148148
accepts: typing.Optional[typing.Literal["text/event-stream"]] = None,
149+
raw_prompting: typing.Optional[bool] = OMIT,
149150
model: typing.Optional[str] = OMIT,
150151
preamble: typing.Optional[str] = OMIT,
151152
chat_history: typing.Optional[typing.Sequence[Message]] = OMIT,
@@ -186,6 +187,12 @@ def chat_stream(
186187
accepts : typing.Optional[typing.Literal["text/event-stream"]]
187188
Pass text/event-stream to receive the streamed response as server-sent events. The default is `\n` delimited events.
188189
190+
raw_prompting : typing.Optional[bool]
191+
When enabled, the user's prompt will be sent to the model without
192+
any pre-processing.
193+
194+
Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments
195+
189196
model : typing.Optional[str]
190197
The name of a compatible [Cohere model](https://docs.cohere.com/docs/models) or the ID of a [fine-tuned](https://docs.cohere.com/docs/chat-fine-tuning) model.
191198
@@ -407,6 +414,7 @@ def chat_stream(
407414
with self._raw_client.chat_stream(
408415
message=message,
409416
accepts=accepts,
417+
raw_prompting=raw_prompting,
410418
model=model,
411419
preamble=preamble,
412420
chat_history=chat_history,
@@ -439,6 +447,7 @@ def chat(
439447
*,
440448
message: str,
441449
accepts: typing.Optional[typing.Literal["text/event-stream"]] = None,
450+
raw_prompting: typing.Optional[bool] = OMIT,
442451
model: typing.Optional[str] = OMIT,
443452
preamble: typing.Optional[str] = OMIT,
444453
chat_history: typing.Optional[typing.Sequence[Message]] = OMIT,
@@ -478,6 +487,12 @@ def chat(
478487
accepts : typing.Optional[typing.Literal["text/event-stream"]]
479488
Pass text/event-stream to receive the streamed response as server-sent events. The default is `\n` delimited events.
480489
490+
raw_prompting : typing.Optional[bool]
491+
When enabled, the user's prompt will be sent to the model without
492+
any pre-processing.
493+
494+
Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments
495+
481496
model : typing.Optional[str]
482497
The name of a compatible [Cohere model](https://docs.cohere.com/docs/models) or the ID of a [fine-tuned](https://docs.cohere.com/docs/chat-fine-tuning) model.
483498
@@ -710,6 +725,7 @@ def chat(
710725
_response = self._raw_client.chat(
711726
message=message,
712727
accepts=accepts,
728+
raw_prompting=raw_prompting,
713729
model=model,
714730
preamble=preamble,
715731
chat_history=chat_history,
@@ -1586,6 +1602,7 @@ async def chat_stream(
15861602
*,
15871603
message: str,
15881604
accepts: typing.Optional[typing.Literal["text/event-stream"]] = None,
1605+
raw_prompting: typing.Optional[bool] = OMIT,
15891606
model: typing.Optional[str] = OMIT,
15901607
preamble: typing.Optional[str] = OMIT,
15911608
chat_history: typing.Optional[typing.Sequence[Message]] = OMIT,
@@ -1626,6 +1643,12 @@ async def chat_stream(
16261643
accepts : typing.Optional[typing.Literal["text/event-stream"]]
16271644
Pass text/event-stream to receive the streamed response as server-sent events. The default is `\n` delimited events.
16281645
1646+
raw_prompting : typing.Optional[bool]
1647+
When enabled, the user's prompt will be sent to the model without
1648+
any pre-processing.
1649+
1650+
Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments
1651+
16291652
model : typing.Optional[str]
16301653
The name of a compatible [Cohere model](https://docs.cohere.com/docs/models) or the ID of a [fine-tuned](https://docs.cohere.com/docs/chat-fine-tuning) model.
16311654
@@ -1855,6 +1878,7 @@ async def main() -> None:
18551878
async with self._raw_client.chat_stream(
18561879
message=message,
18571880
accepts=accepts,
1881+
raw_prompting=raw_prompting,
18581882
model=model,
18591883
preamble=preamble,
18601884
chat_history=chat_history,
@@ -1888,6 +1912,7 @@ async def chat(
18881912
*,
18891913
message: str,
18901914
accepts: typing.Optional[typing.Literal["text/event-stream"]] = None,
1915+
raw_prompting: typing.Optional[bool] = OMIT,
18911916
model: typing.Optional[str] = OMIT,
18921917
preamble: typing.Optional[str] = OMIT,
18931918
chat_history: typing.Optional[typing.Sequence[Message]] = OMIT,
@@ -1927,6 +1952,12 @@ async def chat(
19271952
accepts : typing.Optional[typing.Literal["text/event-stream"]]
19281953
Pass text/event-stream to receive the streamed response as server-sent events. The default is `\n` delimited events.
19291954
1955+
raw_prompting : typing.Optional[bool]
1956+
When enabled, the user's prompt will be sent to the model without
1957+
any pre-processing.
1958+
1959+
Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments
1960+
19301961
model : typing.Optional[str]
19311962
The name of a compatible [Cohere model](https://docs.cohere.com/docs/models) or the ID of a [fine-tuned](https://docs.cohere.com/docs/chat-fine-tuning) model.
19321963
@@ -2167,6 +2198,7 @@ async def main() -> None:
21672198
_response = await self._raw_client.chat(
21682199
message=message,
21692200
accepts=accepts,
2201+
raw_prompting=raw_prompting,
21702202
model=model,
21712203
preamble=preamble,
21722204
chat_history=chat_history,

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

0 commit comments

Comments
 (0)