Skip to content

Latest commit

 

History

History
3871 lines (2687 loc) · 51.5 KB

reference.md

File metadata and controls

3871 lines (2687 loc) · 51.5 KB

Reference

client.chat({ ...params }) -> Vectara.ChatFullResponse

📝 Description

Create a chat while specifying the default retrieval parameters used by the prompt.

🔌 Usage

await client.chat({
    query: "What is a hallucination?",
    search: {
        corpora: [
            {
                corpusKey: "corpus_key",
                metadataFilter: "",
                lexicalInterpolation: 0.005,
            },
        ],
        contextConfiguration: {
            sentencesBefore: 2,
            sentencesAfter: 2,
        },
        reranker: {
            type: "customer_reranker",
            rerankerId: "rnk_272725719",
        },
    },
    generation: {
        responseLanguage: "eng",
        enableFactualConsistencyScore: true,
        citations: {
            style: "none",
        },
    },
    chat: {
        store: true,
    },
});

⚙️ Parameters

request: Vectara.ChatRequest

requestOptions: VectaraClient.RequestOptions

Corpora

client.corpora.list({ ...params }) -> core.Page

📝 Description

List corpora in the account. The returned corpus objects contain less detail compared to those retrieved the direct corpus retrieval operation.

🔌 Usage

const response = await client.corpora.list();
for await (const item of response) {
    console.log(item);
}

// Or you can manually iterate page-by-page
const page = await client.corpora.list();
while (page.hasNextPage()) {
    page = page.getNextPage();
}

⚙️ Parameters

request: Vectara.CorporaListRequest

requestOptions: Corpora.RequestOptions

client.corpora.create({ ...params }) -> Vectara.Corpus

📝 Description

Create a corpus, which is a container to store documents and associated metadata. Here, you define the unique corpus_key that identifies the corpus. The corpus_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.

🔌 Usage

await client.corpora.create({
    key: "my-corpus",
});

⚙️ Parameters

request: Vectara.CreateCorpusRequest

requestOptions: Corpora.RequestOptions

client.corpora.get(corpusKey, { ...params }) -> Vectara.Corpus

📝 Description

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. The corpus_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.

🔌 Usage

await client.corpora.get("my-corpus");

⚙️ Parameters

corpusKey: Vectara.CorpusKey — The unique key identifying the corpus to retrieve.

request: Vectara.CorporaGetRequest

requestOptions: Corpora.RequestOptions

client.corpora.delete(corpusKey, { ...params }) -> void

📝 Description

Permanently delete a corpus and all its associated data. The corpus_key uniquely identifies the corpus. For more information, see Corpus Key Definition.

🔌 Usage

await client.corpora.delete("my-corpus");

⚙️ Parameters

corpusKey: Vectara.CorpusKey — The unique key identifying the corpus to delete.

request: Vectara.CorporaDeleteRequest

requestOptions: Corpora.RequestOptions

client.corpora.update(corpusKey, { ...params }) -> Vectara.Corpus

📝 Description

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.

🔌 Usage

await client.corpora.update("my-corpus");

⚙️ Parameters

corpusKey: Vectara.CorpusKey — The unique key identifying the corpus to update.

request: Vectara.UpdateCorpusRequest

requestOptions: Corpora.RequestOptions

client.corpora.reset(corpusKey, { ...params }) -> void

📝 Description

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.

🔌 Usage

await client.corpora.reset("my-corpus");

⚙️ Parameters

corpusKey: Vectara.CorpusKey — The unique key identifying the corpus to reset.

request: Vectara.CorporaResetRequest

requestOptions: Corpora.RequestOptions

client.corpora.replaceFilterAttributes(corpusKey, { ...params }) -> Vectara.ReplaceFilterAttributesResponse

📝 Description

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.

🔌 Usage

await client.corpora.replaceFilterAttributes("my-corpus", {
    filterAttributes: [
        {
            name: "Title",
            level: "document",
            type: "integer",
        },
    ],
});

