Skip to content

Commit bb92887

Browse files
🌿 Fern Regeneration -- December 20, 2024 (#624)
* SDK regeneration * Fixes * Update error * Fix CI * ignore type * aws deps --------- Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Co-authored-by: Billy Trend <[email protected]>
1 parent 05fe9e7 commit bb92887

File tree

10 files changed

+172
-1144
lines changed

10 files changed

+172
-1144
lines changed

.github/workflows/ci.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ jobs:
3535
version: 1.5.1
3636
virtualenvs-in-project: false
3737
- name: Install dependencies
38-
run: poetry install --extras aws
38+
run: poetry install
39+
- name: Install aws deps
40+
run: poetry run pip install boto3 sagemaker botocore
3941
- name: Test
4042
run: poetry run pytest .
4143
env:

poetry.lock

+128-1,123
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "cohere"
3-
version = "5.13.3"
3+
version = "5.13.4"
44
description = ""
55
readme = "README.md"
66
authors = []
@@ -32,16 +32,13 @@ Repository = 'https://github.com/cohere-ai/cohere-python'
3232

3333
[tool.poetry.dependencies]
3434
python = "^3.9"
35-
boto3 = { version="^1.34.0", optional = true}
3635
fastavro = "^1.9.4"
3736
httpx = ">=0.21.2"
3837
httpx-sse = "0.4.0"
3938
parameterized = "^0.9.0"
4039
pydantic = ">= 1.9.2"
4140
pydantic-core = "^2.18.2"
4241
requests = "^2.0.0"
43-
sagemaker = { version="^2.232.1", optional = true}
44-
numpy = { version="^1.26", optional = true}
4542
tokenizers = ">=0.15,<1"
4643
types-requests = "^2.0.0"
4744
typing_extensions = ">= 4.0.0"
@@ -69,6 +66,3 @@ line-length = 120
6966
[build-system]
7067
requires = ["poetry-core"]
7168
build-backend = "poetry.core.masonry.api"
72-
73-
[tool.poetry.extras]
74-
aws=["sagemaker", "boto3"]

reference.md

+12-4
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ With `prompt_truncation` set to "AUTO_PRESERVE_ORDER", some elements from `chat_
223223

224224
With `prompt_truncation` set to "OFF", no elements will be dropped. If the sum of the inputs exceeds the model's context length limit, a `TooManyTokens` error will be returned.
225225

226-
Compatible Deployments:
226+
Compatible Deployments:
227227
- AUTO: Cohere Platform Only
228228
- AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments
229229

@@ -537,6 +537,8 @@ Safety modes are not yet configurable in combination with `tools`, `tool_results
537537

538538
**Note**: This parameter is only compatible with models [Command R 08-2024](https://docs.cohere.com/docs/command-r#august-2024-release), [Command R+ 08-2024](https://docs.cohere.com/docs/command-r-plus#august-2024-release) and newer.
539539

540+
**Note**: `command-r7b-12-2024` only supports `"CONTEXTUAL"` and `"STRICT"` modes.
541+
540542
Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments
541543

542544

@@ -708,7 +710,7 @@ With `prompt_truncation` set to "AUTO_PRESERVE_ORDER", some elements from `chat_
708710

709711
With `prompt_truncation` set to "OFF", no elements will be dropped. If the sum of the inputs exceeds the model's context length limit, a `TooManyTokens` error will be returned.
710712

711-
Compatible Deployments:
713+
Compatible Deployments:
712714
- AUTO: Cohere Platform Only
713715
- AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments
714716

@@ -1022,6 +1024,8 @@ Safety modes are not yet configurable in combination with `tools`, `tool_results
10221024

10231025
**Note**: This parameter is only compatible with models [Command R 08-2024](https://docs.cohere.com/docs/command-r#august-2024-release), [Command R+ 08-2024](https://docs.cohere.com/docs/command-r-plus#august-2024-release) and newer.
10241026

1027+
**Note**: `command-r7b-12-2024` only supports `"CONTEXTUAL"` and `"STRICT"` modes.
1028+
10251029
Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments
10261030

10271031

@@ -2431,7 +2435,7 @@ When `tools` is passed (without `tool_results`), the `text` content in the respo
24312435

24322436
**strict_tools:** `typing.Optional[bool]`
24332437

2434-
When set to `true`, tool calls in the Assistant message will be forced to follow the tool definition strictly. Learn more in the [Strict Tools guide](https://docs.cohere.com/docs/structured-outputs-json#structured-outputs-tools).
2438+
When set to `true`, tool calls in the Assistant message will be forced to follow the tool definition strictly. Learn more in the [Structured Outputs (Tools) guide](https://docs.cohere.com/docs/structured-outputs-json#structured-outputs-tools).
24352439

24362440
**Note**: The first few requests with a new set of tools will take longer to process.
24372441

@@ -2476,6 +2480,8 @@ Safety modes are not yet configurable in combination with `tools`, `tool_results
24762480

24772481
**Note**: This parameter is only compatible with models [Command R 08-2024](https://docs.cohere.com/v2/docs/command-r#august-2024-release), [Command R+ 08-2024](https://docs.cohere.com/v2/docs/command-r-plus#august-2024-release) and newer.
24782482

2483+
**Note**: `command-r7b-12-2024` only supports `"CONTEXTUAL"` and `"STRICT"` modes.
2484+
24792485

24802486
</dd>
24812487
</dl>
@@ -2701,7 +2707,7 @@ When `tools` is passed (without `tool_results`), the `text` content in the respo
27012707

27022708
**strict_tools:** `typing.Optional[bool]`
27032709

2704-
When set to `true`, tool calls in the Assistant message will be forced to follow the tool definition strictly. Learn more in the [Strict Tools guide](https://docs.cohere.com/docs/structured-outputs-json#structured-outputs-tools).
2710+
When set to `true`, tool calls in the Assistant message will be forced to follow the tool definition strictly. Learn more in the [Structured Outputs (Tools) guide](https://docs.cohere.com/docs/structured-outputs-json#structured-outputs-tools).
27052711

27062712
**Note**: The first few requests with a new set of tools will take longer to process.
27072713

@@ -2746,6 +2752,8 @@ Safety modes are not yet configurable in combination with `tools`, `tool_results
27462752

27472753
**Note**: This parameter is only compatible with models [Command R 08-2024](https://docs.cohere.com/v2/docs/command-r#august-2024-release), [Command R+ 08-2024](https://docs.cohere.com/v2/docs/command-r-plus#august-2024-release) and newer.
27482754

2755+
**Note**: `command-r7b-12-2024` only supports `"CONTEXTUAL"` and `"STRICT"` modes.
2756+
27492757

27502758
</dd>
27512759
</dl>

src/cohere/base_client.py

+8
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,8 @@ def chat_stream(
423423
424424
**Note**: This parameter is only compatible with models [Command R 08-2024](https://docs.cohere.com/docs/command-r#august-2024-release), [Command R+ 08-2024](https://docs.cohere.com/docs/command-r-plus#august-2024-release) and newer.
425425
426+
**Note**: `command-r7b-12-2024` only supports `"CONTEXTUAL"` and `"STRICT"` modes.
427+
426428
Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments
427429
428430
@@ -974,6 +976,8 @@ def chat(
974976
975977
**Note**: This parameter is only compatible with models [Command R 08-2024](https://docs.cohere.com/docs/command-r#august-2024-release), [Command R+ 08-2024](https://docs.cohere.com/docs/command-r-plus#august-2024-release) and newer.
976978
979+
**Note**: `command-r7b-12-2024` only supports `"CONTEXTUAL"` and `"STRICT"` modes.
980+
977981
Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments
978982
979983
@@ -3418,6 +3422,8 @@ async def chat_stream(
34183422
34193423
**Note**: This parameter is only compatible with models [Command R 08-2024](https://docs.cohere.com/docs/command-r#august-2024-release), [Command R+ 08-2024](https://docs.cohere.com/docs/command-r-plus#august-2024-release) and newer.
34203424
3425+
**Note**: `command-r7b-12-2024` only supports `"CONTEXTUAL"` and `"STRICT"` modes.
3426+
34213427
Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments
34223428
34233429
@@ -3977,6 +3983,8 @@ async def chat(
39773983
39783984
**Note**: This parameter is only compatible with models [Command R 08-2024](https://docs.cohere.com/docs/command-r#august-2024-release), [Command R+ 08-2024](https://docs.cohere.com/docs/command-r-plus#august-2024-release) and newer.
39793985
3986+
**Note**: `command-r7b-12-2024` only supports `"CONTEXTUAL"` and `"STRICT"` modes.
3987+
39803988
Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments
39813989
39823990

src/cohere/core/client_wrapper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def get_headers(self) -> typing.Dict[str, str]:
2424
headers: typing.Dict[str, str] = {
2525
"X-Fern-Language": "Python",
2626
"X-Fern-SDK-Name": "cohere",
27-
"X-Fern-SDK-Version": "5.13.3",
27+
"X-Fern-SDK-Version": "5.13.4",
2828
}
2929
if self._client_name is not None:
3030
headers["X-Client-Name"] = self._client_name
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11

2+
warning = "AWS dependencies are not installed. Please install boto3, botocore, and sagemaker."
23

34
def lazy_sagemaker():
45
try:
56
import sagemaker as sage # type: ignore
67
return sage
78
except ImportError:
8-
raise ImportError("Sagemaker not available. Please install sagemaker.")
9+
raise ImportError(warning)
910

1011
def lazy_boto3():
1112
try:
1213
import boto3 # type: ignore
1314
return boto3
1415
except ImportError:
15-
raise ImportError("Boto3 not available. Please install lazy_boto3().")
16+
raise ImportError(warning)
1617

1718
def lazy_botocore():
1819
try:
1920
import botocore # type: ignore
2021
return botocore
2122
except ImportError:
22-
raise ImportError("Botocore not available. Please install botocore.")
23+
raise ImportError(warning)
2324

src/cohere/types/citation_options.py

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class CitationOptions(UncheckedBaseModel):
1616
"""
1717
Defaults to `"accurate"`.
1818
Dictates the approach taken to generating citations as part of the RAG flow by allowing the user to specify whether they want `"accurate"` results, `"fast"` results or no results.
19+
20+
**Note**: `command-r7b-12-2024` only supports `"fast"` and `"off"` modes. Its default is `"fast"`.
1921
"""
2022

2123
if IS_PYDANTIC_V2:

src/cohere/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def dataset_generator(dataset: Dataset):
274274
if not part.url:
275275
raise ValueError("Dataset part does not have a url")
276276
resp = requests.get(part.url, stream=True)
277-
for record in reader(resp.raw):
277+
for record in reader(resp.raw): # type: ignore
278278
yield record
279279

280280

src/cohere/v2/client.py

+12-4
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def chat_stream(
9292
9393
9494
strict_tools : typing.Optional[bool]
95-
When set to `true`, tool calls in the Assistant message will be forced to follow the tool definition strictly. Learn more in the [Strict Tools guide](https://docs.cohere.com/docs/structured-outputs-json#structured-outputs-tools).
95+
When set to `true`, tool calls in the Assistant message will be forced to follow the tool definition strictly. Learn more in the [Structured Outputs (Tools) guide](https://docs.cohere.com/docs/structured-outputs-json#structured-outputs-tools).
9696
9797
**Note**: The first few requests with a new set of tools will take longer to process.
9898
@@ -113,6 +113,8 @@ def chat_stream(
113113
114114
**Note**: This parameter is only compatible with models [Command R 08-2024](https://docs.cohere.com/v2/docs/command-r#august-2024-release), [Command R+ 08-2024](https://docs.cohere.com/v2/docs/command-r-plus#august-2024-release) and newer.
115115
116+
**Note**: `command-r7b-12-2024` only supports `"CONTEXTUAL"` and `"STRICT"` modes.
117+
116118
117119
max_tokens : typing.Optional[int]
118120
The maximum number of tokens the model will generate as part of the response.
@@ -436,7 +438,7 @@ def chat(
436438
437439
438440
strict_tools : typing.Optional[bool]
439-
When set to `true`, tool calls in the Assistant message will be forced to follow the tool definition strictly. Learn more in the [Strict Tools guide](https://docs.cohere.com/docs/structured-outputs-json#structured-outputs-tools).
441+
When set to `true`, tool calls in the Assistant message will be forced to follow the tool definition strictly. Learn more in the [Structured Outputs (Tools) guide](https://docs.cohere.com/docs/structured-outputs-json#structured-outputs-tools).
440442
441443
**Note**: The first few requests with a new set of tools will take longer to process.
442444
@@ -457,6 +459,8 @@ def chat(
457459
458460
**Note**: This parameter is only compatible with models [Command R 08-2024](https://docs.cohere.com/v2/docs/command-r#august-2024-release), [Command R+ 08-2024](https://docs.cohere.com/v2/docs/command-r-plus#august-2024-release) and newer.
459461
462+
**Note**: `command-r7b-12-2024` only supports `"CONTEXTUAL"` and `"STRICT"` modes.
463+
460464
461465
max_tokens : typing.Optional[int]
462466
The maximum number of tokens the model will generate as part of the response.
@@ -1166,7 +1170,7 @@ async def chat_stream(
11661170
11671171
11681172
strict_tools : typing.Optional[bool]
1169-
When set to `true`, tool calls in the Assistant message will be forced to follow the tool definition strictly. Learn more in the [Strict Tools guide](https://docs.cohere.com/docs/structured-outputs-json#structured-outputs-tools).
1173+
When set to `true`, tool calls in the Assistant message will be forced to follow the tool definition strictly. Learn more in the [Structured Outputs (Tools) guide](https://docs.cohere.com/docs/structured-outputs-json#structured-outputs-tools).
11701174
11711175
**Note**: The first few requests with a new set of tools will take longer to process.
11721176
@@ -1187,6 +1191,8 @@ async def chat_stream(
11871191
11881192
**Note**: This parameter is only compatible with models [Command R 08-2024](https://docs.cohere.com/v2/docs/command-r#august-2024-release), [Command R+ 08-2024](https://docs.cohere.com/v2/docs/command-r-plus#august-2024-release) and newer.
11891193
1194+
**Note**: `command-r7b-12-2024` only supports `"CONTEXTUAL"` and `"STRICT"` modes.
1195+
11901196
11911197
max_tokens : typing.Optional[int]
11921198
The maximum number of tokens the model will generate as part of the response.
@@ -1518,7 +1524,7 @@ async def chat(
15181524
15191525
15201526
strict_tools : typing.Optional[bool]
1521-
When set to `true`, tool calls in the Assistant message will be forced to follow the tool definition strictly. Learn more in the [Strict Tools guide](https://docs.cohere.com/docs/structured-outputs-json#structured-outputs-tools).
1527+
When set to `true`, tool calls in the Assistant message will be forced to follow the tool definition strictly. Learn more in the [Structured Outputs (Tools) guide](https://docs.cohere.com/docs/structured-outputs-json#structured-outputs-tools).
15221528
15231529
**Note**: The first few requests with a new set of tools will take longer to process.
15241530
@@ -1539,6 +1545,8 @@ async def chat(
15391545
15401546
**Note**: This parameter is only compatible with models [Command R 08-2024](https://docs.cohere.com/v2/docs/command-r#august-2024-release), [Command R+ 08-2024](https://docs.cohere.com/v2/docs/command-r-plus#august-2024-release) and newer.
15411547
1548+
**Note**: `command-r7b-12-2024` only supports `"CONTEXTUAL"` and `"STRICT"` modes.
1549+
15421550
15431551
max_tokens : typing.Optional[int]
15441552
The maximum number of tokens the model will generate as part of the response.

0 commit comments

Comments
 (0)