/** * This file was auto-generated by Fern from our API Definition. */ import * as Vectara from "./api/index"; import { ApiKeys } from "./api/resources/apiKeys/client/Client"; import { AppClients } from "./api/resources/appClients/client/Client"; import { Auth } from "./api/resources/auth/client/Client"; import { Chats } from "./api/resources/chats/client/Client"; import { Corpora } from "./api/resources/corpora/client/Client"; import { Documents } from "./api/resources/documents/client/Client"; import { Encoders } from "./api/resources/encoders/client/Client"; import { GenerationPresets } from "./api/resources/generationPresets/client/Client"; import { Index } from "./api/resources/index/client/Client"; import { Jobs } from "./api/resources/jobs/client/Client"; import { Llms } from "./api/resources/llms/client/Client"; import { QueryHistory } from "./api/resources/queryHistory/client/Client"; import { Rerankers } from "./api/resources/rerankers/client/Client"; import { Upload } from "./api/resources/upload/client/Client"; import { Users } from "./api/resources/users/client/Client"; import * as core from "./core"; import * as environments from "./environments"; export declare namespace VectaraClient { interface Options { environment?: core.Supplier; clientId?: core.Supplier; clientSecret?: core.Supplier; /** Override the x-api-key header */ apiKey?: core.Supplier; fetcher?: core.FetchFunction; } interface RequestOptions { /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the x-api-key header */ apiKey?: string | undefined; /** Additional headers to include in the request. */ headers?: Record; } } export declare class VectaraClient { protected readonly _options: VectaraClient.Options; private readonly _oauthTokenProvider; protected _corpora: Corpora | undefined; protected _upload: Upload | undefined; protected _documents: Documents | undefined; protected _index: Index | undefined; protected _chats: Chats | undefined; protected _llms: Llms | undefined; protected _generationPresets: GenerationPresets | undefined; protected _encoders: Encoders | undefined; protected _rerankers: Rerankers | undefined; protected _jobs: Jobs | undefined; protected _users: Users | undefined; protected _apiKeys: ApiKeys | undefined; protected _appClients: AppClients | undefined; protected _queryHistory: QueryHistory | undefined; protected _auth: Auth | undefined; constructor(_options?: VectaraClient.Options); get corpora(): Corpora; get upload(): Upload; get documents(): Documents; get index(): Index; get chats(): Chats; get llms(): Llms; get generationPresets(): GenerationPresets; get encoders(): Encoders; get rerankers(): Rerankers; get jobs(): Jobs; get users(): Users; get apiKeys(): ApiKeys; get appClients(): AppClients; get queryHistory(): QueryHistory; get auth(): Auth; /** * 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. The `corpus_key` is [created in the Vectara Console UI](https://docs.vectara.com/docs/console-ui/creating-a-corpus) or the [Create Corpus API definition](https://docs.vectara.com/docs/api-reference/admin-apis/create-corpus). 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](https://docs.vectara.com/docs/api-reference/search-apis/search#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](https://docs.vectara.com/docs/api-reference/search-apis/search#query-definition) * * 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 the `generation` property. By excluding the property or by setting it to null, the response * will not include generation. [Learn more](https://docs.vectara.com/docs/learn/grounded-generation/configure-query-summarization) * * Specify Vectara's RAG-focused LLM (Mockingbird) for the `generation_preset_name`. [Learn more](https://docs.vectara.com/docs/learn/mockingbird-llm) * * 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](https://docs.vectara.com/docs/api-reference/search-apis/search#advanced-summarization-customization-options) * * Customize citation formats in summaries using the `citations` object to include numeric, HTML, or Markdown links. [Learn more](https://docs.vectara.com/docs/api-reference/search-apis/search#citation-format-in-summary) * * For more detailed information, see this [Query API guide](https://docs.vectara.com/docs/api-reference/search-apis/search). */ queryStream(request: Vectara.QueryStreamRequest, requestOptions?: VectaraClient.RequestOptions): Promise>; /** * 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. The `corpus_key` is [created in the Vectara Console UI](https://docs.vectara.com/docs/console-ui/creating-a-corpus) or the [Create Corpus API definition](https://docs.vectara.com/docs/api-reference/admin-apis/create-corpus). 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](https://docs.vectara.com/docs/api-reference/search-apis/search#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](https://docs.vectara.com/docs/api-reference/search-apis/search#query-definition) * * 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 the `generation` property. By excluding the property or by setting it to null, the response * will not include generation. [Learn more](https://docs.vectara.com/docs/learn/grounded-generation/configure-query-summarization) * * Specify Vectara's RAG-focused LLM (Mockingbird) for the `generation_preset_name`. [Learn more](https://docs.vectara.com/docs/learn/mockingbird-llm) * * 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](https://docs.vectara.com/docs/api-reference/search-apis/search#advanced-summarization-customization-options) * * Customize citation formats in summaries using the `citations` object to include numeric, HTML, or Markdown links. [Learn more](https://docs.vectara.com/docs/api-reference/search-apis/search#citation-format-in-summary) * * For more detailed information, see this [Query API guide](https://docs.vectara.com/docs/api-reference/search-apis/search). * * @param {Vectara.QueryRequest} request * @param {VectaraClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Vectara.BadRequestError} * @throws {@link Vectara.ForbiddenError} * @throws {@link Vectara.NotFoundError} * * @example * await client.query({ * 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 * } * }) */ query(request: Vectara.QueryRequest, requestOptions?: VectaraClient.RequestOptions): Promise; /** * Create a chat while specifying the default retrieval parameters used by the prompt. */ chatStream(request: Vectara.ChatStreamRequest, requestOptions?: VectaraClient.RequestOptions): Promise>; /** * Create a chat while specifying the default retrieval parameters used by the prompt. * * @param {Vectara.ChatRequest} request * @param {VectaraClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Vectara.BadRequestError} * @throws {@link Vectara.ForbiddenError} * @throws {@link Vectara.NotFoundError} * * @example * 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 * } * }) */ chat(request: Vectara.ChatRequest, requestOptions?: VectaraClient.RequestOptions): Promise; protected _getAuthorizationHeader(): Promise; }