Skip to content

Commit

Permalink
Release 0.2.38
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Dec 18, 2024
1 parent 0d8be96 commit ac5d45f
Show file tree
Hide file tree
Showing 35 changed files with 1,178 additions and 203 deletions.
19 changes: 15 additions & 4 deletions poetry.lock

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

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "vectara"
version = "0.2.37"
version = "0.2.38"
description = ""
readme = "README.md"
authors = []
Expand Down Expand Up @@ -34,6 +34,7 @@ Repository = 'https://github.com/vectara/python-sdk'
python = "^3.8"
PyYAML = "6.0.2"
httpx = ">=0.21.2"
httpx-sse = "0.4.0"
pydantic = ">= 1.9.2"
pydantic-core = "^2.18.2"
typing_extensions = ">= 4.0.0"
Expand Down
369 changes: 301 additions & 68 deletions reference.md

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions src/vectara/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
ApiRole,
AppClient,
BadRequestErrorBody,
Cell,
ChainReranker,
Chat,
ChatFullResponse,
Expand All @@ -29,6 +30,7 @@
CreateDocumentRequest,
CustomDimensions,
CustomerSpecificReranker,
Data,
Document,
DocumentPart,
DocumentStorageUsage,
Expand All @@ -43,6 +45,7 @@
GenerationParameters,
GenerationPreset,
GenerationSpan,
Header,
IndividualSearchResult,
Job,
JobState,
Expand Down Expand Up @@ -81,6 +84,7 @@
RerankSpan,
RerankedSearchResult,
Reranker,
Row,
SearchCorporaParameters,
SearchCorpus,
SearchParameters,
Expand All @@ -94,7 +98,10 @@
StreamSearchResponse,
StructuredDocument,
StructuredDocumentSection,
Table,
TableExtractionConfig,
Turn,
UpdateDocumentRequest,
User,
UserFunctionReranker,
)
Expand All @@ -108,6 +115,7 @@
documents,
encoders,
generation_presets,
index,
jobs,
llms,
query_history,
Expand All @@ -131,6 +139,7 @@
"AsyncVectara",
"BadRequestError",
"BadRequestErrorBody",
"Cell",
"ChainReranker",
"Chat",
"ChatFullResponse",
Expand All @@ -152,6 +161,7 @@
"CreateDocumentRequest",
"CustomDimensions",
"CustomerSpecificReranker",
"Data",
"Document",
"DocumentPart",
"DocumentStorageUsage",
Expand All @@ -168,6 +178,7 @@
"GenerationPreset",
"GenerationSpan",
"GetTokenResponse",
"Header",
"IndividualSearchResult",
"Job",
"JobState",
Expand Down Expand Up @@ -207,6 +218,7 @@
"RerankSpan",
"RerankedSearchResult",
"Reranker",
"Row",
"SearchCorporaParameters",
"SearchCorpus",
"SearchCorpusParameters",
Expand All @@ -221,7 +233,10 @@
"StreamSearchResponse",
"StructuredDocument",
"StructuredDocumentSection",
"Table",
"TableExtractionConfig",
"Turn",
"UpdateDocumentRequest",
"User",
"UserFunctionReranker",
"Vectara",
Expand All @@ -235,6 +250,7 @@
"documents",
"encoders",
"generation_presets",
"index",
"jobs",
"llms",
"query_history",
Expand Down
15 changes: 7 additions & 8 deletions src/vectara/chats/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from ..types.chat_parameters import ChatParameters
from ..types.chat_streamed_response import ChatStreamedResponse
from ..core.serialization import convert_and_respect_annotation_metadata
import httpx_sse
import json
from ..errors.bad_request_error import BadRequestError
from ..types.bad_request_error_body import BadRequestErrorBody
Expand Down Expand Up @@ -493,15 +494,14 @@ def create_turns_stream(
) as _response:
try:
if 200 <= _response.status_code < 300:
for _text in _response.iter_lines():
_event_source = httpx_sse.EventSource(_response)
for _sse in _event_source.iter_sse():
try:
if len(_text) == 0:
continue
yield typing.cast(
ChatStreamedResponse,
parse_obj_as(
type_=ChatStreamedResponse, # type: ignore
object_=json.loads(_text),
object_=json.loads(_sse.data),
),
)
except:
Expand Down Expand Up @@ -1455,15 +1455,14 @@ async def main() -> None:
) as _response:
try:
if 200 <= _response.status_code < 300:
async for _text in _response.aiter_lines():
_event_source = httpx_sse.EventSource(_response)
async for _sse in _event_source.aiter_sse():
try:
if len(_text) == 0:
continue
yield typing.cast(
ChatStreamedResponse,
parse_obj_as(
type_=ChatStreamedResponse, # type: ignore
object_=json.loads(_text),
object_=json.loads(_sse.data),
),
)
except:
Expand Down
2 changes: 1 addition & 1 deletion src/vectara/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": "vectara",
"X-Fern-SDK-Version": "0.2.37",
"X-Fern-SDK-Version": "0.2.38",
}
if self._api_key is not None:
headers["x-api-key"] = self._api_key
Expand Down
Loading

0 comments on commit ac5d45f

Please sign in to comment.