⚙️ Parameters

corpusKey: Vectara.CorpusKey — The unique key identifying the corpus having its filters replaced.

request: Vectara.ReplaceFilterAttributesRequest

requestOptions: Corpora.RequestOptions

client.corpora.search(corpusKey, { ...params }) -> Vectara.QueryFullResponse

📝 Description

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. The corpus_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 custom corpus_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.

🔌 Usage

await client.corpora.search("my-corpus", {
    query: "query",
});

⚙️ Parameters

corpusKey: Vectara.CorpusKey — The unique key identifying the corpus to query.

request: Vectara.CorporaSearchRequest

requestOptions: Corpora.RequestOptions

client.corpora.queryStream(corpusKey, { ...params }) -> core.Stream

📝 Description

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. The corpus_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 custom corpus_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 and limit), 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 the generation 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, and frequency_penalty for generating precise and relevant summaries. Learn more

For more detailed information, see Query API guide.

🔌 Usage

const response = await client.corpora.queryStream("my-corpus", {
    query: "query",
});
for await (const item of response) {
    console.log(item);
}

⚙️ Parameters

corpusKey: Vectara.CorpusKey — The unique key identifying the corpus to query.

request: Vectara.CorporaQueryStreamRequest

requestOptions: Corpora.RequestOptions

client.corpora.query(corpusKey, { ...params }) -> Vectara.QueryFullResponse

📝 Description

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. The corpus_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 custom corpus_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 and limit), 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 the generation 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, and frequency_penalty for generating precise and relevant summaries. Learn more

For more detailed information, see Query API guide.

🔌 Usage

await client.corpora.query("my-corpus", {
    query: "query",
});

⚙️ Parameters

corpusKey: Vectara.CorpusKey — The unique key identifying the corpus to query.

request: Vectara.CorporaQueryRequest

requestOptions: Corpora.RequestOptions

Upload

client.upload.file(file, corpusKey, { ...params }) -> Vectara.Document

📝 Description

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.

🔌 Usage

await client.upload.file(fs.createReadStream("/path/to/your/file"), "my-corpus", {});

⚙️ Parameters

file: File | fs.ReadStream | Blob

corpusKey: Vectara.CorpusKey

request: Vectara.UploadFileRequest

requestOptions: Upload.RequestOptions

Documents

client.documents.list(corpusKey, { ...params }) -> core.Page

📝 Description

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.

🔌 Usage

const response = await client.documents.list("my-corpus");
for await (const item of response) {
    console.log(item);
}

// Or you can manually iterate page-by-page
const page = await client.documents.list("my-corpus");
while (page.hasNextPage()) {
    page = page.getNextPage();
}

⚙️ Parameters

corpusKey: Vectara.CorpusKey — The unique key identifying the queried corpus.

request: Vectara.DocumentsListRequest

requestOptions: Documents.RequestOptions

client.documents.create(corpusKey, { ...params }) -> Vectara.Document

📝 Description

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.

🔌 Usage

await client.documents.create("my-corpus-key", {
    body: {
        id: "my-doc-id",
        type: "structured",
        sections: [
            {
                id: 1,
                title: "A nice title.",
                text: "I'm a nice document section.",
                metadata: {
                    section: "1.1",
                },
            },
            {
                id: 2,
                title: "Another nice title.",
                text: "I'm another document section on something else.",
                metadata: {
                    section: "1.2",
                },
            },
        ],
        metadata: {
            url: "https://example.com",
        },
    },
});

⚙️ Parameters

corpusKey: Vectara.CorpusKey — The unique key identifying the queried corpus.

request: Vectara.DocumentsCreateRequest

requestOptions: Documents.RequestOptions

client.documents.getCorpusDocument(corpusKey, documentId, { ...params }) -> Vectara.Document

📝 Description

Retrieve the content and metadata of a specific document, identified by its unique document_id from a specific corpus.

🔌 Usage

