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 Dec 20, 2024
1 parent 3f5eeaf commit 0e02426
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 25 deletions.
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 = "vectara"
version = "0.2.40"
version = "0.2.42"
description = ""
readme = "README.md"
authors = []
Expand Down
136 changes: 113 additions & 23 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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="<em>",
end_tag="</em>",
),
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:
Expand Down Expand Up @@ -189,16 +187,42 @@ For more detailed information, see this [Query API guide](https://docs.vectara.c
<dd>

```python
from vectara import SearchCorporaParameters, Vectara
from vectara import (
ContextConfiguration,
CustomerSpecificReranker,
GenerationParameters,
KeyedSearchCorpus,
SearchCorporaParameters,
Vectara,
)

client = Vectara(
api_key="YOUR_API_KEY",
client_id="YOUR_CLIENT_ID",
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,
),
)

```
Expand Down Expand Up @@ -302,16 +326,50 @@ Create a chat while specifying the default retrieval parameters used by the prom
<dd>

```python
from vectara import SearchCorporaParameters, Vectara
from vectara import (
ChatParameters,
CitationParameters,
ContextConfiguration,
CustomerSpecificReranker,
GenerationParameters,
KeyedSearchCorpus,
SearchCorporaParameters,
Vectara,
)

client = Vectara(
api_key="YOUR_API_KEY",
client_id="YOUR_CLIENT_ID",
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
Expand Down Expand Up @@ -425,16 +483,50 @@ Create a chat while specifying the default retrieval parameters used by the prom
<dd>

```python
from vectara import SearchCorporaParameters, Vectara
from vectara import (
ChatParameters,
CitationParameters,
ContextConfiguration,
CustomerSpecificReranker,
GenerationParameters,
KeyedSearchCorpus,
SearchCorporaParameters,
Vectara,
)

client = Vectara(
api_key="YOUR_API_KEY",
client_id="YOUR_CLIENT_ID",
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,
),
)

```
Expand Down Expand Up @@ -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
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.40",
"X-Fern-SDK-Version": "0.2.42",
}
if self._api_key is not None:
headers["x-api-key"] = self._api_key
Expand Down

0 comments on commit 0e02426

Please sign in to comment.