/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { InvalidateQueryFilters, QueryClient, useQuery, UseQueryResult, useSuspenseQuery, UseSuspenseQueryResult, } from "@tanstack/react-query"; import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError, } from "../models/errors/httpclienterrors.js"; import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; import { SDKError } from "../models/errors/sdkerror.js"; import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import * as operations from "../models/operations/index.js"; import { useSDKContext } from "./_context.js"; import { QueryHookOptions, SuspenseQueryHookOptions, TupleToPrefixes, } from "./_types.js"; import { buildLlmVectorStoresListQuery, LlmVectorStoresListQueryData, prefetchLlmVectorStoresList, queryKeyLlmVectorStoresList, } from "./llmVectorStoresList.core.js"; export { buildLlmVectorStoresListQuery, type LlmVectorStoresListQueryData, prefetchLlmVectorStoresList, queryKeyLlmVectorStoresList, }; export type LlmVectorStoresListQueryError = | SDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * List vector stores * * @remarks * Retrieves a paginated list of all vector stores for the authenticated user. */ export function useLlmVectorStoresList( request: operations.ListVectorStoresRequest, options?: QueryHookOptions< LlmVectorStoresListQueryData, LlmVectorStoresListQueryError >, ): UseQueryResult { const client = useSDKContext(); return useQuery({ ...buildLlmVectorStoresListQuery( client, request, options, ), ...options, }); } /** * List vector stores * * @remarks * Retrieves a paginated list of all vector stores for the authenticated user. */ export function useLlmVectorStoresListSuspense( request: operations.ListVectorStoresRequest, options?: SuspenseQueryHookOptions< LlmVectorStoresListQueryData, LlmVectorStoresListQueryError >, ): UseSuspenseQueryResult< LlmVectorStoresListQueryData, LlmVectorStoresListQueryError > { const client = useSDKContext(); return useSuspenseQuery({ ...buildLlmVectorStoresListQuery( client, request, options, ), ...options, }); } export function setLlmVectorStoresListData( client: QueryClient, queryKeyBase: [ parameters: { limit?: number | undefined; order?: operations.ListVectorStoresQueryParamOrder | undefined; after?: string | undefined; before?: string | undefined; xOnBehalfOf?: string | undefined; }, ], data: LlmVectorStoresListQueryData, ): LlmVectorStoresListQueryData | undefined { const key = queryKeyLlmVectorStoresList(...queryKeyBase); return client.setQueryData(key, data); } export function invalidateLlmVectorStoresList( client: QueryClient, queryKeyBase: TupleToPrefixes< [parameters: { limit?: number | undefined; order?: operations.ListVectorStoresQueryParamOrder | undefined; after?: string | undefined; before?: string | undefined; xOnBehalfOf?: string | undefined; }] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "vectorStores", "list", ...queryKeyBase], }); } export function invalidateAllLlmVectorStoresList( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "vectorStores", "list"], }); }