Skip to content

Commit 4a04731

Browse files
committed
SDK regeneration
1 parent 51c389d commit 4a04731

17 files changed

+649
-147
lines changed

poetry.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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.0.0a1"
3+
version = "5.0.0a2"
44
description = ""
55
readme = "README.md"
66
authors = []

src/cohere/__init__.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,25 @@
1212
ChatMessage,
1313
ChatMessageRole,
1414
ChatRequestCitationQuality,
15+
ChatRequestPromptOverride,
1516
ChatRequestPromptTruncation,
17+
ChatRequestSearchOptions,
1618
ChatSearchQueriesGenerationEvent,
1719
ChatSearchQuery,
1820
ChatSearchResult,
21+
ChatSearchResultConnector,
1922
ChatSearchResultsEvent,
2023
ChatStreamEndEvent,
2124
ChatStreamEndEventFinishReason,
2225
ChatStreamEndEventResponse,
2326
ChatStreamEvent,
2427
ChatStreamRequestCitationQuality,
28+
ChatStreamRequestPromptOverride,
2529
ChatStreamRequestPromptTruncation,
30+
ChatStreamRequestSearchOptions,
2631
ChatStreamStartEvent,
2732
ChatTextGenerationEvent,
28-
ClassifyRequestExamplesItem,
33+
ClassifyExample,
2934
ClassifyRequestTruncate,
3035
ClassifyResponse,
3136
ClassifyResponseClassificationsItem,
@@ -51,6 +56,7 @@
5156
EmbedJob,
5257
EmbedJobStatus,
5358
EmbedJobTruncate,
59+
EmbedRequestEmbeddingTypesItem,
5460
EmbedRequestTruncate,
5561
EmbedResponse,
5662
EmbedResponse_EmbeddingsByType,
@@ -75,6 +81,7 @@
7581
ListEmbedJobResponse,
7682
NonStreamedChatResponse,
7783
OAuthAuthorizeResponse,
84+
ParseInfo,
7885
RerankRequestDocumentsItem,
7986
RerankRequestDocumentsItemText,
8087
RerankResponse,
@@ -124,20 +131,25 @@
124131
"ChatMessage",
125132
"ChatMessageRole",
126133
"ChatRequestCitationQuality",
134+
"ChatRequestPromptOverride",
127135
"ChatRequestPromptTruncation",
136+
"ChatRequestSearchOptions",
128137
"ChatSearchQueriesGenerationEvent",
129138
"ChatSearchQuery",
130139
"ChatSearchResult",
140+
"ChatSearchResultConnector",
131141
"ChatSearchResultsEvent",
132142
"ChatStreamEndEvent",
133143
"ChatStreamEndEventFinishReason",
134144
"ChatStreamEndEventResponse",
135145
"ChatStreamEvent",
136146
"ChatStreamRequestCitationQuality",
147+
"ChatStreamRequestPromptOverride",
137148
"ChatStreamRequestPromptTruncation",
149+
"ChatStreamRequestSearchOptions",
138150
"ChatStreamStartEvent",
139151
"ChatTextGenerationEvent",
140-
"ClassifyRequestExamplesItem",
152+
"ClassifyExample",
141153
"ClassifyRequestTruncate",
142154
"ClassifyResponse",
143155
"ClassifyResponseClassificationsItem",
@@ -169,6 +181,7 @@
169181
"EmbedJob",
170182
"EmbedJobStatus",
171183
"EmbedJobTruncate",
184+
"EmbedRequestEmbeddingTypesItem",
172185
"EmbedRequestTruncate",
173186
"EmbedResponse",
174187
"EmbedResponse_EmbeddingsByType",
@@ -196,6 +209,7 @@
196209
"NonStreamedChatResponse",
197210
"NotFoundError",
198211
"OAuthAuthorizeResponse",
212+
"ParseInfo",
199213
"RerankRequestDocumentsItem",
200214
"RerankRequestDocumentsItemText",
201215
"RerankResponse",

src/cohere/client.py

Lines changed: 373 additions & 133 deletions
Large diffs are not rendered by default.

