Skip to content

Commit

Permalink
🌿 Fern Regeneration -- September 25, 2024 (#587)
Browse files Browse the repository at this point in the history
* SDK regeneration

* Fixes

---------

Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
Co-authored-by: Billy Trend <[email protected]>
  • Loading branch information
fern-api[bot] and billytrend-cohere committed Sep 25, 2024
1 parent 18c45e6 commit 349c5ab
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 34 deletions.
20 changes: 10 additions & 10 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cohere"
version = "5.9.4"
version = "5.10.0"
description = ""
readme = "README.md"
authors = []
Expand Down
5 changes: 2 additions & 3 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -2621,7 +2621,6 @@ client.v2.chat(
messages=[
ToolChatMessageV2(
tool_call_id="messages",
tool_content="messages",
)
],
)
Expand Down Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions src/cohere/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
ToolContent,
ToolMessage,
ToolMessageV2,
ToolMessageV2ToolContent,
ToolMessageV2Content,
ToolParameterDefinitionsValue,
ToolPlanDeltaStreamedChatResponseV2,
ToolResult,
Expand Down Expand Up @@ -498,7 +498,7 @@
"ToolContent",
"ToolMessage",
"ToolMessageV2",
"ToolMessageV2ToolContent",
"ToolMessageV2Content",
"ToolParameterDefinitionsValue",
"ToolPlanDeltaStreamedChatResponseV2",
"ToolResult",
Expand Down
2 changes: 1 addition & 1 deletion src/cohere/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/cohere/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -428,7 +428,7 @@
"ToolContent",
"ToolMessage",
"ToolMessageV2",
"ToolMessageV2ToolContent",
"ToolMessageV2Content",
"ToolParameterDefinitionsValue",
"ToolPlanDeltaStreamedChatResponseV2",
"ToolResult",
Expand Down
4 changes: 2 additions & 2 deletions src/cohere/types/chat_message_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/cohere/types/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions src/cohere/types/tool_message_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
10 changes: 4 additions & 6 deletions src/cohere/v2/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -500,7 +500,6 @@ def chat(
messages=[
ToolChatMessageV2(
tool_call_id="messages",
tool_content="messages",
)
],
)
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -1558,7 +1557,6 @@ async def main() -> None:
messages=[
ToolChatMessageV2(
tool_call_id="messages",
tool_content="messages",
)
],
)
Expand Down
2 changes: 1 addition & 1 deletion src/cohere/v2/types/v2chat_request_safety_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
2 changes: 1 addition & 1 deletion src/cohere/v2/types/v2chat_stream_request_safety_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

0 comments on commit 349c5ab

Please sign in to comment.