Skip to content

Commit 0fc77bc

Browse files
🌿 Fern Regeneration -- June 10, 2024 (#524)
* SDK regeneration * Restore * Fix deps --------- Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Co-authored-by: Billy Trend <[email protected]>
1 parent 8f5ff50 commit 0fc77bc

File tree

9 files changed

+132
-3
lines changed

9 files changed

+132
-3
lines changed

.fernignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ src/cohere/utils.py
1010
src/cohere/overrides.py
1111
src/cohere/config.py
1212
src/cohere/manually_maintained
13-
src/cohere/bedrock_client.py
13+
src/cohere/bedrock_client.py
14+
src/cohere/aws_client.py
15+
src/cohere/sagemaker_client.py

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "cohere"
3-
version = "5.5.6"
3+
version = "5.5.7"
44
description = ""
55
readme = "README.md"
66
authors = []

src/cohere/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
ChatStreamRequestPromptTruncation,
2929
ChatStreamStartEvent,
3030
ChatTextGenerationEvent,
31+
ChatToolCallsChunkEvent,
3132
ChatToolCallsGenerationEvent,
3233
CheckApiKeyResponse,
3334
ClassifyDataMetrics,
@@ -112,6 +113,7 @@
112113
StreamedChatResponse_StreamEnd,
113114
StreamedChatResponse_StreamStart,
114115
StreamedChatResponse_TextGeneration,
116+
StreamedChatResponse_ToolCallsChunk,
115117
StreamedChatResponse_ToolCallsGeneration,
116118
SummarizeRequestExtractiveness,
117119
SummarizeRequestFormat,
@@ -121,6 +123,7 @@
121123
TooManyRequestsErrorBody,
122124
Tool,
123125
ToolCall,
126+
ToolCallDelta,
124127
ToolMessage,
125128
ToolParameterDefinitionsValue,
126129
ToolResult,
@@ -183,6 +186,7 @@
183186
"ChatStreamRequestPromptTruncation",
184187
"ChatStreamStartEvent",
185188
"ChatTextGenerationEvent",
189+
"ChatToolCallsChunkEvent",
186190
"ChatToolCallsGenerationEvent",
187191
"CheckApiKeyResponse",
188192
"ClassifyDataMetrics",
@@ -280,6 +284,7 @@
280284
"StreamedChatResponse_StreamEnd",
281285
"StreamedChatResponse_StreamStart",
282286
"StreamedChatResponse_TextGeneration",
287+
"StreamedChatResponse_ToolCallsChunk",
283288
"StreamedChatResponse_ToolCallsGeneration",
284289
"SummarizeRequestExtractiveness",
285290
"SummarizeRequestFormat",
@@ -290,6 +295,7 @@
290295
"TooManyRequestsErrorBody",
291296
"Tool",
292297
"ToolCall",
298+
"ToolCallDelta",
293299
"ToolMessage",
294300
"ToolParameterDefinitionsValue",
295301
"ToolResult",

src/cohere/core/client_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def get_headers(self) -> typing.Dict[str, str]:
2525
headers: typing.Dict[str, str] = {
2626
"X-Fern-Language": "Python",
2727
"X-Fern-SDK-Name": "cohere",
28-
"X-Fern-SDK-Version": "5.5.6",
28+
"X-Fern-SDK-Version": "5.5.7",
2929
}
3030
if self._client_name is not None:
3131
headers["X-Client-Name"] = self._client_name

src/cohere/types/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from .chat_stream_request_prompt_truncation import ChatStreamRequestPromptTruncation
2828
from .chat_stream_start_event import ChatStreamStartEvent
2929
from .chat_text_generation_event import ChatTextGenerationEvent
30+
from .chat_tool_calls_chunk_event import ChatToolCallsChunkEvent
3031
from .chat_tool_calls_generation_event import ChatToolCallsGenerationEvent
3132
from .check_api_key_response import CheckApiKeyResponse
3233
from .classify_data_metrics import ClassifyDataMetrics
@@ -110,6 +111,7 @@
110111
StreamedChatResponse_StreamEnd,
111112
StreamedChatResponse_StreamStart,
112113
StreamedChatResponse_TextGeneration,
114+
StreamedChatResponse_ToolCallsChunk,
113115
StreamedChatResponse_ToolCallsGeneration,
114116
)
115117
from .summarize_request_extractiveness import SummarizeRequestExtractiveness
@@ -120,6 +122,7 @@
120122
from .too_many_requests_error_body import TooManyRequestsErrorBody
121123
from .tool import Tool
122124
from .tool_call import ToolCall
125+
from .tool_call_delta import ToolCallDelta
123126
from .tool_message import ToolMessage
124127
from .tool_parameter_definitions_value import ToolParameterDefinitionsValue
125128
from .tool_result import ToolResult
@@ -153,6 +156,7 @@
153156
"ChatStreamRequestPromptTruncation",
154157
"ChatStreamStartEvent",
155158
"ChatTextGenerationEvent",
159+
"ChatToolCallsChunkEvent",
156160
"ChatToolCallsGenerationEvent",
157161
"CheckApiKeyResponse",
158162
"ClassifyDataMetrics",
@@ -237,6 +241,7 @@
237241
"StreamedChatResponse_StreamEnd",
238242
"StreamedChatResponse_StreamStart",
239243
"StreamedChatResponse_TextGeneration",
244+
"StreamedChatResponse_ToolCallsChunk",
240245
"StreamedChatResponse_ToolCallsGeneration",
241246
"SummarizeRequestExtractiveness",
242247
"SummarizeRequestFormat",
@@ -246,6 +251,7 @@
246251
"TooManyRequestsErrorBody",
247252
"Tool",
248253
"ToolCall",
254+
"ToolCallDelta",
249255
"ToolMessage",
250256
"ToolParameterDefinitionsValue",
251257
"ToolResult",
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
import datetime as dt
4+
import typing
5+
6+
from ..core.datetime_utils import serialize_datetime
7+
from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
8+
from .chat_stream_event import ChatStreamEvent
9+
from .tool_call_delta import ToolCallDelta
10+
11+
12+
class ChatToolCallsChunkEvent(ChatStreamEvent):
13+
tool_call_delta: ToolCallDelta
14+
15+
def json(self, **kwargs: typing.Any) -> str:
16+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
17+
return super().json(**kwargs_with_defaults)
18+
19+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
20+
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21+
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
22+
23+
return deep_union_pydantic_dicts(
24+
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
25+
)
26+
27+
class Config:
28+
frozen = True
29+
smart_union = True
30+
allow_population_by_field_name = True
31+
populate_by_name = True
32+
extra = pydantic_v1.Extra.allow
33+
json_encoders = {dt.datetime: serialize_datetime}