src/cohere/core/client_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def get_headers(self) -> typing.Dict[str, str]:
2121
headers: typing.Dict[str, str] = {
2222
"X-Fern-Language": "Python",
2323
"X-Fern-SDK-Name": "cohere",
24-
"X-Fern-SDK-Version": "5.0.0a1",
24+
"X-Fern-SDK-Version": "5.0.0a2",
2525
}
2626
if self._client_name is not None:
2727
headers["X-Client-Name"] = self._client_name

src/cohere/resources/datasets/types/datasets_get_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
class DatasetsGetResponse(pydantic.BaseModel):
16-
dataset: typing.Optional[Dataset]
16+
dataset: Dataset
1717

1818
def json(self, **kwargs: typing.Any) -> str:
1919
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}

src/cohere/types/__init__.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,25 @@
1111
from .chat_message import ChatMessage
1212
from .chat_message_role import ChatMessageRole
1313
from .chat_request_citation_quality import ChatRequestCitationQuality
14+
from .chat_request_prompt_override import ChatRequestPromptOverride
1415
from .chat_request_prompt_truncation import ChatRequestPromptTruncation
16+
from .chat_request_search_options import ChatRequestSearchOptions
1517
from .chat_search_queries_generation_event import ChatSearchQueriesGenerationEvent
1618
from .chat_search_query import ChatSearchQuery
1719
from .chat_search_result import ChatSearchResult
20+
from .chat_search_result_connector import ChatSearchResultConnector
1821
from .chat_search_results_event import ChatSearchResultsEvent
1922
from .chat_stream_end_event import ChatStreamEndEvent
2023
from .chat_stream_end_event_finish_reason import ChatStreamEndEventFinishReason
2124
from .chat_stream_end_event_response import ChatStreamEndEventResponse
2225
from .chat_stream_event import ChatStreamEvent
2326
from .chat_stream_request_citation_quality import ChatStreamRequestCitationQuality
27+
from .chat_stream_request_prompt_override import ChatStreamRequestPromptOverride
2428
from .chat_stream_request_prompt_truncation import ChatStreamRequestPromptTruncation
29+
from .chat_stream_request_search_options import ChatStreamRequestSearchOptions
2530
from .chat_stream_start_event import ChatStreamStartEvent
2631
from .chat_text_generation_event import ChatTextGenerationEvent
27-
from .classify_request_examples_item import ClassifyRequestExamplesItem
32+
from .classify_example import ClassifyExample
2833
from .classify_request_truncate import ClassifyRequestTruncate
2934
from .classify_response import ClassifyResponse
3035
from .classify_response_classifications_item import ClassifyResponseClassificationsItem
@@ -52,6 +57,7 @@
5257
from .embed_job import EmbedJob
5358
from .embed_job_status import EmbedJobStatus
5459
from .embed_job_truncate import EmbedJobTruncate
60+
from .embed_request_embedding_types_item import EmbedRequestEmbeddingTypesItem
5561
from .embed_request_truncate import EmbedRequestTruncate
5662
from .embed_response import EmbedResponse, EmbedResponse_EmbeddingsByType, EmbedResponse_EmbeddingsFloats
5763
from .finish_reason import FinishReason
@@ -76,6 +82,7 @@
7682
from .list_embed_job_response import ListEmbedJobResponse
7783
from .non_streamed_chat_response import NonStreamedChatResponse
7884
from .o_auth_authorize_response import OAuthAuthorizeResponse
85+
from .parse_info import ParseInfo
7986
from .rerank_request_documents_item import RerankRequestDocumentsItem
8087
from .rerank_request_documents_item_text import RerankRequestDocumentsItemText
8188
from .rerank_response import RerankResponse
@@ -113,20 +120,25 @@
113120
"ChatMessage",
114121
"ChatMessageRole",
115122
"ChatRequestCitationQuality",
123+
"ChatRequestPromptOverride",
116124
"ChatRequestPromptTruncation",
125+
"ChatRequestSearchOptions",
117126
"ChatSearchQueriesGenerationEvent",
118127
"ChatSearchQuery",
119128
"ChatSearchResult",
129+
"ChatSearchResultConnector",
120130
"ChatSearchResultsEvent",
121131
"ChatStreamEndEvent",
122132
"ChatStreamEndEventFinishReason",
123133
"ChatStreamEndEventResponse",
124134
"ChatStreamEvent",
125135
"ChatStreamRequestCitationQuality",
136+
"ChatStreamRequestPromptOverride",
126137
"ChatStreamRequestPromptTruncation",
138+
"ChatStreamRequestSearchOptions",
127139
"ChatStreamStartEvent",
128140
"ChatTextGenerationEvent",
129-
"ClassifyRequestExamplesItem",
141+
"ClassifyExample",
130142
"ClassifyRequestTruncate",
131143
"ClassifyResponse",
132144
"ClassifyResponseClassificationsItem",
@@ -152,6 +164,7 @@
152164
"EmbedJob",
153165
"EmbedJobStatus",
154166
"EmbedJobTruncate",
167+
"EmbedRequestEmbeddingTypesItem",
155168
"EmbedRequestTruncate",
156169
"EmbedResponse",
157170
"EmbedResponse_EmbeddingsByType",
@@ -176,6 +189,7 @@
176189
"ListEmbedJobResponse",
177190
"NonStreamedChatResponse",
178191
"OAuthAuthorizeResponse",
192+
"ParseInfo",
179193
"RerankRequestDocumentsItem",
180194
"RerankRequestDocumentsItemText",
181195
"RerankResponse",

