Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
277 changes: 132 additions & 145 deletions poetry.lock

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[tool.poetry]
name = "cohere"
version = "5.13.4"
version = "5.13.5"
description = ""
readme = "README.md"
authors = []
keywords = []

license = "MIT"
classifiers = [
"Intended Audience :: Developers",
"Programming Language :: Python",
Expand All @@ -21,7 +21,8 @@ classifiers = [
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed"
"Typing :: Typed",
"License :: OSI Approved :: MIT License"
]
packages = [
{ include = "cohere", from = "src"}
Expand Down
8 changes: 4 additions & 4 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1288,11 +1288,11 @@ Using `frequency_penalty` in combination with `presence_penalty` is not supporte

**return_likelihoods:** `typing.Optional[GenerateStreamRequestReturnLikelihoods]`

One of `GENERATION|ALL|NONE` to specify how and if the token likelihoods are returned with the response. Defaults to `NONE`.
One of `GENERATION|NONE` to specify how and if the token likelihoods are returned with the response. Defaults to `NONE`.

If `GENERATION` is selected, the token likelihoods will only be provided for generated text.

If `ALL` is selected, the token likelihoods will be provided both for the prompt and the generated text.
WARNING: `ALL` is deprecated, and will be removed in a future release.

</dd>
</dl>
Expand Down Expand Up @@ -1544,11 +1544,11 @@ Using `frequency_penalty` in combination with `presence_penalty` is not supporte

**return_likelihoods:** `typing.Optional[GenerateRequestReturnLikelihoods]`

One of `GENERATION|ALL|NONE` to specify how and if the token likelihoods are returned with the response. Defaults to `NONE`.
One of `GENERATION|NONE` to specify how and if the token likelihoods are returned with the response. Defaults to `NONE`.

If `GENERATION` is selected, the token likelihoods will only be provided for generated text.

If `ALL` is selected, the token likelihoods will be provided both for the prompt and the generated text.
WARNING: `ALL` is deprecated, and will be removed in a future release.

</dd>
</dl>
Expand Down
18 changes: 10 additions & 8 deletions src/cohere/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,18 @@
ChatTextGenerationEvent,
ChatToolCallDeltaEvent,
ChatToolCallDeltaEventDelta,
ChatToolCallDeltaEventDeltaToolCall,
ChatToolCallDeltaEventDeltaToolCallFunction,
ChatToolCallDeltaEventDeltaMessage,
ChatToolCallDeltaEventDeltaMessageToolCalls,
ChatToolCallDeltaEventDeltaMessageToolCallsFunction,
ChatToolCallEndEvent,
ChatToolCallStartEvent,
ChatToolCallStartEventDelta,
ChatToolCallStartEventDeltaToolCall,
ChatToolCallStartEventDeltaToolCallFunction,
ChatToolCallStartEventDeltaMessage,
ChatToolCallsChunkEvent,
ChatToolCallsGenerationEvent,
ChatToolPlanDeltaEvent,
ChatToolPlanDeltaEventDelta,
ChatToolPlanDeltaEventDeltaMessage,
ChatbotMessage,
CheckApiKeyResponse,
Citation,
Expand Down Expand Up @@ -334,17 +335,18 @@
"ChatTextGenerationEvent",
"ChatToolCallDeltaEvent",
"ChatToolCallDeltaEventDelta",
"ChatToolCallDeltaEventDeltaToolCall",
"ChatToolCallDeltaEventDeltaToolCallFunction",
"ChatToolCallDeltaEventDeltaMessage",
"ChatToolCallDeltaEventDeltaMessageToolCalls",
"ChatToolCallDeltaEventDeltaMessageToolCallsFunction",
"ChatToolCallEndEvent",
"ChatToolCallStartEvent",
"ChatToolCallStartEventDelta",
"ChatToolCallStartEventDeltaToolCall",
"ChatToolCallStartEventDeltaToolCallFunction",
"ChatToolCallStartEventDeltaMessage",
"ChatToolCallsChunkEvent",
"ChatToolCallsGenerationEvent",
"ChatToolPlanDeltaEvent",
"ChatToolPlanDeltaEventDelta",
"ChatToolPlanDeltaEventDeltaMessage",
"ChatbotMessage",
"CheckApiKeyResponse",
"Citation",
Expand Down
16 changes: 8 additions & 8 deletions src/cohere/base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1282,11 +1282,11 @@ def generate_stream(


return_likelihoods : typing.Optional[GenerateStreamRequestReturnLikelihoods]
One of `GENERATION|ALL|NONE` to specify how and if the token likelihoods are returned with the response. Defaults to `NONE`.
One of `GENERATION|NONE` to specify how and if the token likelihoods are returned with the response. Defaults to `NONE`.

If `GENERATION` is selected, the token likelihoods will only be provided for generated text.

If `ALL` is selected, the token likelihoods will be provided both for the prompt and the generated text.
WARNING: `ALL` is deprecated, and will be removed in a future release.

raw_prompting : typing.Optional[bool]
When enabled, the user's prompt will be sent to the model without any pre-processing.
Expand Down Expand Up @@ -1591,11 +1591,11 @@ def generate(


return_likelihoods : typing.Optional[GenerateRequestReturnLikelihoods]
One of `GENERATION|ALL|NONE` to specify how and if the token likelihoods are returned with the response. Defaults to `NONE`.
One of `GENERATION|NONE` to specify how and if the token likelihoods are returned with the response. Defaults to `NONE`.

If `GENERATION` is selected, the token likelihoods will only be provided for generated text.

If `ALL` is selected, the token likelihoods will be provided both for the prompt and the generated text.
WARNING: `ALL` is deprecated, and will be removed in a future release.

raw_prompting : typing.Optional[bool]
When enabled, the user's prompt will be sent to the model without any pre-processing.
Expand Down Expand Up @@ -4297,11 +4297,11 @@ async def generate_stream(


return_likelihoods : typing.Optional[GenerateStreamRequestReturnLikelihoods]
One of `GENERATION|ALL|NONE` to specify how and if the token likelihoods are returned with the response. Defaults to `NONE`.
One of `GENERATION|NONE` to specify how and if the token likelihoods are returned with the response. Defaults to `NONE`.

If `GENERATION` is selected, the token likelihoods will only be provided for generated text.

If `ALL` is selected, the token likelihoods will be provided both for the prompt and the generated text.
WARNING: `ALL` is deprecated, and will be removed in a future release.

raw_prompting : typing.Optional[bool]
When enabled, the user's prompt will be sent to the model without any pre-processing.
Expand Down Expand Up @@ -4614,11 +4614,11 @@ async def generate(


return_likelihoods : typing.Optional[GenerateRequestReturnLikelihoods]
One of `GENERATION|ALL|NONE` to specify how and if the token likelihoods are returned with the response. Defaults to `NONE`.
One of `GENERATION|NONE` to specify how and if the token likelihoods are returned with the response. Defaults to `NONE`.

If `GENERATION` is selected, the token likelihoods will only be provided for generated text.

If `ALL` is selected, the token likelihoods will be provided both for the prompt and the generated text.
WARNING: `ALL` is deprecated, and will be removed in a future release.

raw_prompting : typing.Optional[bool]
When enabled, the user's prompt will be sent to the model without any pre-processing.
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.13.4",
"X-Fern-SDK-Version": "5.13.5",
}
if self._client_name is not None:
headers["X-Client-Name"] = self._client_name
Expand Down
20 changes: 12 additions & 8 deletions src/cohere/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,20 @@
from .chat_text_generation_event import ChatTextGenerationEvent
from .chat_tool_call_delta_event import ChatToolCallDeltaEvent
from .chat_tool_call_delta_event_delta import ChatToolCallDeltaEventDelta
from .chat_tool_call_delta_event_delta_tool_call import ChatToolCallDeltaEventDeltaToolCall
from .chat_tool_call_delta_event_delta_tool_call_function import ChatToolCallDeltaEventDeltaToolCallFunction
from .chat_tool_call_delta_event_delta_message import ChatToolCallDeltaEventDeltaMessage
from .chat_tool_call_delta_event_delta_message_tool_calls import ChatToolCallDeltaEventDeltaMessageToolCalls
from .chat_tool_call_delta_event_delta_message_tool_calls_function import (
ChatToolCallDeltaEventDeltaMessageToolCallsFunction,
)
from .chat_tool_call_end_event import ChatToolCallEndEvent
from .chat_tool_call_start_event import ChatToolCallStartEvent
from .chat_tool_call_start_event_delta import ChatToolCallStartEventDelta
from .chat_tool_call_start_event_delta_tool_call import ChatToolCallStartEventDeltaToolCall
from .chat_tool_call_start_event_delta_tool_call_function import ChatToolCallStartEventDeltaToolCallFunction
from .chat_tool_call_start_event_delta_message import ChatToolCallStartEventDeltaMessage
from .chat_tool_calls_chunk_event import ChatToolCallsChunkEvent
from .chat_tool_calls_generation_event import ChatToolCallsGenerationEvent
from .chat_tool_plan_delta_event import ChatToolPlanDeltaEvent
from .chat_tool_plan_delta_event_delta import ChatToolPlanDeltaEventDelta
from .chat_tool_plan_delta_event_delta_message import ChatToolPlanDeltaEventDeltaMessage
from .check_api_key_response import CheckApiKeyResponse
from .citation import Citation
from .citation_end_event import CitationEndEvent
Expand Down Expand Up @@ -282,17 +285,18 @@
"ChatTextGenerationEvent",
"ChatToolCallDeltaEvent",
"ChatToolCallDeltaEventDelta",
"ChatToolCallDeltaEventDeltaToolCall",
"ChatToolCallDeltaEventDeltaToolCallFunction",
"ChatToolCallDeltaEventDeltaMessage",
"ChatToolCallDeltaEventDeltaMessageToolCalls",
"ChatToolCallDeltaEventDeltaMessageToolCallsFunction",
"ChatToolCallEndEvent",
"ChatToolCallStartEvent",
"ChatToolCallStartEventDelta",
"ChatToolCallStartEventDeltaToolCall",
"ChatToolCallStartEventDeltaToolCallFunction",
"ChatToolCallStartEventDeltaMessage",
"ChatToolCallsChunkEvent",
"ChatToolCallsGenerationEvent",
"ChatToolPlanDeltaEvent",
"ChatToolPlanDeltaEventDelta",
"ChatToolPlanDeltaEventDeltaMessage",
"ChatbotMessage",
"CheckApiKeyResponse",
"Citation",
Expand Down
4 changes: 2 additions & 2 deletions src/cohere/types/chat_tool_call_delta_event_delta.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
from .chat_tool_call_delta_event_delta_tool_call import ChatToolCallDeltaEventDeltaToolCall
from .chat_tool_call_delta_event_delta_message import ChatToolCallDeltaEventDeltaMessage
from ..core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic


class ChatToolCallDeltaEventDelta(UncheckedBaseModel):
tool_call: typing.Optional[ChatToolCallDeltaEventDeltaToolCall] = None
message: typing.Optional[ChatToolCallDeltaEventDeltaMessage] = None

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
from .chat_tool_call_start_event_delta_tool_call_function import ChatToolCallStartEventDeltaToolCallFunction
from .chat_tool_call_delta_event_delta_message_tool_calls import ChatToolCallDeltaEventDeltaMessageToolCalls
from ..core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic


class ChatToolCallStartEventDeltaToolCall(UncheckedBaseModel):
id: typing.Optional[str] = None
type: typing.Optional[typing.Literal["function"]] = None
function: typing.Optional[ChatToolCallStartEventDeltaToolCallFunction] = None
class ChatToolCallDeltaEventDeltaMessage(UncheckedBaseModel):
tool_calls: typing.Optional[ChatToolCallDeltaEventDeltaMessageToolCalls] = None

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This file was auto-generated by Fern from our API Definition.

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
from .chat_tool_call_delta_event_delta_message_tool_calls_function import (
ChatToolCallDeltaEventDeltaMessageToolCallsFunction,
)
from ..core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic


class ChatToolCallDeltaEventDeltaMessageToolCalls(UncheckedBaseModel):
function: typing.Optional[ChatToolCallDeltaEventDeltaMessageToolCallsFunction] = None

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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pydantic


class ChatToolCallDeltaEventDeltaToolCallFunction(UncheckedBaseModel):
class ChatToolCallDeltaEventDeltaMessageToolCallsFunction(UncheckedBaseModel):
arguments: typing.Optional[str] = None

if IS_PYDANTIC_V2:
Expand Down
4 changes: 2 additions & 2 deletions src/cohere/types/chat_tool_call_start_event_delta.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
from .chat_tool_call_start_event_delta_tool_call import ChatToolCallStartEventDeltaToolCall
from .chat_tool_call_start_event_delta_message import ChatToolCallStartEventDeltaMessage
from ..core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic


class ChatToolCallStartEventDelta(UncheckedBaseModel):
tool_call: typing.Optional[ChatToolCallStartEventDeltaToolCall] = None
message: typing.Optional[ChatToolCallStartEventDeltaMessage] = None

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
from .tool_call_v2 import ToolCallV2
from ..core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic


class ChatToolCallStartEventDeltaToolCallFunction(UncheckedBaseModel):
name: typing.Optional[str] = None
arguments: typing.Optional[str] = None
class ChatToolCallStartEventDeltaMessage(UncheckedBaseModel):
tool_calls: typing.Optional[ToolCallV2] = None

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
Expand Down
3 changes: 2 additions & 1 deletion src/cohere/types/chat_tool_plan_delta_event_delta.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
from .chat_tool_plan_delta_event_delta_message import ChatToolPlanDeltaEventDeltaMessage
from ..core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic


class ChatToolPlanDeltaEventDelta(UncheckedBaseModel):
tool_plan: typing.Optional[str] = None
message: typing.Optional[ChatToolPlanDeltaEventDeltaMessage] = None

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
from .chat_tool_call_delta_event_delta_tool_call_function import ChatToolCallDeltaEventDeltaToolCallFunction
from ..core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic


class ChatToolCallDeltaEventDeltaToolCall(UncheckedBaseModel):
function: typing.Optional[ChatToolCallDeltaEventDeltaToolCallFunction] = None
class ChatToolPlanDeltaEventDeltaMessage(UncheckedBaseModel):
tool_plan: typing.Optional[str] = None

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
Expand Down