await client.documents.getCorpusDocument("my-corpus", "document_id");

⚙️ Parameters

corpusKey: Vectara.CorpusKey — The unique key identifying the corpus containing the document to retrieve.

documentId: string

The document ID of the document to retrieve. This document_id must be percent encoded.

request: Vectara.GetCorpusDocumentRequest

requestOptions: Documents.RequestOptions

client.documents.delete(corpusKey, documentId, { ...params }) -> void

📝 Description

Permanently delete a document identified by its unique document_id from a specific corpus. This operation cannot be undone, so use it with caution.

🔌 Usage

await client.documents.delete("my-corpus", "document_id");

⚙️ Parameters

corpusKey: Vectara.CorpusKey — The unique key identifying the corpus with the document to delete.

documentId: string

The document ID of the document to delete. This document_id must be percent encoded.

request: Vectara.DocumentsDeleteRequest

requestOptions: Documents.RequestOptions

Index

client.index.updateCorpusDocument(corpusKey, documentId, { ...params }) -> Vectara.Document

📝 Description

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.

🔌 Usage

await client.index.updateCorpusDocument("my-corpus", "document_id", {
    body: {},
});

⚙️ Parameters

corpusKey: Vectara.CorpusKey — The unique key identifying the corpus with the document to update.

documentId: string

The document ID of the document to update. This document_id must be percent encoded.

request: Vectara.UpdateCorpusDocumentRequest

requestOptions: Index.RequestOptions

client.index.replaceCorpusDocumentMetadata(corpusKey, documentId, { ...params }) -> Vectara.Document

📝 Description

Replaces metadata of a document identified by its unique document_id from a specific corpus.

🔌 Usage

await client.index.replaceCorpusDocumentMetadata("my-corpus", "document_id", {
    body: {},
});

⚙️ Parameters

corpusKey: Vectara.CorpusKey — The unique key identifying the corpus with the document to update.

documentId: string

The document ID of the document to update. This document_id must be percent encoded.

request: Vectara.ReplaceCorpusDocumentMetadataRequest

requestOptions: Index.RequestOptions

Chats

client.chats.list({ ...params }) -> core.Page

📝 Description

Retrieve a list of previous chats in the Vectara account.

🔌 Usage

const response = await client.chats.list();
for await (const item of response) {
    console.log(item);
}

// Or you can manually iterate page-by-page
const page = await client.chats.list();
while (page.hasNextPage()) {
    page = page.getNextPage();
}

⚙️ Parameters

request: Vectara.ChatsListRequest

requestOptions: Chats.RequestOptions

client.chats.get(chatId, { ...params }) -> Vectara.Chat

📝 Description

Get a chat summary to view what started the chat, but not subsequent turns.

🔌 Usage

await client.chats.get("chat_id");

⚙️ Parameters

chatId: string — The ID of the chat.

request: Vectara.ChatsGetRequest

requestOptions: Chats.RequestOptions

client.chats.delete(chatId, { ...params }) -> void

📝 Description

Delete a chat and any turns it contains permanently.

🔌 Usage

await client.chats.delete("chat_id");

⚙️ Parameters

chatId: string — The ID of the chat.

request: Vectara.ChatsDeleteRequest

requestOptions: Chats.RequestOptions

client.chats.listTurns(chatId, { ...params }) -> Vectara.ListChatTurnsResponse

📝 Description

List all turns in a chat to see all message and response pairs that make up the dialog.

🔌 Usage

await client.chats.listTurns("chat_id");

⚙️ Parameters

chatId: string — The ID of the chat.

request: Vectara.ChatsListTurnsRequest

requestOptions: Chats.RequestOptions

client.chats.createTurnsStream(chatId, { ...params }) -> core.Stream

📝 Description

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.

🔌 Usage

const response = await client.chats.createTurnsStream("chat_id", {
    query: "How can I use the Vectara platform?",
    search: {},
});
for await (const item of response) {
    console.log(item);
}

