Skip to content

Commit

Permalink
SDK regeneration
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Aug 29, 2024
1 parent 12f543f commit abf85c3
Show file tree
Hide file tree
Showing 18 changed files with 218 additions and 36 deletions.
47 changes: 24 additions & 23 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.8.1"
version = "5.9.0"
description = ""
readme = "README.md"
authors = []
Expand Down
4 changes: 2 additions & 2 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2298,8 +2298,8 @@ response = client.v2.chat_stream(
],
citations=[
Citation(
start="string",
end="string",
start=1,
end=1,
text="string",
sources=[
Source_Tool(
Expand Down
15 changes: 14 additions & 1 deletion src/cohere/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
ChatToolCallsChunkEvent,
ChatToolCallsGenerationEvent,
CheckApiKeyResponse,
CitationEndEvent,
CitationStartEvent,
CitationStartEventDelta,
CitationStartEventDeltaMessage,
ClassifyDataMetrics,
ClassifyExample,
ClassifyRequestTruncate,
Expand Down Expand Up @@ -153,7 +157,6 @@
)
from . import connectors, datasets, embed_jobs, finetuning, models, v2
from .aws_client import AwsClient
from .client_v2 import AsyncClientV2, ClientV2
from .bedrock_client import BedrockClient
from .client import AsyncClient, Client
from .datasets import (
Expand Down Expand Up @@ -206,12 +209,15 @@
Content_Document,
Content_Text,
DocumentContent,
DocumentContentDocument,
DocumentSource,
NonStreamedChatResponse2,
Source,
Source_Document,
Source_Tool,
StreamedChatResponse2,
StreamedChatResponse2_CitationEnd,
StreamedChatResponse2_CitationStart,
StreamedChatResponse2_ContentDelta,
StreamedChatResponse2_ContentEnd,
StreamedChatResponse2_ContentStart,
Expand Down Expand Up @@ -321,6 +327,10 @@
"ChatToolPlanDeltaEventDelta",
"CheckApiKeyResponse",
"Citation",
"CitationEndEvent",
"CitationStartEvent",
"CitationStartEventDelta",
"CitationStartEventDeltaMessage",
"ClassifyDataMetrics",
"ClassifyExample",
"ClassifyRequestTruncate",
Expand Down Expand Up @@ -356,6 +366,7 @@
"DeleteConnectorResponse",
"DetokenizeResponse",
"DocumentContent",
"DocumentContentDocument",
"DocumentSource",
"EmbedByTypeResponse",
"EmbedByTypeResponseEmbeddings",
Expand Down Expand Up @@ -430,6 +441,8 @@
"Source_Tool",
"StreamedChatResponse",
"StreamedChatResponse2",
"StreamedChatResponse2_CitationEnd",
"StreamedChatResponse2_CitationStart",
"StreamedChatResponse2_ContentDelta",
"StreamedChatResponse2_ContentEnd",
"StreamedChatResponse2_ContentStart",
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 @@ -25,7 +25,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.8.1",
"X-Fern-SDK-Version": "5.9.0",
}
if self._client_name is not None:
headers["X-Client-Name"] = self._client_name
Expand Down
8 changes: 8 additions & 0 deletions src/cohere/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
from .chat_tool_calls_chunk_event import ChatToolCallsChunkEvent
from .chat_tool_calls_generation_event import ChatToolCallsGenerationEvent
from .check_api_key_response import CheckApiKeyResponse
from .citation_end_event import CitationEndEvent
from .citation_start_event import CitationStartEvent
from .citation_start_event_delta import CitationStartEventDelta
from .citation_start_event_delta_message import CitationStartEventDeltaMessage
from .classify_data_metrics import ClassifyDataMetrics
from .classify_example import ClassifyExample
from .classify_request_truncate import ClassifyRequestTruncate
Expand Down Expand Up @@ -166,6 +170,10 @@
"ChatToolCallsChunkEvent",
"ChatToolCallsGenerationEvent",
"CheckApiKeyResponse",
"CitationEndEvent",
"CitationStartEvent",
"CitationStartEventDelta",
"CitationStartEventDeltaMessage",
"ClassifyDataMetrics",
"ClassifyExample",
"ClassifyRequestTruncate",
Expand Down
25 changes: 25 additions & 0 deletions src/cohere/types/citation_end_event.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic

from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..v2.types.chat_stream_event_type import ChatStreamEventType


class CitationEndEvent(ChatStreamEventType):
"""
A streamed event which signifies a citation has finished streaming.
"""

index: typing.Optional[int] = None

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:

class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
27 changes: 27 additions & 0 deletions src/cohere/types/citation_start_event.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic

from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..v2.types.chat_stream_event_type import ChatStreamEventType
from .citation_start_event_delta import CitationStartEventDelta


class CitationStartEvent(ChatStreamEventType):
"""
A streamed event which signifies a citation has been created.
"""

index: typing.Optional[int] = None
delta: typing.Optional[CitationStartEventDelta] = None

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:

class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
22 changes: 22 additions & 0 deletions src/cohere/types/citation_start_event_delta.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic

from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .citation_start_event_delta_message import CitationStartEventDeltaMessage


class CitationStartEventDelta(UncheckedBaseModel):
message: typing.Optional[CitationStartEventDeltaMessage] = None

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:

class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
22 changes: 22 additions & 0 deletions src/cohere/types/citation_start_event_delta_message.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic

from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from ..v2.types.citation import Citation


class CitationStartEventDeltaMessage(UncheckedBaseModel):
citations: typing.Optional[Citation] = None

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:

class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
6 changes: 6 additions & 0 deletions src/cohere/v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,15 @@
Content_Document,
Content_Text,
DocumentContent,
DocumentContentDocument,
DocumentSource,
NonStreamedChatResponse2,
Source,
Source_Document,
Source_Tool,
StreamedChatResponse2,
StreamedChatResponse2_CitationEnd,
StreamedChatResponse2_CitationStart,
StreamedChatResponse2_ContentDelta,
StreamedChatResponse2_ContentEnd,
StreamedChatResponse2_ContentStart,
Expand Down Expand Up @@ -124,12 +127,15 @@
"Content_Document",
"Content_Text",
"DocumentContent",
"DocumentContentDocument",
"DocumentSource",
"NonStreamedChatResponse2",
"Source",
"Source_Document",
"Source_Tool",
"StreamedChatResponse2",
"StreamedChatResponse2_CitationEnd",
"StreamedChatResponse2_CitationStart",
"StreamedChatResponse2_ContentDelta",
"StreamedChatResponse2_ContentEnd",
"StreamedChatResponse2_ContentStart",
Expand Down
8 changes: 4 additions & 4 deletions src/cohere/v2/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ def chat_stream(
],
citations=[
Citation(
start="string",
end="string",
start=1,
end=1,
text="string",
sources=[
Source_Tool(
Expand Down Expand Up @@ -580,8 +580,8 @@ async def main() -> None:
],
citations=[
Citation(
start="string",
end="string",
start=1,
end=1,
text="string",
sources=[
Source_Tool(
Expand Down
Loading

0 comments on commit abf85c3

Please sign in to comment.