// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; import { APIPromise } from '../core/api-promise'; import { buildHeaders } from '../internal/headers'; import { RequestOptions } from '../internal/request-options'; export class VectorStore extends APIResource { /** * Create, update, or delete a vector store index in storage * * @example * ```ts * const vectorStore = await client.vectorStore.create({ * auth: 'Bearer xyz123', * knowledge_base_id: 'test-index', * vector_store_id: '1234', * message: 'create', * }); * ``` */ create(params: VectorStoreCreateParams, options?: RequestOptions): APIPromise { const { 'Accept-Language': acceptLanguage, 'X-Error-Format': xErrorFormat, ...body } = params; return this._client.post('/vector-store', { body, ...options, headers: buildHeaders([ { ...(acceptLanguage != null ? { 'Accept-Language': acceptLanguage } : undefined), ...(xErrorFormat != null ? { 'X-Error-Format': xErrorFormat } : undefined), }, options?.headers, ]), }); } } /** * Response model for vector store. * * Attributes: message (str): The message for the vector store. vector_store_id * (str): The ID of the vector store. */ export interface VectorStoreCreateResponse { /** * Success message */ message: string; /** * The ID of the vector store. */ vector_store_id: string; [k: string]: string | undefined; } export interface VectorStoreCreateParams { /** * Body param: Authentication token for the request */ auth: string; /** * Body param: ID of the knowledge base to be created or deleted */ knowledge_base_id: string; /** * Body param: ID of the vector store where the index will be created or deleted */ vector_store_id: string; /** * Body param: Action to perform on the vector store - create, update, or delete * the index */ message?: 'create' | 'update' | 'delete'; /** * Header param */ 'Accept-Language'?: string; /** * Header param: Set to `structured` to receive errors in the structured envelope. * Omit it to keep the legacy error body. */ 'X-Error-Format'?: string; } export declare namespace VectorStore { export { type VectorStoreCreateResponse as VectorStoreCreateResponse, type VectorStoreCreateParams as VectorStoreCreateParams, }; }