client.query_stream(...)
-
-
-
Perform a multipurpose query across to retrieve relevant information from one or more corpora and generate a response using Retrieval Augmented Generation (RAG).
- Specify the unique
corpus_key
identifying the corpus to query. Thecorpus_key
is created in the Vectara Console UI or the Create Corpus API definition. When creating a new corpus, you have the option to assign a customcorpus_key
following your preferred naming convention. This key serves as a unique identifier for the corpus, allowing it to be referenced in search requests. For more information, see Corpus Key Definition. - Customize your search by specifying the query text (
query
), pagination details (offset
andlimit
), and metadata filters (metadata_filter
) to tailor your search results. Learn more - Leverage advanced search capabilities like reranking (
reranker
) and opt-in Retrieval Augmented Generation (RAG) (generation
) for enhanced query performance. Generation is opt in by setting thegeneration
property. By excluding the property or by setting it to null, the response will not include generation. Learn more - Specify Vectara's RAG-focused LLM (Mockingbird) for the
generation_preset_name
. Learn more - Use advanced summarization options that utilize detailed summarization parameters such as
max_response_characters
,temperature
, andfrequency_penalty
for generating precise and relevant summaries. Learn more - Customize citation formats in summaries using the
citations
object to include numeric, HTML, or Markdown links. Learn more
For more detailed information, see this Query API guide.
- Specify the unique
-
-
-
from vectara import ( CitationParameters, ContextConfiguration, GenerationParameters, KeyedSearchCorpus, SearchCorporaParameters, Vectara, ) client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) response = client.query_stream( query="hello, world?", search=SearchCorporaParameters( corpora=[ KeyedSearchCorpus( lexical_interpolation=0.005, ) ], offset=0, limit=10, context_configuration=ContextConfiguration( sentences_before=2, sentences_after=2, start_tag="<em>", end_tag="</em>", ), ), generation=GenerationParameters( max_used_search_results=5, citations=CitationParameters( style="none", ), response_language="auto", ), ) for chunk in response: yield chunk
-
-
-
query:
str
— The search query string, which is the question the user is asking.
-
search:
SearchCorporaParameters
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
generation:
typing.Optional[GenerationParameters]
-
save_history:
typing.Optional[bool]
— Indicates whether to save the query in the query history.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.query(...)
-
-
-
Perform a multipurpose query across to retrieve relevant information from one or more corpora and generate a response using Retrieval Augmented Generation (RAG).
- Specify the unique
corpus_key
identifying the corpus to query. Thecorpus_key
is created in the Vectara Console UI or the Create Corpus API definition. When creating a new corpus, you have the option to assign a customcorpus_key
following your preferred naming convention. This key serves as a unique identifier for the corpus, allowing it to be referenced in search requests. For more information, see Corpus Key Definition. - Customize your search by specifying the query text (
query
), pagination details (offset
andlimit
), and metadata filters (metadata_filter
) to tailor your search results. Learn more - Leverage advanced search capabilities like reranking (
reranker
) and opt-in Retrieval Augmented Generation (RAG) (generation
) for enhanced query performance. Generation is opt in by setting thegeneration
property. By excluding the property or by setting it to null, the response will not include generation. Learn more - Specify Vectara's RAG-focused LLM (Mockingbird) for the
generation_preset_name
. Learn more - Use advanced summarization options that utilize detailed summarization parameters such as
max_response_characters
,temperature
, andfrequency_penalty
for generating precise and relevant summaries. Learn more - Customize citation formats in summaries using the
citations
object to include numeric, HTML, or Markdown links. Learn more
For more detailed information, see this Query API guide.
- Specify the unique
-
-
-
from vectara import 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:
str
— The search query string, which is the question the user is asking.
-
search:
SearchCorporaParameters
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
generation:
typing.Optional[GenerationParameters]
-
save_history:
typing.Optional[bool]
— Indicates whether to save the query in the query history.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.chat_stream(...)
-
-
-
Create a chat while specifying the default retrieval parameters used by the prompt.
-
-
-
from vectara import 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(), ) for chunk in response: yield chunk
-
-
-
query:
str
— The chat message or question.
-
search:
SearchCorporaParameters
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
generation:
typing.Optional[GenerationParameters]
-
chat:
typing.Optional[ChatParameters]
-
save_history:
typing.Optional[bool]
— Indicates whether to save the chat in both the chat and query history. This overrideschat.store
.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.chat(...)
-
-
-
Create a chat while specifying the default retrieval parameters used by the prompt.
-
-
-
from vectara import 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:
str
— The chat message or question.
-
search:
SearchCorporaParameters
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
generation:
typing.Optional[GenerationParameters]
-
chat:
typing.Optional[ChatParameters]
-
save_history:
typing.Optional[bool]
— Indicates whether to save the chat in both the chat and query history. This overrideschat.store
.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.corpora.list(...)
-
-
-
List corpora in the account. The returned corpus objects contain less detail compared to those retrieved the direct corpus retrieval operation.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) response = client.corpora.list( limit=1, ) for item in response: yield item # alternatively, you can paginate page-by-page for page in response.iter_pages(): yield page
-
-
-
limit:
typing.Optional[int]
— The maximum number of corpora to return at one time.
-
filter:
typing.Optional[str]
— A regular expression to filter the corpora by their name or summary.
-
page_key:
typing.Optional[str]
— Used to retrieve the next page of corpora after the limit has been reached.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.corpora.create(...)
-
-
-
Create a corpus, which is a container to store documents and associated metadata. Here, you define the unique
corpus_key
that identifies the corpus. Thecorpus_key
can be custom-defined following your preferred naming convention, allowing you to easily manage the corpus's data and reference it in queries. For more information, see Corpus Key Definition.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.corpora.create( key="my-corpus", )
-
-
-
key:
CorpusKey
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
name:
typing.Optional[str]
— The name for the corpus. This value defaults to the key.
-
description:
typing.Optional[str]
— Description of the corpus.
-
queries_are_answers:
typing.Optional[bool]
— Queries made to this corpus are considered answers, and not questions.
-
documents_are_questions:
typing.Optional[bool]
— Documents inside this corpus are considered questions, and not answers.
-
encoder_id:
typing.Optional[str]
— Deprecated: Useencoder_name
instead.
-
encoder_name:
typing.Optional[str]
— The encoder used by the corpus.
-
filter_attributes:
typing.Optional[typing.Sequence[FilterAttribute]]
The new filter attributes of the corpus. If unset then the corpus will not have filter attributes.
-
custom_dimensions:
typing.Optional[typing.Sequence[CorpusCustomDimension]]
A custom dimension is an additional numerical field attached to a document part. You can then multiply this numerical field with a query time custom dimension of the same name. This allows boosting (or burying) document parts for arbitrary reasons. This feature is only enabled for Pro and Enterprise customers.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.corpora.get(...)
-
-
-
Get metadata about a corpus. This operation does not search the corpus contents. Specify the
corpus_key
to identify the corpus whose metadata you want to retrieve. Thecorpus_key
is created when the corpus is set up, either through the Vectara Console UI or the Create Corpus API. For more information, see Corpus Key Definition.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.corpora.get( corpus_key="my-corpus", )
-
-
-
corpus_key:
CorpusKey
— The unique key identifying the corpus to retrieve.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.corpora.delete(...)
-
-
-
Permanently delete a corpus and all its associated data. The
corpus_key
uniquely identifies the corpus. For more information, see Corpus Key Definition.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.corpora.delete( corpus_key="my-corpus", )
-
-
-
corpus_key:
CorpusKey
— The unique key identifying the corpus to delete.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.corpora.update(...)
-
-
-
Enable, disable, or update the name and description of a corpus. This lets you manage data availability without deleting the corpus, which is useful for maintenance and security purposes. The
corpus_key
uniquely identifies the corpus. For more information, see Corpus Key Definition. Consider updating the name and description of a corpus dynamically to help keep your data aligned with changing business needs.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.corpora.update( corpus_key="my-corpus", )
-
-
-
corpus_key:
CorpusKey
— The unique key identifying the corpus to update.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
enabled:
typing.Optional[bool]
— Set whether or not the corpus is enabled. If unset then the corpus will remain in the same state.
-
name:
typing.Optional[str]
— The name for the corpus. If unset or null, then the corpus will remain in the same state.
-
description:
typing.Optional[str]
— Description of the corpus. If unset or null, then the corpus will remain in the same state.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.corpora.reset(...)
-
-
-
Resets a corpus, which removes all documents and data from the specified corpus, while keeping the corpus itself. The
corpus_key
uniquely identifies the corpus. For more information, see Corpus Key Definition.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.corpora.reset( corpus_key="my-corpus", )
-
-
-
corpus_key:
CorpusKey
— The unique key identifying the corpus to reset.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.corpora.replace_filter_attributes(...)
-
-
-
Replace the filter attributes of a corpus. This does not happen immediately, as this operation creates a job that completes asynchronously. These new filter attributes will not work until the job completes.
You can monitor the status of the filter change using the returned job ID. The
corpus_key
uniquely identifies the corpus. For more information, see Corpus Key Definition.
-
-
-
from vectara import FilterAttribute, Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.corpora.replace_filter_attributes( corpus_key="my-corpus", filter_attributes=[ FilterAttribute( name="Title", level="document", type="integer", ) ], )
-
-
-
corpus_key:
CorpusKey
— The unique key identifying the corpus having its filters replaced.
-
filter_attributes:
typing.Sequence[FilterAttribute]
— The new filter attributes.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.corpora.search(...)
-
-
-
Search a single corpus with a straightforward query request, specifying the corpus key and query parameters.
- Specify the unique
corpus_key
identifying the corpus to query. Thecorpus_key
is created in the Vectara Console UI or the Create Corpus API definition. When creating a new corpus, you have the option to assign a customcorpus_key
following your preferred naming convention. This key serves as a unique identifier for the corpus, allowing it to be referenced in search requests. For more information, see Corpus Key Definition. - Enter the search
query
string for the corpus, which is the question you want to ask. - Set the maximum number of results (
limit
) to return. Default: 10, minimum: 1 - Define the
offset
position from which to start in the result set.
For more detailed information, see this Query API guide.
- Specify the unique
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.corpora.search( corpus_key="my-corpus", query="query", )
-
-
-
corpus_key:
CorpusKey
— The unique key identifying the corpus to query.
-
query:
str
— The search query string for the corpus, which is the question the user is asking.
-
limit:
typing.Optional[int]
— The maximum number of results to return.
-
offset:
typing.Optional[int]
— The position from which to start in the result set.
-
save_history:
typing.Optional[bool]
— Indicates whether to save the query in the query history.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.corpora.query_stream(...)
-
-
-
Perform an advanced query on a specific corpus to find relevant results, highlight relevant snippets, and use Retrieval Augmented Generation:
- Specify the unique
corpus_key
identifying the corpus to query. Thecorpus_key
is created in the Vectara Console UI or the Create Corpus API definition. When creating a new corpus, you have the option to assign a customcorpus_key
following your preferred naming convention. This key serves as a unique identifier for the corpus, allowing it to be referenced in search requests. For more information, see Corpus Key Definition. - Customize your search by specifying the query text (
query
), pagination details (offset
andlimit
), and metadata filters (metadata_filter
) to tailor your search results. Learn more - Leverage advanced search capabilities like reranking (
reranker
) and Retrieval Augmented Generation (RAG) (generation
) for enhanced query performance. Generation is opt in by setting thegeneration
property. By excluding the property or by setting it to null, the response will not include generation. Learn more. - Use hybrid search to achieve optimal results by setting different values for
lexical_interpolation
(e.g.,0.025
). Learn more - Specify Vectara's RAG-focused LLM (Mockingbird) for the
generation_preset_name
. Learn more - Use advanced summarization options that utilize detailed summarization parameters such as
max_response_characters
,temperature
, andfrequency_penalty
for generating precise and relevant summaries. Learn more
For more detailed information, see Query API guide.
- Specify the unique
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) response = client.corpora.query_stream( corpus_key="my-corpus", query="query", ) for chunk in response: yield chunk
-
-
-
corpus_key:
CorpusKey
— The unique key identifying the corpus to query.
-
query:
str
— The search query string, which is the question the user is asking.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
search:
typing.Optional[SearchCorpusParameters]
— The parameters to search one corpus.
-
generation:
typing.Optional[GenerationParameters]
-
save_history:
typing.Optional[bool]
— Indicates whether to save the query in the query history.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.corpora.query(...)
-
-
-
Perform an advanced query on a specific corpus to find relevant results, highlight relevant snippets, and use Retrieval Augmented Generation:
- Specify the unique
corpus_key
identifying the corpus to query. Thecorpus_key
is created in the Vectara Console UI or the Create Corpus API definition. When creating a new corpus, you have the option to assign a customcorpus_key
following your preferred naming convention. This key serves as a unique identifier for the corpus, allowing it to be referenced in search requests. For more information, see Corpus Key Definition. - Customize your search by specifying the query text (
query
), pagination details (offset
andlimit
), and metadata filters (metadata_filter
) to tailor your search results. Learn more - Leverage advanced search capabilities like reranking (
reranker
) and Retrieval Augmented Generation (RAG) (generation
) for enhanced query performance. Generation is opt in by setting thegeneration
property. By excluding the property or by setting it to null, the response will not include generation. Learn more. - Use hybrid search to achieve optimal results by setting different values for
lexical_interpolation
(e.g.,0.025
). Learn more - Specify Vectara's RAG-focused LLM (Mockingbird) for the
generation_preset_name
. Learn more - Use advanced summarization options that utilize detailed summarization parameters such as
max_response_characters
,temperature
, andfrequency_penalty
for generating precise and relevant summaries. Learn more
For more detailed information, see Query API guide.
- Specify the unique
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.corpora.query( corpus_key="my-corpus", query="query", )
-
-
-
corpus_key:
CorpusKey
— The unique key identifying the corpus to query.
-
query:
str
— The search query string, which is the question the user is asking.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
search:
typing.Optional[SearchCorpusParameters]
— The parameters to search one corpus.
-
generation:
typing.Optional[GenerationParameters]
-
save_history:
typing.Optional[bool]
— Indicates whether to save the query in the query history.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.upload.file(...)
-
-
-
Upload files such as PDFs and Word Documents for automatic text extraction and metadata parsing. The request expects a
multipart/form-data
format containing the following parts:metadata
- (Optional) Specifies a JSON object representing any additional metadata to be associated with the extracted document. For example,'metadata={"key": "value"};type=application/json'
chunking_strategy
- (Optional) Specifies the chunking strategy for the platform to use. If you do not set this option, the platform uses the default strategy, which creates one chunk per sentence. For example,'chunking_strategy={"type":"max_chars_chunking_strategy","max_chars_per_chunk":200};type=application/json'
table_extraction_config
- (Optional) Specifies whether to extract table data from the uploaded file. If you do not set this option, the platform does not extract tables from PDF files. Example config,'table_extraction_config={"extract_tables":true};type=application/json'
file
- Specifies the file that you want to upload.filename
- Specified as part of the file field with the file name that you want to associate with the uploaded file. For a curl example, use the following syntax:'file=@/path/to/file/file.pdf;filename=desired_filename.pdf'
For more detailed information, see this File Upload API guide.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.upload.file( corpus_key="my-corpus", )
-
-
-
corpus_key:
CorpusKey
— The unique key identifying the corpus of which to upload the file.
-
file: `from future import annotations
core.File` — See core.File for more documentation
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
metadata:
typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
— Arbitrary object that will be attached as document metadata to the extracted document.
-
chunking_strategy:
typing.Optional[ComponentsSchemasMaxCharsChunkingStrategy]
-
table_extraction_config:
typing.Optional[TableExtractionConfig]
-
filename:
typing.Optional[str]
— Optional multipart section to override the filename.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.documents.list(...)
-
-
-
Retrieve a list of documents stored in a specific corpus. This endpoint provides an overview of document metadata without returning the full content of each document.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) response = client.documents.list( corpus_key="my-corpus", ) for item in response: yield item # alternatively, you can paginate page-by-page for page in response.iter_pages(): yield page
-
-
-
corpus_key:
CorpusKey
— The unique key identifying the queried corpus.
-
limit:
typing.Optional[int]
— The maximum number of documents to return at one time.
-
metadata_filter:
typing.Optional[str]
Filter documents by metadata. Uses the same expression as a query metadata filter, but only allows filtering on document metadata.
-
page_key:
typing.Optional[str]
— Used to retrieve the next page of documents after the limit has been reached.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.documents.create(...)
-
-
-
Add a document to a corpus. This endpoint supports two document formats, structured and core.
- Structured documents have a more conventional structure that provide document sections and parts in a format created by Vectara's proprietary strategy automatically. You provide a logical document structure, and Vectara handles the partitioning.
- Core documents differ in that they follow an advanced, granular structure that explicitly defines each document part in an array. Each part becomes a distinct, searchable item in query results. You have precise control over the document structure and content.
For more details, see Indexing.
-
-
-
from vectara import CoreDocument, CoreDocumentPart, Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.documents.create( corpus_key="my-corpus", request=CoreDocument( id="my-doc-id", document_parts=[ CoreDocumentPart( text="I'm a nice document part.", ) ], ), )
-
-
-
corpus_key:
CorpusKey
— The unique key identifying the queried corpus.
-
request:
CreateDocumentRequest
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.documents.get_corpus_document(...)
-
-
-
Retrieve the content and metadata of a specific document, identified by its unique
document_id
from a specific corpus.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.documents.get_corpus_document( corpus_key="my-corpus", document_id="document_id", )
-
-
-
corpus_key:
CorpusKey
— The unique key identifying the corpus containing the document to retrieve.
-
document_id:
str
The document ID of the document to retrieve. This
document_id
must be percent encoded.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.documents.delete(...)
-
-
-
Permanently delete a document identified by its unique
document_id
from a specific corpus. This operation cannot be undone, so use it with caution.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.documents.delete( corpus_key="my-corpus", document_id="document_id", )
-
-
-
corpus_key:
CorpusKey
— The unique key identifying the corpus with the document to delete.
-
document_id:
str
The document ID of the document to delete. This
document_id
must be percent encoded.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.index.update_corpus_document(...)
-
-
-
Updates document identified by its unique
document_id
from a specific corpus. The request body metadata is merged with the existing metadata, adding or modifying only the specified fields.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.index.update_corpus_document( corpus_key="my-corpus", document_id="document_id", )
-
-
-
corpus_key:
CorpusKey
— The unique key identifying the corpus with the document to update.
-
document_id:
str
The document ID of the document to update. This
document_id
must be percent encoded.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
metadata:
typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
The metadata for a document as an arbitrary object. Properties of this object can be used by document level filter attributes.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.index.replace_corpus_document_metadata(...)
-
-
-
Replaces metadata of a document identified by its unique
document_id
from a specific corpus.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.index.replace_corpus_document_metadata( corpus_key="my-corpus", document_id="document_id", )
-
-
-
corpus_key:
CorpusKey
— The unique key identifying the corpus with the document to update.
-
document_id:
str
The document ID of the document to update. This
document_id
must be percent encoded.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
metadata:
typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
The metadata for a document as an arbitrary object. Properties of this object can be used by document level filter attributes.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.chats.list(...)
-
-
-
Retrieve a list of previous chats in the Vectara account.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) response = client.chats.list() for item in response: yield item # alternatively, you can paginate page-by-page for page in response.iter_pages(): yield page
-
-
-
limit:
typing.Optional[int]
— The maximum number of results to return in the list.
-
page_key:
typing.Optional[str]
— Used to retrieve the next page of chats after the limit has been reached.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.chats.get(...)
-
-
-
Get a chat summary to view what started the chat, but not subsequent turns.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.chats.get( chat_id="chat_id", )
-
-
-
chat_id:
str
— The ID of the chat.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.chats.delete(...)
-
-
-
Delete a chat and any turns it contains permanently.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.chats.delete( chat_id="chat_id", )
-
-
-
chat_id:
str
— The ID of the chat.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.chats.list_turns(...)
-
-
-
List all turns in a chat to see all message and response pairs that make up the dialog.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.chats.list_turns( chat_id="chat_id", )
-
-
-
chat_id:
str
— The ID of the chat.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.chats.create_turns_stream(...)
-
-
-
Create a new turn in the chat. Each conversation has a series of
turn
objects, which are the sequence of message and response pairs that make up the dialog.
-
-
-
from vectara import SearchCorporaParameters, Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) response = client.chats.create_turns_stream( chat_id="chat_id", query="How can I use the Vectara platform?", search=SearchCorporaParameters(), ) for chunk in response: yield chunk
-
-
-
chat_id:
str
— The ID of the chat.
-
query:
str
— The chat message or question.
-
search:
SearchCorporaParameters
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
generation:
typing.Optional[GenerationParameters]
-
chat:
typing.Optional[ChatParameters]
-
save_history:
typing.Optional[bool]
— Indicates whether to save the chat in both the chat and query history. This overrideschat.store
.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.chats.create_turns(...)
-
-
-
Create a new turn in the chat. Each conversation has a series of
turn
objects, which are the sequence of message and response pairs that make up the dialog.
-
-
-
from vectara import SearchCorporaParameters, Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.chats.create_turns( chat_id="chat_id", query="How can I use the Vectara platform?", search=SearchCorporaParameters(), )
-
-
-
chat_id:
str
— The ID of the chat.
-
query:
str
— The chat message or question.
-
search:
SearchCorporaParameters
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
generation:
typing.Optional[GenerationParameters]
-
chat:
typing.Optional[ChatParameters]
-
save_history:
typing.Optional[bool]
— Indicates whether to save the chat in both the chat and query history. This overrideschat.store
.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.chats.get_turn(...)
-
-
-
Get a specific turn from a chat, which is a message and response pair from the conversation.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.chats.get_turn( chat_id="chat_id", turn_id="turn_id", )
-
-
-
chat_id:
str
— The ID of the chat.
-
turn_id:
str
— The ID of the turn.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.chats.delete_turn(...)
-
-
-
Delete a turn from a chat. This will delete all subsequent turns in the chat.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.chats.delete_turn( chat_id="chat_id", turn_id="turn_id", )
-
-
-
chat_id:
str
— The ID of the chat.
-
turn_id:
str
— The ID of the turn.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.chats.update_turn(...)
-
-
-
Update a turn; used to disable or enable a chat.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.chats.update_turn( chat_id="chat_id", turn_id="turn_id", )
-
-
-
chat_id:
str
— The ID of the chat.
-
turn_id:
str
— The ID of the turn.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
enabled:
typing.Optional[bool]
Indicates whether to disable a turn. It will disable this turn and all subsequent turns. Enabling a turn is not implemented.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.llms.list(...)
-
-
-
List LLMs that can be used with query and chat endpoints. The LLM is not directly specified in a query, but instead a
generation_preset_name
is used. Thegeneration_preset_name
property in generation parameters can be found as thename
property on the Generations Presets retrieved from/v2/generation_presets
.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) response = client.llms.list() for item in response: yield item # alternatively, you can paginate page-by-page for page in response.iter_pages(): yield page
-
-
-
filter:
typing.Optional[str]
— A regular expression to match names and descriptions of the LLMs.
-
limit:
typing.Optional[int]
— The maximum number of results to return in the list.
-
page_key:
typing.Optional[str]
Used to retrieve the next page of LLMs after the limit has been reached. This parameter is not needed for the first page of results.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.generation_presets.list_generation_presets(...)
-
-
-
List generation presets used for query or chat requests. Generation presets are the build of properties used to configure generation for a request. This includes the template that renders the prompt, and various generation settings like
temperature
.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.generation_presets.list_generation_presets()
-
-
-
llm_name:
typing.Optional[str]
— Filter presets by the LLM name.
-
limit:
typing.Optional[int]
— The maximum number of results to return in the list.
-
page_key:
typing.Optional[str]
Used to retrieve the next page of generation presets after the limit has been reached. This parameter is not needed for the first page of results.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.encoders.list(...)
-
-
-
Encoders are used to store and retrieve from a corpus.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) response = client.encoders.list( filter="vectara.*", ) for item in response: yield item # alternatively, you can paginate page-by-page for page in response.iter_pages(): yield page
-
-
-
filter:
typing.Optional[str]
— A regular expression against encoder names and descriptions.
-
limit:
typing.Optional[int]
— The maximum number of results to return in the list.
-
page_key:
typing.Optional[str]
— Used to retrieve the next page of encoders after the limit has been reached.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.rerankers.list(...)
-
-
-
Rerankers are used to improve the ranking (ordering) of search results.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) response = client.rerankers.list( filter="vectara.*", ) for item in response: yield item # alternatively, you can paginate page-by-page for page in response.iter_pages(): yield page
-
-
-
filter:
typing.Optional[str]
— A regular expression against reranker names and descriptions.
-
limit:
typing.Optional[int]
— The maximum number of rerankers to return in the list.
-
page_key:
typing.Optional[str]
— Used to retrieve the next page of rerankers after the limit has been reached.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.jobs.list(...)
-
-
-
List jobs for the account. Jobs are background processes like replacing the filterable metadata attributes.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) response = client.jobs.list() for item in response: yield item # alternatively, you can paginate page-by-page for page in response.iter_pages(): yield page
-
-
-
corpus_key:
typing.Optional[typing.Union[CorpusKey, typing.Sequence[CorpusKey]]]
— The unique key identifying the corpus with the job.
-
after:
typing.Optional[dt.datetime]
— Filter by jobs created after a particular date-time.
-
state:
typing.Optional[typing.Union[JobState, typing.Sequence[JobState]]]
— Filter by jobs in particular states.
-
limit:
typing.Optional[int]
— The maximum number of jobs to return at one time.
-
page_key:
typing.Optional[str]
— Used to retrieve the next page of jobs after the limit has been reached.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.jobs.get(...)
-
-
-
Get a job by a specific ID. Jobs are background processes like replacing the filterable metadata attributes.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.jobs.get( job_id="job_id", )
-
-
-
job_id:
str
— The ID of the job to get.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.users.list(...)
-
-
-
Lists all users in the account.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) response = client.users.list() for item in response: yield item # alternatively, you can paginate page-by-page for page in response.iter_pages(): yield page
-
-
-
limit:
typing.Optional[int]
— The maximum number of users to return at one time.
-
page_key:
typing.Optional[str]
— Used to retrieve the next page of users after the limit has been reached.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.users.create(...)
-
-
-
Create a user for the current customer account.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.users.create( email="email", )
-
-
-
email:
str
— The email address for the user.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
username:
typing.Optional[str]
— The username for the user. The value defaults to the email.
-
description:
typing.Optional[str]
— The description of the user.
-
api_roles:
typing.Optional[typing.Sequence[ApiRole]]
— The role names assigned to the user.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.users.get(...)
-
-
-
Get a user and view details like the email, username, and associated roles.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.users.get( username="username", )
-
-
-
username:
str
Specifies the user ID that to retrieve. Note that the username must be percent encoded.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.users.delete(...)
-
-
-
Delete a user from the account.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.users.delete( username="username", )
-
-
-
username:
str
Specifies the user ID to delete. Note that the username must be percent encoded.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.users.update(...)
-
-
-
Update details about a user such as role names.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.users.update( username="username", )
-
-
-
username:
str
Specifies the user ID to update. Note that the username must be percent encoded.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
enabled:
typing.Optional[bool]
— Indicates whether to enable or disable the user.
-
api_roles:
typing.Optional[typing.Sequence[ApiRole]]
— The new role names of the user.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.users.reset_password(...)
-
-
-
Reset the password for a user.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.users.reset_password( username="username", )
-
-
-
username:
str
Specifies the user ID to update. Note that the username must be percent encoded and URI safe.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.api_keys.list(...)
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) response = client.api_keys.list( corpus_key="my-corpus", ) for item in response: yield item # alternatively, you can paginate page-by-page for page in response.iter_pages(): yield page
-
-
-
limit:
typing.Optional[int]
— Max number of API keys to return at one time.
-
page_key:
typing.Optional[str]
— Used to retrieve the next page of API keys after the limit has been reached.
-
corpus_key:
typing.Optional[CorpusKey]
— Filters the API keys to only those with permissions on the specified corpus key.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.api_keys.create(...)
-
-
-
An API key is to authenticate when calling Vectara APIs.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.api_keys.create( name="name", api_key_role="serving", )
-
-
-
name:
str
— The human-readable name of the API key.
-
api_key_role:
ApiKeyRole
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
corpus_keys:
typing.Optional[typing.Sequence[CorpusKey]]
Corpora this API key has roles on if it is not a Personal API key. This property should be null or missing if this
api_key_role
ispersonal
.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.api_keys.get(...)
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.api_keys.get( api_key_id="api_key_id", )
-
-
-
api_key_id:
str
— The ID of the API key.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.api_keys.delete(...)
-
-
-
Delete API keys to help you manage the security and lifecycle of API keys in your application.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.api_keys.delete( api_key_id="api_key_id", )
-
-
-
api_key_id:
str
— The ID of the API key.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.api_keys.update(...)
-
-
-
Update an API key such as the roles attached to the key.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.api_keys.update( api_key_id="api_key_id", )
-
-
-
api_key_id:
str
— The ID of the API key.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
enabled:
typing.Optional[bool]
— Indicates whether to disable or enable an API key.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.app_clients.list(...)
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) response = client.app_clients.list() for item in response: yield item # alternatively, you can paginate page-by-page for page in response.iter_pages(): yield page
-
-
-
limit:
typing.Optional[int]
— The maximum number of App Clients to return at one time.
-
filter:
typing.Optional[str]
— Regular expression to filter the names of the App Clients.
-
page_key:
typing.Optional[str]
— Used to retrieve the next page of App Clients after the limit has been reached.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.app_clients.create(...)
-
-
-
An App Client is used for OAuth 2.0 authentication when calling Vectara APIs.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.app_clients.create( name="name", )
-
-
-
name:
str
— Name of the client credentials.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
description:
typing.Optional[str]
— Description of the client credentials.
-
api_roles:
typing.Optional[typing.Sequence[ApiRole]]
— API roles that the client credentials will have.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.app_clients.get(...)
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.app_clients.get( app_client_id="app_client_id", )
-
-
-
app_client_id:
str
— The ID of the App Client.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.app_clients.delete(...)
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.app_clients.delete( app_client_id="app_client_id", )
-
-
-
app_client_id:
str
— The ID of App Client.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.app_clients.update(...)
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.app_clients.update( app_client_id="app_client_id", )
-
-
-
app_client_id:
str
— The name of App Client.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
description:
typing.Optional[str]
— The new App Client description.
-
api_roles:
typing.Optional[typing.Sequence[ApiRole]]
— The new roles attached to the App Client. These roles will replace the current roles.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.query_history.get_query_history(...)
-
-
-
Retrieve a detailed history of previously executed query.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.query_history.get_query_history( query_id="query_id", )
-
-
-
query_id:
str
— The ID of the query history
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.query_history.get_query_histories(...)
-
-
-
Retrieve query histories.
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.query_history.get_query_histories()
-
-
-
corpus_key:
typing.Optional[str]
— Specifies thecorpus_key
used in the query.
-
started_after:
typing.Optional[dt.datetime]
— Queries that started after a particular date-time.
-
started_before:
typing.Optional[dt.datetime]
— Queries that started before a particular date-time.
-
chat_id:
typing.Optional[str]
— Specifies the chat_id of the query, this will return all queries in the specified chat.
-
limit:
typing.Optional[int]
— Specifies the maximum number of query history listed.
-
page_key:
typing.Optional[str]
— Used to retrieve the next page of query histories after the limit has been reached.
-
request_timeout:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified seconds or time out.
-
request_timeout_millis:
typing.Optional[int]
— The API will make a best effort to complete the request in the specified milliseconds or time out.
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-
client.auth.get_token(...)
-
-
-
Obtain an OAuth2 access token using client credentials
-
-
-
from vectara import Vectara client = Vectara( api_key="YOUR_API_KEY", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) client.auth.get_token( client_id="client_id", client_secret="client_secret", )
-
-
-
client_id:
str
— The client ID of the application
-
client_secret:
str
— The client secret of the application
-
request_options:
typing.Optional[RequestOptions]
— Request-specific configuration.
-
-