⚙️ Parameters

chatId: string — The ID of the chat.

request: Vectara.ChatsCreateTurnsStreamRequest

requestOptions: Chats.RequestOptions

client.chats.createTurns(chatId, { ...params }) -> Vectara.ChatFullResponse

📝 Description

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.

🔌 Usage

await client.chats.createTurns("chat_id", {
    query: "How can I use the Vectara platform?",
    search: {},
});

⚙️ Parameters

chatId: string — The ID of the chat.

request: Vectara.ChatsCreateTurnsRequest

requestOptions: Chats.RequestOptions

client.chats.getTurn(chatId, turnId, { ...params }) -> Vectara.Turn

📝 Description

Get a specific turn from a chat, which is a message and response pair from the conversation.

🔌 Usage

await client.chats.getTurn("chat_id", "turn_id");

⚙️ Parameters

chatId: string — The ID of the chat.

turnId: string — The ID of the turn.

request: Vectara.ChatsGetTurnRequest

requestOptions: Chats.RequestOptions

client.chats.deleteTurn(chatId, turnId, { ...params }) -> void

📝 Description

Delete a turn from a chat. This will delete all subsequent turns in the chat.

🔌 Usage

await client.chats.deleteTurn("chat_id", "turn_id");

⚙️ Parameters

chatId: string — The ID of the chat.

turnId: string — The ID of the turn.

request: Vectara.ChatsDeleteTurnRequest

requestOptions: Chats.RequestOptions

client.chats.updateTurn(chatId, turnId, { ...params }) -> Vectara.Turn

📝 Description

Update a turn; used to disable or enable a chat.

🔌 Usage

await client.chats.updateTurn("chat_id", "turn_id");

⚙️ Parameters

chatId: string — The ID of the chat.

turnId: string — The ID of the turn.

request: Vectara.UpdateTurnRequest

requestOptions: Chats.RequestOptions

Llms

client.llms.list({ ...params }) -> core.Page

📝 Description

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. The generation_preset_name property in generation parameters can be found as the name property on the Generations Presets retrieved from /v2/generation_presets.

🔌 Usage

const response = await client.llms.list();
for await (const item of response) {
    console.log(item);
}

// Or you can manually iterate page-by-page
const page = await client.llms.list();
while (page.hasNextPage()) {
    page = page.getNextPage();
}

⚙️ Parameters

request: Vectara.LlmsListRequest

requestOptions: Llms.RequestOptions

GenerationPresets

client.generationPresets.listGenerationPresets({ ...params }) -> Vectara.ListGenerationPresetsResponse

📝 Description

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.

🔌 Usage

await client.generationPresets.listGenerationPresets();

⚙️ Parameters

request: Vectara.ListGenerationPresetsRequest

requestOptions: GenerationPresets.RequestOptions

Encoders

client.encoders.list({ ...params }) -> core.Page

📝 Description

Encoders are used to store and retrieve from a corpus.

🔌 Usage

const response = await client.encoders.list({
    filter: "vectara.*",
});
for await (const item of response) {
    console.log(item);
}

// Or you can manually iterate page-by-page
const page = await client.encoders.list({
    filter: "vectara.*",
});
while (page.hasNextPage()) {
    page = page.getNextPage();
}

⚙️ Parameters

request: Vectara.EncodersListRequest

requestOptions: Encoders.RequestOptions

Rerankers

client.rerankers.list({ ...params }) -> core.Page

📝 Description

Rerankers are used to improve the ranking (ordering) of search results.

🔌 Usage

const response = await client.rerankers.list({
    filter: "vectara.*",
});
for await (const item of response) {
    console.log(item);
}

// Or you can manually iterate page-by-page
const page = await client.rerankers.list({
    filter: "vectara.*",
});
while (page.hasNextPage()) {
    page = page.getNextPage();
}

⚙️ Parameters

request: Vectara.RerankersListRequest

