From 349c5ab805d904c436b923ffa10a001b2f31bae9 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:52:28 -0500 Subject: [PATCH] :herb: Fern Regeneration -- September 25, 2024 (#587) * SDK regeneration * Fixes --------- Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Co-authored-by: Billy Trend --- poetry.lock | 20 +++++++++---------- pyproject.toml | 2 +- reference.md | 5 ++--- src/cohere/__init__.py | 4 ++-- src/cohere/core/client_wrapper.py | 2 +- src/cohere/types/__init__.py | 4 ++-- src/cohere/types/chat_message_v2.py | 4 ++-- src/cohere/types/document.py | 2 +- src/cohere/types/tool_message_v2.py | 6 +++--- ...l_content.py => tool_message_v2content.py} | 2 +- src/cohere/v2/client.py | 10 ++++------ .../v2/types/v2chat_request_safety_mode.py | 2 +- .../v2chat_stream_request_safety_mode.py | 2 +- 13 files changed, 31 insertions(+), 34 deletions(-) rename src/cohere/types/{tool_message_v2tool_content.py => tool_message_v2content.py} (62%) diff --git a/poetry.lock b/poetry.lock index 49a511b27..4941469a3 100644 --- a/poetry.lock +++ b/poetry.lock @@ -38,17 +38,17 @@ trio = ["trio (>=0.26.1)"] [[package]] name = "boto3" -version = "1.35.22" +version = "1.35.27" description = "The AWS SDK for Python" optional = false python-versions = ">=3.8" files = [ - {file = "boto3-1.35.22-py3-none-any.whl", hash = "sha256:2109b632b451c1d4347a93a9abe6dc866c03db4ff1f910597f4543f1965829de"}, - {file = "boto3-1.35.22.tar.gz", hash = "sha256:8f4f6e0860ca1b18cbb8d13f3a572a4c099577e741b10205b5604058af0e75b7"}, + {file = "boto3-1.35.27-py3-none-any.whl", hash = "sha256:3da139ca038032e92086e26d23833b557f0c257520162bfd3d6f580bf8032c86"}, + {file = "boto3-1.35.27.tar.gz", hash = "sha256:10d0fe15670b83a3f26572ab20d9152a064cee4c54b5ea9a1eeb1f0c3b807a7b"}, ] [package.dependencies] -botocore = ">=1.35.22,<1.36.0" +botocore = ">=1.35.27,<1.36.0" jmespath = ">=0.7.1,<2.0.0" s3transfer = ">=0.10.0,<0.11.0" @@ -57,13 +57,13 @@ crt = ["botocore[crt] (>=1.21.0,<2.0a0)"] [[package]] name = "botocore" -version = "1.35.22" +version = "1.35.27" description = "Low-level, data-driven core of boto 3." optional = false python-versions = ">=3.8" files = [ - {file = "botocore-1.35.22-py3-none-any.whl", hash = "sha256:d9bc656e7dde0b3e3f3080fc54bacff6a97fd7806b98acbcc21c7f9d4d0102b9"}, - {file = "botocore-1.35.22.tar.gz", hash = "sha256:18362b7ec748561d786aebf1dd5c9faf22c4732efbf89344314199f96d3bbb65"}, + {file = "botocore-1.35.27-py3-none-any.whl", hash = "sha256:c299c70b5330a8634e032883ce8a72c2c6d9fdbc985d8191199cb86b92e7cbbd"}, + {file = "botocore-1.35.27.tar.gz", hash = "sha256:f68875c26cd57a9d22c0f7a981ecb1636d7ce4d0e35797e04765b53e7bfed3e7"}, ] [package.dependencies] @@ -383,13 +383,13 @@ files = [ [[package]] name = "huggingface-hub" -version = "0.25.0" +version = "0.25.1" description = "Client library to download and publish models, datasets and other repos on the huggingface.co hub" optional = false python-versions = ">=3.8.0" files = [ - {file = "huggingface_hub-0.25.0-py3-none-any.whl", hash = "sha256:e2f357b35d72d5012cfd127108c4e14abcd61ba4ebc90a5a374dc2456cb34e12"}, - {file = "huggingface_hub-0.25.0.tar.gz", hash = "sha256:fb5fbe6c12fcd99d187ec7db95db9110fb1a20505f23040a5449a717c1a0db4d"}, + {file = "huggingface_hub-0.25.1-py3-none-any.whl", hash = "sha256:a5158ded931b3188f54ea9028097312cb0acd50bffaaa2612014c3c526b44972"}, + {file = "huggingface_hub-0.25.1.tar.gz", hash = "sha256:9ff7cb327343211fbd06e2b149b8f362fd1e389454f3f14c6db75a4999ee20ff"}, ] [package.dependencies] diff --git a/pyproject.toml b/pyproject.toml index 973e48de1..fe2fc4191 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cohere" -version = "5.9.4" +version = "5.10.0" description = "" readme = "README.md" authors = [] diff --git a/reference.md b/reference.md index 95ebe505b..410686983 100644 --- a/reference.md +++ b/reference.md @@ -2453,7 +2453,7 @@ When `tools` is passed (without `tool_results`), the `text` content in the respo **safety_mode:** `typing.Optional[V2ChatStreamRequestSafetyMode]` Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`. -When `NONE` is specified, the safety instruction will be omitted. +When `OFF` is specified, the safety instruction will be omitted. Safety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters. @@ -2621,7 +2621,6 @@ client.v2.chat( messages=[ ToolChatMessageV2( tool_call_id="messages", - tool_content="messages", ) ], ) @@ -2697,7 +2696,7 @@ When `tools` is passed (without `tool_results`), the `text` content in the respo **safety_mode:** `typing.Optional[V2ChatRequestSafetyMode]` Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`. -When `NONE` is specified, the safety instruction will be omitted. +When `OFF` is specified, the safety instruction will be omitted. Safety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters. diff --git a/src/cohere/__init__.py b/src/cohere/__init__.py index eef186d88..f5cc2e61a 100644 --- a/src/cohere/__init__.py +++ b/src/cohere/__init__.py @@ -209,7 +209,7 @@ ToolContent, ToolMessage, ToolMessageV2, - ToolMessageV2ToolContent, + ToolMessageV2Content, ToolParameterDefinitionsValue, ToolPlanDeltaStreamedChatResponseV2, ToolResult, @@ -498,7 +498,7 @@ "ToolContent", "ToolMessage", "ToolMessageV2", - "ToolMessageV2ToolContent", + "ToolMessageV2Content", "ToolParameterDefinitionsValue", "ToolPlanDeltaStreamedChatResponseV2", "ToolResult", diff --git a/src/cohere/core/client_wrapper.py b/src/cohere/core/client_wrapper.py index 7d323ab41..bad0ef86f 100644 --- a/src/cohere/core/client_wrapper.py +++ b/src/cohere/core/client_wrapper.py @@ -24,7 +24,7 @@ def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { "X-Fern-Language": "Python", "X-Fern-SDK-Name": "cohere", - "X-Fern-SDK-Version": "5.9.4", + "X-Fern-SDK-Version": "5.10.0", } if self._client_name is not None: headers["X-Client-Name"] = self._client_name diff --git a/src/cohere/types/__init__.py b/src/cohere/types/__init__.py index c52476d30..4f000ecf9 100644 --- a/src/cohere/types/__init__.py +++ b/src/cohere/types/__init__.py @@ -207,7 +207,7 @@ from .tool_call_v2function import ToolCallV2Function from .tool_content import DocumentToolContent, TextToolContent, ToolContent from .tool_message_v2 import ToolMessageV2 -from .tool_message_v2tool_content import ToolMessageV2ToolContent +from .tool_message_v2content import ToolMessageV2Content from .tool_parameter_definitions_value import ToolParameterDefinitionsValue from .tool_result import ToolResult from .tool_v2 import ToolV2 @@ -428,7 +428,7 @@ "ToolContent", "ToolMessage", "ToolMessageV2", - "ToolMessageV2ToolContent", + "ToolMessageV2Content", "ToolParameterDefinitionsValue", "ToolPlanDeltaStreamedChatResponseV2", "ToolResult", diff --git a/src/cohere/types/chat_message_v2.py b/src/cohere/types/chat_message_v2.py index b26258010..5b2965bb5 100644 --- a/src/cohere/types/chat_message_v2.py +++ b/src/cohere/types/chat_message_v2.py @@ -10,7 +10,7 @@ from .assistant_message_content import AssistantMessageContent from .citation import Citation from .system_message_content import SystemMessageContent -from .tool_message_v2tool_content import ToolMessageV2ToolContent +from .tool_message_v2content import ToolMessageV2Content import typing_extensions from ..core.unchecked_base_model import UnionMetadata @@ -79,7 +79,7 @@ class ToolChatMessageV2(UncheckedBaseModel): role: typing.Literal["tool"] = "tool" tool_call_id: str - tool_content: ToolMessageV2ToolContent + content: typing.Optional[ToolMessageV2Content] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/cohere/types/document.py b/src/cohere/types/document.py index a089622ea..d9e46eaa7 100644 --- a/src/cohere/types/document.py +++ b/src/cohere/types/document.py @@ -20,7 +20,7 @@ class Document(UncheckedBaseModel): id: typing.Optional[str] = pydantic.Field(default=None) """ - Unique identifier for this document which will be referenced in citations. If not provided an ID will be automatically generated + Unique identifier for this document which will be referenced in citations. If not provided an ID will be automatically generated. """ if IS_PYDANTIC_V2: diff --git a/src/cohere/types/tool_message_v2.py b/src/cohere/types/tool_message_v2.py index 8040a3c4c..7983308d1 100644 --- a/src/cohere/types/tool_message_v2.py +++ b/src/cohere/types/tool_message_v2.py @@ -2,9 +2,9 @@ from ..core.unchecked_base_model import UncheckedBaseModel import pydantic -from .tool_message_v2tool_content import ToolMessageV2ToolContent -from ..core.pydantic_utilities import IS_PYDANTIC_V2 import typing +from .tool_message_v2content import ToolMessageV2Content +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class ToolMessageV2(UncheckedBaseModel): @@ -17,7 +17,7 @@ class ToolMessageV2(UncheckedBaseModel): The id of the associated tool call that has provided the given content """ - tool_content: ToolMessageV2ToolContent = pydantic.Field() + content: typing.Optional[ToolMessageV2Content] = pydantic.Field(default=None) """ A single or list of outputs from a tool. The content should formatted as a JSON object string, or a list of tool content blocks """ diff --git a/src/cohere/types/tool_message_v2tool_content.py b/src/cohere/types/tool_message_v2content.py similarity index 62% rename from src/cohere/types/tool_message_v2tool_content.py rename to src/cohere/types/tool_message_v2content.py index e6d5655b4..6022cd3dc 100644 --- a/src/cohere/types/tool_message_v2tool_content.py +++ b/src/cohere/types/tool_message_v2content.py @@ -3,4 +3,4 @@ import typing from .tool_content import ToolContent -ToolMessageV2ToolContent = typing.Union[str, typing.List[ToolContent]] +ToolMessageV2Content = typing.Union[str, typing.List[ToolContent]] diff --git a/src/cohere/v2/client.py b/src/cohere/v2/client.py index a462ca464..79d36ee03 100644 --- a/src/cohere/v2/client.py +++ b/src/cohere/v2/client.py @@ -98,7 +98,7 @@ def chat_stream( safety_mode : typing.Optional[V2ChatStreamRequestSafetyMode] Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`. - When `NONE` is specified, the safety instruction will be omitted. + When `OFF` is specified, the safety instruction will be omitted. Safety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters. @@ -424,7 +424,7 @@ def chat( safety_mode : typing.Optional[V2ChatRequestSafetyMode] Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`. - When `NONE` is specified, the safety instruction will be omitted. + When `OFF` is specified, the safety instruction will be omitted. Safety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters. @@ -500,7 +500,6 @@ def chat( messages=[ ToolChatMessageV2( tool_call_id="messages", - tool_content="messages", ) ], ) @@ -1143,7 +1142,7 @@ async def chat_stream( safety_mode : typing.Optional[V2ChatStreamRequestSafetyMode] Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`. - When `NONE` is specified, the safety instruction will be omitted. + When `OFF` is specified, the safety instruction will be omitted. Safety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters. @@ -1477,7 +1476,7 @@ async def chat( safety_mode : typing.Optional[V2ChatRequestSafetyMode] Used to select the [safety instruction](/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`. - When `NONE` is specified, the safety instruction will be omitted. + When `OFF` is specified, the safety instruction will be omitted. Safety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters. @@ -1558,7 +1557,6 @@ async def main() -> None: messages=[ ToolChatMessageV2( tool_call_id="messages", - tool_content="messages", ) ], ) diff --git a/src/cohere/v2/types/v2chat_request_safety_mode.py b/src/cohere/v2/types/v2chat_request_safety_mode.py index c1428db81..2d6a00eb2 100644 --- a/src/cohere/v2/types/v2chat_request_safety_mode.py +++ b/src/cohere/v2/types/v2chat_request_safety_mode.py @@ -2,4 +2,4 @@ import typing -V2ChatRequestSafetyMode = typing.Union[typing.Literal["CONTEXTUAL", "STRICT", "NONE"], typing.Any] +V2ChatRequestSafetyMode = typing.Union[typing.Literal["CONTEXTUAL", "STRICT", "OFF"], typing.Any] diff --git a/src/cohere/v2/types/v2chat_stream_request_safety_mode.py b/src/cohere/v2/types/v2chat_stream_request_safety_mode.py index 7c5f310e3..9eb9cc536 100644 --- a/src/cohere/v2/types/v2chat_stream_request_safety_mode.py +++ b/src/cohere/v2/types/v2chat_stream_request_safety_mode.py @@ -2,4 +2,4 @@ import typing -V2ChatStreamRequestSafetyMode = typing.Union[typing.Literal["CONTEXTUAL", "STRICT", "NONE"], typing.Any] +V2ChatStreamRequestSafetyMode = typing.Union[typing.Literal["CONTEXTUAL", "STRICT", "OFF"], typing.Any]