Skip to content
Closed
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
6 changes: 3 additions & 3 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
Expand Up @@ -3,7 +3,7 @@ name = "cohere"

[tool.poetry]
name = "cohere"
version = "5.17.1"
version = "6.0.0"
description = ""
readme = "README.md"
authors = []
Expand Down
4 changes: 2 additions & 2 deletions src/cohere/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ def __init__(

def get_headers(self) -> typing.Dict[str, str]:
headers: typing.Dict[str, str] = {
"User-Agent": "cohere/5.17.1",
"User-Agent": "cohere/6.0.0",
"X-Fern-Language": "Python",
"X-Fern-SDK-Name": "cohere",
"X-Fern-SDK-Version": "5.17.1",
"X-Fern-SDK-Version": "6.0.0",
}
if self._client_name is not None:
headers["X-Client-Name"] = self._client_name
Expand Down
12 changes: 6 additions & 6 deletions src/cohere/finetuning/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ def create_finetuned_model(
)
client.finetuning.create_finetuned_model(
request=FinetunedModel(
name="api-test",
name="name",
settings=Settings(
base_model=BaseModel(
base_type="BASE_TYPE_CHAT",
base_type="BASE_TYPE_UNSPECIFIED",
),
dataset_id="my-dataset-id",
dataset_id="dataset_id",
),
),
)
Expand Down Expand Up @@ -478,12 +478,12 @@ async def create_finetuned_model(
async def main() -> None:
await client.finetuning.create_finetuned_model(
request=FinetunedModel(
name="api-test",
name="name",
settings=Settings(
base_model=BaseModel(
base_type="BASE_TYPE_CHAT",
base_type="BASE_TYPE_UNSPECIFIED",
),
dataset_id="my-dataset-id",
dataset_id="dataset_id",
),
),
)
Expand Down
32 changes: 0 additions & 32 deletions src/cohere/v2/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ def chat_stream(
logprobs: typing.Optional[bool] = OMIT,
tool_choice: typing.Optional[V2ChatStreamRequestToolChoice] = OMIT,
thinking: typing.Optional[Thinking] = OMIT,
raw_prompting: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> typing.Iterator[V2ChatStreamResponse]:
"""
Expand Down Expand Up @@ -159,12 +158,6 @@ def chat_stream(

thinking : typing.Optional[Thinking]

raw_prompting : typing.Optional[bool]
When enabled, the user's prompt will be sent to the model without
any pre-processing.

Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Expand Down Expand Up @@ -212,7 +205,6 @@ def chat_stream(
logprobs=logprobs,
tool_choice=tool_choice,
thinking=thinking,
raw_prompting=raw_prompting,
request_options=request_options,
) as r:
yield from r.data
Expand All @@ -239,7 +231,6 @@ def chat(
logprobs: typing.Optional[bool] = OMIT,
tool_choice: typing.Optional[V2ChatRequestToolChoice] = OMIT,
thinking: typing.Optional[Thinking] = OMIT,
raw_prompting: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> V2ChatResponse:
"""
Expand Down Expand Up @@ -332,12 +323,6 @@ def chat(

thinking : typing.Optional[Thinking]

raw_prompting : typing.Optional[bool]
When enabled, the user's prompt will be sent to the model without
any pre-processing.

Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Expand Down Expand Up @@ -383,7 +368,6 @@ def chat(
logprobs=logprobs,
tool_choice=tool_choice,
thinking=thinking,
raw_prompting=raw_prompting,
request_options=request_options,
)
return _response.data
Expand Down Expand Up @@ -602,7 +586,6 @@ async def chat_stream(
logprobs: typing.Optional[bool] = OMIT,
tool_choice: typing.Optional[V2ChatStreamRequestToolChoice] = OMIT,
thinking: typing.Optional[Thinking] = OMIT,
raw_prompting: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> typing.AsyncIterator[V2ChatStreamResponse]:
"""
Expand Down Expand Up @@ -695,12 +678,6 @@ async def chat_stream(

thinking : typing.Optional[Thinking]

raw_prompting : typing.Optional[bool]
When enabled, the user's prompt will be sent to the model without
any pre-processing.

Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Expand Down Expand Up @@ -756,7 +733,6 @@ async def main() -> None:
logprobs=logprobs,
tool_choice=tool_choice,
thinking=thinking,
raw_prompting=raw_prompting,
request_options=request_options,
) as r:
async for _chunk in r.data:
Expand Down Expand Up @@ -784,7 +760,6 @@ async def chat(
logprobs: typing.Optional[bool] = OMIT,
tool_choice: typing.Optional[V2ChatRequestToolChoice] = OMIT,
thinking: typing.Optional[Thinking] = OMIT,
raw_prompting: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> V2ChatResponse:
"""
Expand Down Expand Up @@ -877,12 +852,6 @@ async def chat(

thinking : typing.Optional[Thinking]

raw_prompting : typing.Optional[bool]
When enabled, the user's prompt will be sent to the model without
any pre-processing.

Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Expand Down Expand Up @@ -936,7 +905,6 @@ async def main() -> None:
logprobs=logprobs,
tool_choice=tool_choice,
thinking=thinking,
raw_prompting=raw_prompting,
request_options=request_options,
)
return _response.data
Expand Down
32 changes: 0 additions & 32 deletions src/cohere/v2/raw_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ def chat_stream(
logprobs: typing.Optional[bool] = OMIT,
tool_choice: typing.Optional[V2ChatStreamRequestToolChoice] = OMIT,
thinking: typing.Optional[Thinking] = OMIT,
raw_prompting: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> typing.Iterator[HttpResponse[typing.Iterator[V2ChatStreamResponse]]]:
"""
Expand Down Expand Up @@ -168,12 +167,6 @@ def chat_stream(

thinking : typing.Optional[Thinking]

raw_prompting : typing.Optional[bool]
When enabled, the user's prompt will be sent to the model without
any pre-processing.

Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Expand Down Expand Up @@ -217,7 +210,6 @@ def chat_stream(
"thinking": convert_and_respect_annotation_metadata(
object_=thinking, annotation=Thinking, direction="write"
),
"raw_prompting": raw_prompting,
"stream": True,
},
headers={
Expand Down Expand Up @@ -413,7 +405,6 @@ def chat(
logprobs: typing.Optional[bool] = OMIT,
tool_choice: typing.Optional[V2ChatRequestToolChoice] = OMIT,
thinking: typing.Optional[Thinking] = OMIT,
raw_prompting: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> HttpResponse[V2ChatResponse]:
"""
Expand Down Expand Up @@ -506,12 +497,6 @@ def chat(

thinking : typing.Optional[Thinking]

raw_prompting : typing.Optional[bool]
When enabled, the user's prompt will be sent to the model without
any pre-processing.

Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Expand Down Expand Up @@ -555,7 +540,6 @@ def chat(
"thinking": convert_and_respect_annotation_metadata(
object_=thinking, annotation=Thinking, direction="write"
),
"raw_prompting": raw_prompting,
"stream": False,
},
headers={
Expand Down Expand Up @@ -1187,7 +1171,6 @@ async def chat_stream(
logprobs: typing.Optional[bool] = OMIT,
tool_choice: typing.Optional[V2ChatStreamRequestToolChoice] = OMIT,
thinking: typing.Optional[Thinking] = OMIT,
raw_prompting: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[V2ChatStreamResponse]]]:
"""
Expand Down Expand Up @@ -1280,12 +1263,6 @@ async def chat_stream(

thinking : typing.Optional[Thinking]

raw_prompting : typing.Optional[bool]
When enabled, the user's prompt will be sent to the model without
any pre-processing.

Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Expand Down Expand Up @@ -1329,7 +1306,6 @@ async def chat_stream(
"thinking": convert_and_respect_annotation_metadata(
object_=thinking, annotation=Thinking, direction="write"
),
"raw_prompting": raw_prompting,
"stream": True,
},
headers={
Expand Down Expand Up @@ -1525,7 +1501,6 @@ async def chat(
logprobs: typing.Optional[bool] = OMIT,
tool_choice: typing.Optional[V2ChatRequestToolChoice] = OMIT,
thinking: typing.Optional[Thinking] = OMIT,
raw_prompting: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncHttpResponse[V2ChatResponse]:
"""
Expand Down Expand Up @@ -1618,12 +1593,6 @@ async def chat(

thinking : typing.Optional[Thinking]

raw_prompting : typing.Optional[bool]
When enabled, the user's prompt will be sent to the model without
any pre-processing.

Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Expand Down Expand Up @@ -1667,7 +1636,6 @@ async def chat(
"thinking": convert_and_respect_annotation_metadata(
object_=thinking, annotation=Thinking, direction="write"
),
"raw_prompting": raw_prompting,
"stream": False,
},
headers={
Expand Down