diff --git a/poetry.lock b/poetry.lock index 34be305b4..3c68dc09e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -211,20 +211,15 @@ zstandard = ["zstandard"] [[package]] name = "filelock" -version = "3.18.0" +version = "3.19.1" description = "A platform independent file lock." optional = false python-versions = ">=3.9" files = [ - {file = "filelock-3.18.0-py3-none-any.whl", hash = "sha256:c401f4f8377c4464e6db25fff06205fd89bdd83b65eb0488ed1b160f780e21de"}, - {file = "filelock-3.18.0.tar.gz", hash = "sha256:adbc88eabb99d2fec8c9c1b229b171f18afa655400173ddc653d5d01501fb9f2"}, + {file = "filelock-3.19.1-py3-none-any.whl", hash = "sha256:d38e30481def20772f5baf097c122c3babc4fcdb7e14e57049eb9d88c6dc017d"}, + {file = "filelock-3.19.1.tar.gz", hash = "sha256:66eda1888b0171c998b35be2bcc0f6d75c388a7ce20c3f3f37aa8e96c2dddf58"}, ] -[package.extras] -docs = ["furo (>=2024.8.6)", "sphinx (>=8.1.3)", "sphinx-autodoc-typehints (>=3)"] -testing = ["covdefaults (>=2.3)", "coverage (>=7.6.10)", "diff-cover (>=9.2.1)", "pytest (>=8.3.4)", "pytest-asyncio (>=0.25.2)", "pytest-cov (>=6)", "pytest-mock (>=3.14)", "pytest-timeout (>=2.3.1)", "virtualenv (>=20.28.1)"] -typing = ["typing-extensions (>=4.12.2)"] - [[package]] name = "fsspec" version = "2025.7.0" @@ -277,19 +272,19 @@ files = [ [[package]] name = "hf-xet" -version = "1.1.7" +version = "1.1.9" description = "Fast transfer of large files with the Hugging Face Hub." optional = false python-versions = ">=3.8" files = [ - {file = "hf_xet-1.1.7-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:60dae4b44d520819e54e216a2505685248ec0adbdb2dd4848b17aa85a0375cde"}, - {file = "hf_xet-1.1.7-cp37-abi3-macosx_11_0_arm64.whl", hash = "sha256:b109f4c11e01c057fc82004c9e51e6cdfe2cb230637644ade40c599739067b2e"}, - {file = "hf_xet-1.1.7-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6efaaf1a5a9fc3a501d3e71e88a6bfebc69ee3a716d0e713a931c8b8d920038f"}, - {file = "hf_xet-1.1.7-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:751571540f9c1fbad9afcf222a5fb96daf2384bf821317b8bfb0c59d86078513"}, - {file = "hf_xet-1.1.7-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:18b61bbae92d56ae731b92087c44efcac216071182c603fc535f8e29ec4b09b8"}, - {file = "hf_xet-1.1.7-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:713f2bff61b252f8523739969f247aa354ad8e6d869b8281e174e2ea1bb8d604"}, - {file = "hf_xet-1.1.7-cp37-abi3-win_amd64.whl", hash = "sha256:2e356da7d284479ae0f1dea3cf5a2f74fdf925d6dca84ac4341930d892c7cb34"}, - {file = "hf_xet-1.1.7.tar.gz", hash = "sha256:20cec8db4561338824a3b5f8c19774055b04a8df7fff0cb1ff2cb1a0c1607b80"}, + {file = "hf_xet-1.1.9-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:a3b6215f88638dd7a6ff82cb4e738dcbf3d863bf667997c093a3c990337d1160"}, + {file = "hf_xet-1.1.9-cp37-abi3-macosx_11_0_arm64.whl", hash = "sha256:9b486de7a64a66f9a172f4b3e0dfe79c9f0a93257c501296a2521a13495a698a"}, + {file = "hf_xet-1.1.9-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a4c5a840c2c4e6ec875ed13703a60e3523bc7f48031dfd750923b2a4d1a5fc3c"}, + {file = "hf_xet-1.1.9-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:96a6139c9e44dad1c52c52520db0fffe948f6bce487cfb9d69c125f254bb3790"}, + {file = "hf_xet-1.1.9-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:ad1022e9a998e784c97b2173965d07fe33ee26e4594770b7785a8cc8f922cd95"}, + {file = "hf_xet-1.1.9-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:86754c2d6d5afb11b0a435e6e18911a4199262fe77553f8c50d75e21242193ea"}, + {file = "hf_xet-1.1.9-cp37-abi3-win_amd64.whl", hash = "sha256:5aad3933de6b725d61d51034e04174ed1dce7a57c63d530df0014dea15a40127"}, + {file = "hf_xet-1.1.9.tar.gz", hash = "sha256:c99073ce404462e909f1d5839b2d14a3827b8fe75ed8aed551ba6609c026c803"}, ] [package.extras] @@ -754,13 +749,13 @@ files = [ [[package]] name = "requests" -version = "2.32.4" +version = "2.32.5" description = "Python HTTP for Humans." optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "requests-2.32.4-py3-none-any.whl", hash = "sha256:27babd3cda2a6d50b30443204ee89830707d396671944c998b5975b031ac2b2c"}, - {file = "requests-2.32.4.tar.gz", hash = "sha256:27d0316682c8a29834d3264820024b62a36942083d52caf2f14c0591336d3422"}, + {file = "requests-2.32.5-py3-none-any.whl", hash = "sha256:2462f94637a34fd532264295e186976db0f5d453d1cdd31473c85a6a161affb6"}, + {file = "requests-2.32.5.tar.gz", hash = "sha256:dbba0bac56e100853db0ea71b82b4dfd5fe2bf6d3754a8893c3af500cec7d7cf"}, ] [package.dependencies] @@ -824,26 +819,26 @@ files = [ [[package]] name = "tokenizers" -version = "0.21.4" +version = "0.22.0" description = "" optional = false python-versions = ">=3.9" files = [ - {file = "tokenizers-0.21.4-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:2ccc10a7c3bcefe0f242867dc914fc1226ee44321eb618cfe3019b5df3400133"}, - {file = "tokenizers-0.21.4-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:5e2f601a8e0cd5be5cc7506b20a79112370b9b3e9cb5f13f68ab11acd6ca7d60"}, - {file = "tokenizers-0.21.4-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:39b376f5a1aee67b4d29032ee85511bbd1b99007ec735f7f35c8a2eb104eade5"}, - {file = "tokenizers-0.21.4-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2107ad649e2cda4488d41dfd031469e9da3fcbfd6183e74e4958fa729ffbf9c6"}, - {file = "tokenizers-0.21.4-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3c73012da95afafdf235ba80047699df4384fdc481527448a078ffd00e45a7d9"}, - {file = "tokenizers-0.21.4-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f23186c40395fc390d27f519679a58023f368a0aad234af145e0f39ad1212732"}, - {file = "tokenizers-0.21.4-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cc88bb34e23a54cc42713d6d98af5f1bf79c07653d24fe984d2d695ba2c922a2"}, - {file = "tokenizers-0.21.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:51b7eabb104f46c1c50b486520555715457ae833d5aee9ff6ae853d1130506ff"}, - {file = "tokenizers-0.21.4-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:714b05b2e1af1288bd1bc56ce496c4cebb64a20d158ee802887757791191e6e2"}, - {file = "tokenizers-0.21.4-cp39-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:1340ff877ceedfa937544b7d79f5b7becf33a4cfb58f89b3b49927004ef66f78"}, - {file = "tokenizers-0.21.4-cp39-abi3-musllinux_1_2_i686.whl", hash = "sha256:3c1f4317576e465ac9ef0d165b247825a2a4078bcd01cba6b54b867bdf9fdd8b"}, - {file = "tokenizers-0.21.4-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:c212aa4e45ec0bb5274b16b6f31dd3f1c41944025c2358faaa5782c754e84c24"}, - {file = "tokenizers-0.21.4-cp39-abi3-win32.whl", hash = "sha256:6c42a930bc5f4c47f4ea775c91de47d27910881902b0f20e4990ebe045a415d0"}, - {file = "tokenizers-0.21.4-cp39-abi3-win_amd64.whl", hash = "sha256:475d807a5c3eb72c59ad9b5fcdb254f6e17f53dfcbb9903233b0dfa9c943b597"}, - {file = "tokenizers-0.21.4.tar.gz", hash = "sha256:fa23f85fbc9a02ec5c6978da172cdcbac23498c3ca9f3645c5c68740ac007880"}, + {file = "tokenizers-0.22.0-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:eaa9620122a3fb99b943f864af95ed14c8dfc0f47afa3b404ac8c16b3f2bb484"}, + {file = "tokenizers-0.22.0-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:71784b9ab5bf0ff3075bceeb198149d2c5e068549c0d18fe32d06ba0deb63f79"}, + {file = "tokenizers-0.22.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ec5b71f668a8076802b0241a42387d48289f25435b86b769ae1837cad4172a17"}, + {file = "tokenizers-0.22.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ea8562fa7498850d02a16178105b58803ea825b50dc9094d60549a7ed63654bb"}, + {file = "tokenizers-0.22.0-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4136e1558a9ef2e2f1de1555dcd573e1cbc4a320c1a06c4107a3d46dc8ac6e4b"}, + {file = "tokenizers-0.22.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cdf5954de3962a5fd9781dc12048d24a1a6f1f5df038c6e95db328cd22964206"}, + {file = "tokenizers-0.22.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8337ca75d0731fc4860e6204cc24bb36a67d9736142aa06ed320943b50b1e7ed"}, + {file = "tokenizers-0.22.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a89264e26f63c449d8cded9061adea7b5de53ba2346fc7e87311f7e4117c1cc8"}, + {file = "tokenizers-0.22.0-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:790bad50a1b59d4c21592f9c3cf5e5cf9c3c7ce7e1a23a739f13e01fb1be377a"}, + {file = "tokenizers-0.22.0-cp39-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:76cf6757c73a10ef10bf06fa937c0ec7393d90432f543f49adc8cab3fb6f26cb"}, + {file = "tokenizers-0.22.0-cp39-abi3-musllinux_1_2_i686.whl", hash = "sha256:1626cb186e143720c62c6c6b5371e62bbc10af60481388c0da89bc903f37ea0c"}, + {file = "tokenizers-0.22.0-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:da589a61cbfea18ae267723d6b029b84598dc8ca78db9951d8f5beff72d8507c"}, + {file = "tokenizers-0.22.0-cp39-abi3-win32.whl", hash = "sha256:dbf9d6851bddae3e046fedfb166f47743c1c7bd11c640f0691dd35ef0bcad3be"}, + {file = "tokenizers-0.22.0-cp39-abi3-win_amd64.whl", hash = "sha256:c78174859eeaee96021f248a56c801e36bfb6bd5b067f2e95aa82445ca324f00"}, + {file = "tokenizers-0.22.0.tar.gz", hash = "sha256:2e33b98525be8453f355927f3cab312c36cd3e44f4d7e9e97da2fa94d0a49dcb"}, ] [package.dependencies] @@ -852,7 +847,7 @@ huggingface-hub = ">=0.16.4,<1.0" [package.extras] dev = ["tokenizers[testing]"] docs = ["setuptools-rust", "sphinx", "sphinx-rtd-theme"] -testing = ["black (==22.3)", "datasets", "numpy", "pytest", "requests", "ruff"] +testing = ["black (==22.3)", "datasets", "numpy", "pytest", "pytest-asyncio", "requests", "ruff"] [[package]] name = "tomli" @@ -918,13 +913,13 @@ telegram = ["requests"] [[package]] name = "types-python-dateutil" -version = "2.9.0.20250809" +version = "2.9.0.20250822" description = "Typing stubs for python-dateutil" optional = false python-versions = ">=3.9" files = [ - {file = "types_python_dateutil-2.9.0.20250809-py3-none-any.whl", hash = "sha256:768890cac4f2d7fd9e0feb6f3217fce2abbfdfc0cadd38d11fba325a815e4b9f"}, - {file = "types_python_dateutil-2.9.0.20250809.tar.gz", hash = "sha256:69cbf8d15ef7a75c3801d65d63466e46ac25a0baa678d89d0a137fc31a608cc1"}, + {file = "types_python_dateutil-2.9.0.20250822-py3-none-any.whl", hash = "sha256:849d52b737e10a6dc6621d2bd7940ec7c65fcb69e6aa2882acf4e56b2b508ddc"}, + {file = "types_python_dateutil-2.9.0.20250822.tar.gz", hash = "sha256:84c92c34bd8e68b117bff742bc00b692a1e8531262d4507b33afcc9f7716cd53"}, ] [[package]] @@ -943,13 +938,13 @@ urllib3 = ">=2" [[package]] name = "typing-extensions" -version = "4.14.1" +version = "4.15.0" description = "Backported and Experimental Type Hints for Python 3.9+" optional = false python-versions = ">=3.9" files = [ - {file = "typing_extensions-4.14.1-py3-none-any.whl", hash = "sha256:d1e1e3b58374dc93031d6eda2420a48ea44a36c2b4766a4fdeb3710755731d76"}, - {file = "typing_extensions-4.14.1.tar.gz", hash = "sha256:38b39f4aeeab64884ce9f74c94263ef78f3c22467c8724005483154c26648d36"}, + {file = "typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548"}, + {file = "typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index e7c1caaa9..22360b416 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "cohere" [tool.poetry] name = "cohere" -version = "5.17.0" +version = "6.0.0" description = "" readme = "README.md" authors = [] diff --git a/src/cohere/__init__.py b/src/cohere/__init__.py index d46a96077..f9e90a566 100644 --- a/src/cohere/__init__.py +++ b/src/cohere/__init__.py @@ -61,6 +61,7 @@ ChatTextGenerationEvent, ChatTextResponseFormat, ChatTextResponseFormatV2, + ChatThinkingContent, ChatToolCallDeltaEvent, ChatToolCallDeltaEventDelta, ChatToolCallDeltaEventDeltaMessage, @@ -364,6 +365,7 @@ "ChatTextGenerationEvent", "ChatTextResponseFormat", "ChatTextResponseFormatV2", + "ChatThinkingContent", "ChatToolCallDeltaEvent", "ChatToolCallDeltaEventDelta", "ChatToolCallDeltaEventDeltaMessage", diff --git a/src/cohere/core/client_wrapper.py b/src/cohere/core/client_wrapper.py index 1b500a176..a3faddf16 100644 --- a/src/cohere/core/client_wrapper.py +++ b/src/cohere/core/client_wrapper.py @@ -22,10 +22,10 @@ def __init__( def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { - "User-Agent": "cohere/5.17.0", + "User-Agent": "cohere/6.0.0", "X-Fern-Language": "Python", "X-Fern-SDK-Name": "cohere", - "X-Fern-SDK-Version": "5.17.0", + "X-Fern-SDK-Version": "6.0.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 c53b76b80..5e5b9bc68 100644 --- a/src/cohere/types/__init__.py +++ b/src/cohere/types/__init__.py @@ -73,6 +73,7 @@ from .chat_text_generation_event import ChatTextGenerationEvent from .chat_text_response_format import ChatTextResponseFormat from .chat_text_response_format_v2 import ChatTextResponseFormatV2 +from .chat_thinking_content import ChatThinkingContent from .chat_tool_call_delta_event import ChatToolCallDeltaEvent from .chat_tool_call_delta_event_delta import ChatToolCallDeltaEventDelta from .chat_tool_call_delta_event_delta_message import ChatToolCallDeltaEventDeltaMessage @@ -289,6 +290,7 @@ "ChatTextGenerationEvent", "ChatTextResponseFormat", "ChatTextResponseFormatV2", + "ChatThinkingContent", "ChatToolCallDeltaEvent", "ChatToolCallDeltaEventDelta", "ChatToolCallDeltaEventDeltaMessage", diff --git a/src/cohere/types/assistant_message_response_content_item.py b/src/cohere/types/assistant_message_response_content_item.py index 713617c64..833beebaf 100644 --- a/src/cohere/types/assistant_message_response_content_item.py +++ b/src/cohere/types/assistant_message_response_content_item.py @@ -24,13 +24,16 @@ class Config: class ThinkingAssistantMessageResponseContentItem(UncheckedBaseModel): - value: typing.Optional[typing.Any] = None type: typing.Literal["thinking"] = "thinking" + thinking: str - if not IS_PYDANTIC_V2: + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: class Config: smart_union = True + extra = pydantic.Extra.allow AssistantMessageResponseContentItem = typing_extensions.Annotated[ diff --git a/src/cohere/types/assistant_message_v2content_item.py b/src/cohere/types/assistant_message_v2content_item.py index 6a04ccd88..5a65bf222 100644 --- a/src/cohere/types/assistant_message_v2content_item.py +++ b/src/cohere/types/assistant_message_v2content_item.py @@ -24,13 +24,16 @@ class Config: class ThinkingAssistantMessageV2ContentItem(UncheckedBaseModel): - value: typing.Optional[typing.Any] = None type: typing.Literal["thinking"] = "thinking" + thinking: str - if not IS_PYDANTIC_V2: + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: class Config: smart_union = True + extra = pydantic.Extra.allow AssistantMessageV2ContentItem = typing_extensions.Annotated[ diff --git a/src/cohere/types/chat_content_start_event_delta_message_content.py b/src/cohere/types/chat_content_start_event_delta_message_content.py index fa53677a1..878024e32 100644 --- a/src/cohere/types/chat_content_start_event_delta_message_content.py +++ b/src/cohere/types/chat_content_start_event_delta_message_content.py @@ -9,6 +9,7 @@ class ChatContentStartEventDeltaMessageContent(UncheckedBaseModel): + thinking: typing.Optional[str] = None text: typing.Optional[str] = None type: typing.Optional[ChatContentStartEventDeltaMessageContentType] = None diff --git a/src/cohere/types/chat_thinking_content.py b/src/cohere/types/chat_thinking_content.py new file mode 100644 index 000000000..21b295724 --- /dev/null +++ b/src/cohere/types/chat_thinking_content.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel + + +class ChatThinkingContent(UncheckedBaseModel): + """ + Thinking content of the message. This will be present when `thinking` is enabled, and will contain the models internal reasoning. + """ + + thinking: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/cohere/types/embed_by_type_response_embeddings.py b/src/cohere/types/embed_by_type_response_embeddings.py index 358feed96..fd6e32749 100644 --- a/src/cohere/types/embed_by_type_response_embeddings.py +++ b/src/cohere/types/embed_by_type_response_embeddings.py @@ -41,6 +41,11 @@ class EmbedByTypeResponseEmbeddings(UncheckedBaseModel): An array of packed unsigned binary embeddings. The length of each binary embedding is 1/8 the length of the float embeddings of the provided model. Each value is between 0 and 255. """ + base64: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + An array of base64 embeddings. Each string is the result of appending the float embedding bytes together and base64 encoding that. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 else: diff --git a/src/cohere/types/embedding_type.py b/src/cohere/types/embedding_type.py index 06663e566..debbda3a8 100644 --- a/src/cohere/types/embedding_type.py +++ b/src/cohere/types/embedding_type.py @@ -2,4 +2,4 @@ import typing -EmbeddingType = typing.Union[typing.Literal["float", "int8", "uint8", "binary", "ubinary"], typing.Any] +EmbeddingType = typing.Union[typing.Literal["float", "int8", "uint8", "binary", "ubinary", "base64"], typing.Any] diff --git a/src/cohere/types/thinking.py b/src/cohere/types/thinking.py index 9a9f18842..c2e362da1 100644 --- a/src/cohere/types/thinking.py +++ b/src/cohere/types/thinking.py @@ -10,12 +10,14 @@ class Thinking(UncheckedBaseModel): """ - Thinking gives the model enhanced reasoning capabilities for complex tasks, while also providing transparency into its step-by-step thought process before it delivers its final answer. - When thinking is turned on, the model creates thinking content blocks where it outputs its internal reasoning. The model will incorporate insights from this reasoning before crafting a final response. - When thinking is used without tools, the API response will include both thinking and text content blocks. Meanwhile, when thinking is used alongside tools and the model makes tool calls, the API response will include the thinking content block and `tool_calls`. + Configuration for [reasoning features](https://docs.cohere.com/docs/reasoning). + """ + + type: ThinkingType = pydantic.Field() + """ + Reasoning is enabled by default for models that support it, but can be turned off by setting `"type": "disabled"`. """ - type: ThinkingType token_budget: typing.Optional[int] = pydantic.Field(default=None) """ The maximum number of tokens the model can use for thinking, which must be set to a positive integer. diff --git a/src/cohere/v2/client.py b/src/cohere/v2/client.py index 816ece344..0c9a1325c 100644 --- a/src/cohere/v2/client.py +++ b/src/cohere/v2/client.py @@ -444,6 +444,7 @@ def embed( * `"uint8"`: Use this when you want to get back unsigned int8 embeddings. Supported with Embed v3.0 and newer Embed models. * `"binary"`: Use this when you want to get back signed binary embeddings. Supported with Embed v3.0 and newer Embed models. * `"ubinary"`: Use this when you want to get back unsigned binary embeddings. Supported with Embed v3.0 and newer Embed models. + * `"base64"`: Use this when you want to get back base64 embeddings. Supported with Embed v3.0 and newer Embed models. truncate : typing.Optional[V2EmbedRequestTruncate] One of `NONE|START|END` to specify how the API will handle inputs longer than the maximum token length. @@ -996,6 +997,7 @@ async def embed( * `"uint8"`: Use this when you want to get back unsigned int8 embeddings. Supported with Embed v3.0 and newer Embed models. * `"binary"`: Use this when you want to get back signed binary embeddings. Supported with Embed v3.0 and newer Embed models. * `"ubinary"`: Use this when you want to get back unsigned binary embeddings. Supported with Embed v3.0 and newer Embed models. + * `"base64"`: Use this when you want to get back base64 embeddings. Supported with Embed v3.0 and newer Embed models. truncate : typing.Optional[V2EmbedRequestTruncate] One of `NONE|START|END` to specify how the API will handle inputs longer than the maximum token length. diff --git a/src/cohere/v2/raw_client.py b/src/cohere/v2/raw_client.py index 937e35201..43ac34e23 100644 --- a/src/cohere/v2/raw_client.py +++ b/src/cohere/v2/raw_client.py @@ -767,6 +767,7 @@ def embed( * `"uint8"`: Use this when you want to get back unsigned int8 embeddings. Supported with Embed v3.0 and newer Embed models. * `"binary"`: Use this when you want to get back signed binary embeddings. Supported with Embed v3.0 and newer Embed models. * `"ubinary"`: Use this when you want to get back unsigned binary embeddings. Supported with Embed v3.0 and newer Embed models. + * `"base64"`: Use this when you want to get back base64 embeddings. Supported with Embed v3.0 and newer Embed models. truncate : typing.Optional[V2EmbedRequestTruncate] One of `NONE|START|END` to specify how the API will handle inputs longer than the maximum token length. @@ -1878,6 +1879,7 @@ async def embed( * `"uint8"`: Use this when you want to get back unsigned int8 embeddings. Supported with Embed v3.0 and newer Embed models. * `"binary"`: Use this when you want to get back signed binary embeddings. Supported with Embed v3.0 and newer Embed models. * `"ubinary"`: Use this when you want to get back unsigned binary embeddings. Supported with Embed v3.0 and newer Embed models. + * `"base64"`: Use this when you want to get back base64 embeddings. Supported with Embed v3.0 and newer Embed models. truncate : typing.Optional[V2EmbedRequestTruncate] One of `NONE|START|END` to specify how the API will handle inputs longer than the maximum token length.