Skip to content

Commit fcc9567

Browse files
🌿 Fern Regeneration -- February 28, 2025 (#654)
* SDK regeneration * Fixes * Fix test --------- Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Co-authored-by: Billy Trend <[email protected]>
1 parent 7d87482 commit fcc9567

10 files changed

+87
-8
lines changed

poetry.lock

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

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "cohere"
33

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

src/cohere/__init__.py

+6
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@
143143
GetConnectorResponse,
144144
GetModelResponse,
145145
Image,
146+
ImageContent,
147+
ImageUrl,
148+
ImageUrlContent,
146149
JsonObjectResponseFormat,
147150
JsonObjectResponseFormatV2,
148151
JsonResponseFormat,
@@ -432,6 +435,9 @@
432435
"GetConnectorResponse",
433436
"GetModelResponse",
434437
"Image",
438+
"ImageContent",
439+
"ImageUrl",
440+
"ImageUrlContent",
435441
"InternalServerError",
436442
"InvalidTokenError",
437443
"JsonObjectResponseFormat",

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.12",
27+
"X-Fern-SDK-Version": "5.14.0",
2828
}
2929
if self._client_name is not None:
3030
headers["X-Client-Name"] = self._client_name

src/cohere/types/__init__.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
from .connector import Connector
103103
from .connector_auth_status import ConnectorAuthStatus
104104
from .connector_o_auth import ConnectorOAuth
105-
from .content import Content, TextContent
105+
from .content import Content, ImageUrlContent, TextContent
106106
from .create_connector_o_auth import CreateConnectorOAuth
107107
from .create_connector_response import CreateConnectorResponse
108108
from .create_connector_service_auth import CreateConnectorServiceAuth
@@ -146,6 +146,8 @@
146146
from .get_connector_response import GetConnectorResponse
147147
from .get_model_response import GetModelResponse
148148
from .image import Image
149+
from .image_content import ImageContent
150+
from .image_url import ImageUrl
149151
from .json_response_format import JsonResponseFormat
150152
from .json_response_format_v2 import JsonResponseFormatV2
151153
from .label_metric import LabelMetric
@@ -367,6 +369,9 @@
367369
"GetConnectorResponse",
368370
"GetModelResponse",
369371
"Image",
372+
"ImageContent",
373+
"ImageUrl",
374+
"ImageUrlContent",
370375
"JsonObjectResponseFormat",
371376
"JsonObjectResponseFormatV2",
372377
"JsonResponseFormat",

src/cohere/types/content.py

+19-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import typing
66
from ..core.pydantic_utilities import IS_PYDANTIC_V2
77
import pydantic
8+
from .image_url import ImageUrl
89
import typing_extensions
910
from ..core.unchecked_base_model import UnionMetadata
1011

@@ -26,4 +27,21 @@ class Config:
2627
extra = pydantic.Extra.allow
2728

2829

29-
Content = typing_extensions.Annotated[TextContent, UnionMetadata(discriminant="type")]
30+
class ImageUrlContent(UncheckedBaseModel):
31+
"""
32+
A Content block which contains information about the content type and the content itself.
33+
"""
34+
35+
type: typing.Literal["image_url"] = "image_url"
36+
image_url: ImageUrl
37+
38+
if IS_PYDANTIC_V2:
39+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
40+
else:
41+
42+
class Config:
43+
smart_union = True
44+
extra = pydantic.Extra.allow
45+
46+
47+
Content = typing_extensions.Annotated[typing.Union[TextContent, ImageUrlContent], UnionMetadata(discriminant="type")]

src/cohere/types/get_model_response.py

+5
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ class GetModelResponse(UncheckedBaseModel):
3737
Public URL to the tokenizer's configuration file.
3838
"""
3939

40+
supports_vision: typing.Optional[bool] = pydantic.Field(default=None)
41+
"""
42+
Whether the model supports image inputs or not.
43+
"""
44+
4045
default_endpoints: typing.Optional[typing.List[CompatibleEndpoint]] = pydantic.Field(default=None)
4146
"""
4247
The API endpoints that the model is default to.

src/cohere/types/image_content.py

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
from ..core.unchecked_base_model import UncheckedBaseModel
4+
from .image_url import ImageUrl
5+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
6+
import typing
7+
import pydantic
8+
9+
10+
class ImageContent(UncheckedBaseModel):
11+
"""
12+
Image content of the message.
13+
"""
14+
15+
image_url: ImageUrl
16+
17+
if IS_PYDANTIC_V2:
18+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
19+
else:
20+
21+
class Config:
22+
smart_union = True
23+
extra = pydantic.Extra.allow

src/cohere/types/image_url.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
from ..core.unchecked_base_model import UncheckedBaseModel
4+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
5+
import typing
6+
import pydantic
7+
8+
9+
class ImageUrl(UncheckedBaseModel):
10+
"""
11+
Base64 url of image.
12+
"""
13+
14+
url: str
15+
16+
if IS_PYDANTIC_V2:
17+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
18+
else:
19+
20+
class Config:
21+
smart_union = True
22+
extra = pydantic.Extra.allow

tests/test_client_v2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def test_chat_tools(self) -> None:
7979

8080
# call the get_weather tool
8181
tool_result = {"temperature": "30C"}
82-
tool_content = [cohere.Content(
82+
tool_content = [cohere.TextContent(
8383
output=tool_result, text="The weather in Toronto is 30C")]
8484
messages.append(cohere.AssistantChatMessageV2(content=res.message))
8585
if res.message.tool_calls is not None:

0 commit comments

Comments
 (0)