src/cohere/types/chat_tool_calls_generation_event.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010

1111

1212
class ChatToolCallsGenerationEvent(ChatStreamEvent):
13+
text: typing.Optional[str] = pydantic_v1.Field(default=None)
14+
"""
15+
The text generated related to the tool calls generated
16+
"""
17+
1318
tool_calls: typing.List[ToolCall]
1419

1520
def json(self, **kwargs: typing.Any) -> str:

src/cohere/types/streamed_chat_response.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from .chat_stream_end_event_finish_reason import ChatStreamEndEventFinishReason
1818
from .non_streamed_chat_response import NonStreamedChatResponse
1919
from .tool_call import ToolCall
20+
from .tool_call_delta import ToolCallDelta
2021

2122

2223
class StreamedChatResponse_StreamStart(UncheckedBaseModel):
@@ -160,6 +161,7 @@ class StreamedChatResponse_ToolCallsGeneration(UncheckedBaseModel):
160161
StreamedChatResponse is returned in streaming mode (specified with `stream=True` in the request).
161162
"""
162163

164+
text: typing.Optional[str] = None
163165
tool_calls: typing.List[ToolCall]
164166
event_type: typing.Literal["tool-calls-generation"] = "tool-calls-generation"
165167

@@ -210,6 +212,33 @@ class Config:
210212
json_encoders = {dt.datetime: serialize_datetime}
211213

212214

215+
class StreamedChatResponse_ToolCallsChunk(UncheckedBaseModel):
216+
"""
217+
StreamedChatResponse is returned in streaming mode (specified with `stream=True` in the request).
218+
"""
219+
220+
tool_call_delta: ToolCallDelta
221+
event_type: typing.Literal["tool-calls-chunk"] = "tool-calls-chunk"
222+
223+
def json(self, **kwargs: typing.Any) -> str:
224+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
225+
return super().json(**kwargs_with_defaults)
226+
227+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
228+
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
229+
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
230+
231+
return deep_union_pydantic_dicts(
232+
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
233+
)
234+
235+
class Config:
236+
frozen = True
237+
smart_union = True
238+
extra = pydantic_v1.Extra.allow
239+
json_encoders = {dt.datetime: serialize_datetime}
240+
241+
213242
StreamedChatResponse = typing_extensions.Annotated[
214243
typing.Union[
215244
StreamedChatResponse_StreamStart,
@@ -219,6 +248,7 @@ class Config:
219248
StreamedChatResponse_CitationGeneration,
220249
StreamedChatResponse_ToolCallsGeneration,
221250
StreamedChatResponse_StreamEnd,
251+
StreamedChatResponse_ToolCallsChunk,
222252
],
223253
UnionMetadata(discriminant="event_type"),
224254
]
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
import datetime as dt
4+
import typing
5+
6+
from ..core.datetime_utils import serialize_datetime
7+
from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
8+
from ..core.unchecked_base_model import UncheckedBaseModel
9+
10+
11+
class ToolCallDelta(UncheckedBaseModel):
12+
"""
13+
Contains the chunk of the tool call generation in the stream.
14+
"""
15+
16+
name: typing.Optional[str] = pydantic_v1.Field(default=None)
17+
"""
18+
Name of the tool call
19+
"""
20+
21+
index: typing.Optional[float] = pydantic_v1.Field(default=None)
22+
"""
23+
Index of the tool call generated
24+
"""
25+
26+
parameters: typing.Optional[str] = pydantic_v1.Field(default=None)
27+
"""
28+
Chunk of the tool parameters
29+
"""
30+
31+
def json(self, **kwargs: typing.Any) -> str:
32+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
33+
return super().json(**kwargs_with_defaults)
34+
35+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
36+
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
37+
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
38+
39+
return deep_union_pydantic_dicts(
40+
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
41+
)
42+
43+
class Config:
44+
frozen = True
45+
smart_union = True
46+
extra = pydantic_v1.Extra.allow
47+
json_encoders = {dt.datetime: serialize_datetime}

0 commit comments

Comments
 (0)