requestOptions: Rerankers.RequestOptions

Jobs

client.jobs.list({ ...params }) -> core.Page

📝 Description

List jobs for the account. Jobs are background processes like replacing the filterable metadata attributes.

🔌 Usage

const response = await client.jobs.list();
for await (const item of response) {
    console.log(item);
}

// Or you can manually iterate page-by-page
const page = await client.jobs.list();
while (page.hasNextPage()) {
    page = page.getNextPage();
}

⚙️ Parameters

request: Vectara.JobsListRequest

requestOptions: Jobs.RequestOptions

client.jobs.get(jobId, { ...params }) -> Vectara.Job

📝 Description

Get a job by a specific ID. Jobs are background processes like replacing the filterable metadata attributes.

🔌 Usage

await client.jobs.get("job_id");

⚙️ Parameters

jobId: string — The ID of the job to get.

request: Vectara.JobsGetRequest

requestOptions: Jobs.RequestOptions

Users

client.users.list({ ...params }) -> core.Page

📝 Description

Lists all users in the account.

🔌 Usage

const response = await client.users.list();
for await (const item of response) {
    console.log(item);
}

// Or you can manually iterate page-by-page
const page = await client.users.list();
while (page.hasNextPage()) {
    page = page.getNextPage();
}

⚙️ Parameters

request: Vectara.UsersListRequest

requestOptions: Users.RequestOptions

client.users.create({ ...params }) -> Vectara.User

📝 Description

Create a user for the current customer account.

🔌 Usage

await client.users.create({
    email: "email",
});

⚙️ Parameters

request: Vectara.CreateUserRequest

requestOptions: Users.RequestOptions

client.users.get(username, { ...params }) -> Vectara.User

📝 Description

Get a user and view details like the email, username, and associated roles.

🔌 Usage

await client.users.get("username");

⚙️ Parameters

username: string

Specifies the user ID that to retrieve. Note that the username must be percent encoded.

request: Vectara.UsersGetRequest

requestOptions: Users.RequestOptions

client.users.delete(username, { ...params }) -> void

📝 Description

Delete a user from the account.

🔌 Usage

await client.users.delete("username");

⚙️ Parameters

username: string

Specifies the user ID to delete. Note that the username must be percent encoded.

request: Vectara.UsersDeleteRequest

requestOptions: Users.RequestOptions

client.users.update(username, { ...params }) -> Vectara.User

📝 Description

Update details about a user such as role names.

🔌 Usage

await client.users.update("username");

⚙️ Parameters

username: string

Specifies the user ID to update. Note that the username must be percent encoded.

request: Vectara.UpdateUserRequest

requestOptions: Users.RequestOptions

client.users.resetPassword(username, { ...params }) -> void

📝 Description

Reset the password for a user.

🔌 Usage

await client.users.resetPassword("username");

⚙️ Parameters

username: string

Specifies the user ID to update. Note that the username must be percent encoded and URI safe.

request: Vectara.UsersResetPasswordRequest

requestOptions: Users.RequestOptions

API Keys

client.apiKeys.list({ ...params }) -> core.Page

🔌 Usage

const response = await client.apiKeys.list({
    corpusKey: "my-corpus",
});
for await (const item of response) {
    console.log(item);
}

// Or you can manually iterate page-by-page
const page = await client.apiKeys.list({
    corpusKey: "my-corpus",
});
while (page.hasNextPage()) {
    page = page.getNextPage();
}

⚙️ Parameters

request: Vectara.ApiKeysListRequest

requestOptions: ApiKeys.RequestOptions

client.apiKeys.create({ ...params }) -> Vectara.ApiKey

📝 Description

An API key is to authenticate when calling Vectara APIs.

🔌 Usage

await client.apiKeys.create({
    name: "name",
    apiKeyRole: "serving",
});

⚙️ Parameters

request: Vectara.CreateApiKeyRequest

requestOptions: ApiKeys.RequestOptions