src/cohere/types/chat_connector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ChatConnector(pydantic.BaseModel):
1616
The connector used for fetching documents.
1717
"""
1818

19-
id: str = pydantic.Field(description="The identifier of the connector. Currently only 'web-search' is supported.")
19+
id: str = pydantic.Field(description="The identifier of the connector.")
2020
user_access_token: typing.Optional[str] = pydantic.Field(
2121
description="An optional override to set the token that Cohere passes to the connector in the Authorization header."
2222
)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
8+
try:
9+
import pydantic.v1 as pydantic # type: ignore
10+
except ImportError:
11+
import pydantic # type: ignore
12+
13+
14+
class ChatRequestPromptOverride(pydantic.BaseModel):
15+
"""
16+
(internal) Overrides specified parts of the default Chat or RAG preamble. It is recommended that these options only be used in specific scenarios where the defaults are not adequate.
17+
"""
18+
19+
preamble: typing.Optional[typing.Any]
20+
task_description: typing.Optional[typing.Any]
21+
style_guide: typing.Optional[typing.Any]
22+
23+
def json(self, **kwargs: typing.Any) -> str:
24+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
25+
return super().json(**kwargs_with_defaults)
26+
27+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
28+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
29+
return super().dict(**kwargs_with_defaults)
30+
31+
class Config:
32+
frozen = True
33+
smart_union = True
34+
json_encoders = {dt.datetime: serialize_datetime}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
8+
try:
9+
import pydantic.v1 as pydantic # type: ignore
10+
except ImportError:
11+
import pydantic # type: ignore
12+
13+
14+
class ChatRequestSearchOptions(pydantic.BaseModel):
15+
"""
16+
(internal) Sets inference and model options for RAG search query and tool use generations. Defaults are used when options are not specified here, meaning that other parameters outside of search_options are ignored (such as model= or temperature=).
17+
"""
18+
19+
model: typing.Optional[typing.Any]
20+
temperature: typing.Optional[typing.Any]
21+
max_tokens: typing.Optional[typing.Any]
22+
preamble: typing.Optional[typing.Any]
23+
24+
def json(self, **kwargs: typing.Any) -> str:
25+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
26+
return super().json(**kwargs_with_defaults)
27+
28+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
29+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
30+
return super().dict(**kwargs_with_defaults)
31+
32+
class Config:
33+
frozen = True
34+
smart_union = True
35+
json_encoders = {dt.datetime: serialize_datetime}

0 commit comments

Comments
 (0)