From 0e0242671537c94d79cfab575cb90847bc1d4a9a Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 20 Dec 2024 16:58:10 +0000 Subject: [PATCH] SDK regeneration --- pyproject.toml | 2 +- reference.md | 136 ++++++++++++++++++++++++----- src/vectara/core/client_wrapper.py | 2 +- 3 files changed, 115 insertions(+), 25 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8609e15..6a4de20 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "vectara" -version = "0.2.40" +version = "0.2.42" description = "" readme = "README.md" authors = [] diff --git a/reference.md b/reference.md index 932445d..7a92f8a 100644 --- a/reference.md +++ b/reference.md @@ -37,8 +37,8 @@ For more detailed information, see this [Query API guide](https://docs.vectara.c ```python from vectara import ( - CitationParameters, ContextConfiguration, + CustomerSpecificReranker, GenerationParameters, KeyedSearchCorpus, SearchCorporaParameters, @@ -51,28 +51,26 @@ client = Vectara( client_secret="YOUR_CLIENT_SECRET", ) response = client.query_stream( - query="hello, world?", + query="What is a hallucination?", search=SearchCorporaParameters( corpora=[ KeyedSearchCorpus( + corpus_key="corpus_key", + metadata_filter="", lexical_interpolation=0.005, ) ], - offset=0, - limit=10, context_configuration=ContextConfiguration( sentences_before=2, sentences_after=2, - start_tag="", - end_tag="", + ), + reranker=CustomerSpecificReranker( + reranker_id="rnk_272725719", ), ), generation=GenerationParameters( - max_used_search_results=5, - citations=CitationParameters( - style="none", - ), - response_language="auto", + response_language="eng", + enable_factual_consistency_score=True, ), ) for chunk in response: @@ -189,7 +187,14 @@ For more detailed information, see this [Query API guide](https://docs.vectara.c
```python -from vectara import SearchCorporaParameters, Vectara +from vectara import ( + ContextConfiguration, + CustomerSpecificReranker, + GenerationParameters, + KeyedSearchCorpus, + SearchCorporaParameters, + Vectara, +) client = Vectara( api_key="YOUR_API_KEY", @@ -197,8 +202,27 @@ client = Vectara( client_secret="YOUR_CLIENT_SECRET", ) client.query( - query="Am I allowed to bring pets to work?", - search=SearchCorporaParameters(), + query="What is a hallucination?", + search=SearchCorporaParameters( + corpora=[ + KeyedSearchCorpus( + corpus_key="corpus_key", + metadata_filter="", + lexical_interpolation=0.005, + ) + ], + context_configuration=ContextConfiguration( + sentences_before=2, + sentences_after=2, + ), + reranker=CustomerSpecificReranker( + reranker_id="rnk_272725719", + ), + ), + generation=GenerationParameters( + response_language="eng", + enable_factual_consistency_score=True, + ), ) ``` @@ -302,7 +326,16 @@ Create a chat while specifying the default retrieval parameters used by the prom
```python -from vectara import SearchCorporaParameters, Vectara +from vectara import ( + ChatParameters, + CitationParameters, + ContextConfiguration, + CustomerSpecificReranker, + GenerationParameters, + KeyedSearchCorpus, + SearchCorporaParameters, + Vectara, +) client = Vectara( api_key="YOUR_API_KEY", @@ -310,8 +343,33 @@ client = Vectara( client_secret="YOUR_CLIENT_SECRET", ) response = client.chat_stream( - query="How can I use the Vectara platform?", - search=SearchCorporaParameters(), + query="What is a hallucination?", + search=SearchCorporaParameters( + corpora=[ + KeyedSearchCorpus( + corpus_key="corpus_key", + metadata_filter="", + lexical_interpolation=0.005, + ) + ], + context_configuration=ContextConfiguration( + sentences_before=2, + sentences_after=2, + ), + reranker=CustomerSpecificReranker( + reranker_id="rnk_272725719", + ), + ), + generation=GenerationParameters( + response_language="eng", + citations=CitationParameters( + style="none", + ), + enable_factual_consistency_score=True, + ), + chat=ChatParameters( + store=True, + ), ) for chunk in response: yield chunk @@ -425,7 +483,16 @@ Create a chat while specifying the default retrieval parameters used by the prom
```python -from vectara import SearchCorporaParameters, Vectara +from vectara import ( + ChatParameters, + CitationParameters, + ContextConfiguration, + CustomerSpecificReranker, + GenerationParameters, + KeyedSearchCorpus, + SearchCorporaParameters, + Vectara, +) client = Vectara( api_key="YOUR_API_KEY", @@ -433,8 +500,33 @@ client = Vectara( client_secret="YOUR_CLIENT_SECRET", ) client.chat( - query="How can I use the Vectara platform?", - search=SearchCorporaParameters(), + query="What is a hallucination?", + search=SearchCorporaParameters( + corpora=[ + KeyedSearchCorpus( + corpus_key="corpus_key", + metadata_filter="", + lexical_interpolation=0.005, + ) + ], + context_configuration=ContextConfiguration( + sentences_before=2, + sentences_after=2, + ), + reranker=CustomerSpecificReranker( + reranker_id="rnk_272725719", + ), + ), + generation=GenerationParameters( + response_language="eng", + enable_factual_consistency_score=True, + citations=CitationParameters( + style="none", + ), + ), + chat=ChatParameters( + store=True, + ), ) ``` @@ -555,9 +647,7 @@ client = Vectara( client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) -response = client.corpora.list( - limit=1, -) +response = client.corpora.list() for item in response: yield item # alternatively, you can paginate page-by-page diff --git a/src/vectara/core/client_wrapper.py b/src/vectara/core/client_wrapper.py index 8531d24..d15d896 100644 --- a/src/vectara/core/client_wrapper.py +++ b/src/vectara/core/client_wrapper.py @@ -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.40", + "X-Fern-SDK-Version": "0.2.42", } if self._api_key is not None: headers["x-api-key"] = self._api_key