client.apiKeys.get(apiKeyId, { ...params }) -> Vectara.ApiKey

🔌 Usage

await client.apiKeys.get("api_key_id");

⚙️ Parameters

apiKeyId: string — The ID of the API key.

request: Vectara.ApiKeysGetRequest

requestOptions: ApiKeys.RequestOptions

client.apiKeys.delete(apiKeyId, { ...params }) -> void

📝 Description

Delete API keys to help you manage the security and lifecycle of API keys in your application.

🔌 Usage

await client.apiKeys.delete("api_key_id");

⚙️ Parameters

apiKeyId: string — The ID of the API key.

request: Vectara.ApiKeysDeleteRequest

requestOptions: ApiKeys.RequestOptions

client.apiKeys.update(apiKeyId, { ...params }) -> Vectara.ApiKey

📝 Description

Update an API key such as the roles attached to the key.

🔌 Usage

await client.apiKeys.update("api_key_id");

⚙️ Parameters

apiKeyId: string — The ID of the API key.

request: Vectara.UpdateApiKeyRequest

requestOptions: ApiKeys.RequestOptions

AppClients

client.appClients.list({ ...params }) -> core.Page

🔌 Usage

const response = await client.appClients.list();
for await (const item of response) {
    console.log(item);
}

// Or you can manually iterate page-by-page
const page = await client.appClients.list();
while (page.hasNextPage()) {
    page = page.getNextPage();
}

⚙️ Parameters

request: Vectara.AppClientsListRequest

requestOptions: AppClients.RequestOptions

client.appClients.create({ ...params }) -> Vectara.AppClient

📝 Description

An App Client is used for OAuth 2.0 authentication when calling Vectara APIs.

🔌 Usage

await client.appClients.create({
    body: {
        name: "name",
        type: "client_credentials",
    },
});

⚙️ Parameters

request: Vectara.AppClientsCreateRequest

requestOptions: AppClients.RequestOptions

client.appClients.get(appClientId, { ...params }) -> Vectara.AppClient

🔌 Usage

await client.appClients.get("app_client_id");

⚙️ Parameters

appClientId: string — The ID of the App Client.

request: Vectara.AppClientsGetRequest

requestOptions: AppClients.RequestOptions

client.appClients.delete(appClientId, { ...params }) -> void

🔌 Usage

await client.appClients.delete("app_client_id");

⚙️ Parameters

appClientId: string — The ID of App Client.

request: Vectara.AppClientsDeleteRequest

requestOptions: AppClients.RequestOptions

client.appClients.update(appClientId, { ...params }) -> Vectara.AppClient

🔌 Usage

await client.appClients.update("app_client_id");

⚙️ Parameters

appClientId: string — The name of App Client.

request: Vectara.UpdateAppClientRequest

requestOptions: AppClients.RequestOptions

QueryHistory

client.queryHistory.getQueryHistory(queryId, { ...params }) -> Vectara.QueryHistory

📝 Description

Retrieve a detailed history of previously executed query.

🔌 Usage

await client.queryHistory.getQueryHistory("query_id");

⚙️ Parameters

queryId: string — The ID of the query history

request: Vectara.GetQueryHistoryRequest

requestOptions: QueryHistory.RequestOptions

client.queryHistory.getQueryHistories({ ...params }) -> Vectara.ListQueryHistoriesResponse

📝 Description

Retrieve query histories.

🔌 Usage

await client.queryHistory.getQueryHistories();

⚙️ Parameters

request: Vectara.GetQueryHistoriesRequest

requestOptions: QueryHistory.RequestOptions

Auth

client.auth.getToken({ ...params }) -> Vectara.GetTokenResponse

📝 Description

Obtain an OAuth2 access token using client credentials

🔌 Usage

await client.auth.getToken({
    clientId: "client_id",
    clientSecret: "client_secret",
});

⚙️ Parameters

request: Vectara.AuthGetTokenRequest

requestOptions: Auth.RequestOptions