/* * 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 { buildLlmVectorStoresListFilesQuery, LlmVectorStoresListFilesQueryData, prefetchLlmVectorStoresListFiles, queryKeyLlmVectorStoresListFiles, } from "./llmVectorStoresListFiles.core.js"; export { buildLlmVectorStoresListFilesQuery, type LlmVectorStoresListFilesQueryData, prefetchLlmVectorStoresListFiles, queryKeyLlmVectorStoresListFiles, }; export type LlmVectorStoresListFilesQueryError = | SDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * List files in a vector store * * @remarks * Retrieves a paginated list of all files in a specific vector store. */ export function useLlmVectorStoresListFiles( request: operations.ListVectorStoreFilesRequest, options?: QueryHookOptions< LlmVectorStoresListFilesQueryData, LlmVectorStoresListFilesQueryError >, ): UseQueryResult< LlmVectorStoresListFilesQueryData, LlmVectorStoresListFilesQueryError > { const client = useSDKContext(); return useQuery({ ...buildLlmVectorStoresListFilesQuery( client, request, options, ), ...options, }); } /** * List files in a vector store * * @remarks * Retrieves a paginated list of all files in a specific vector store. */ export function useLlmVectorStoresListFilesSuspense( request: operations.ListVectorStoreFilesRequest, options?: SuspenseQueryHookOptions< LlmVectorStoresListFilesQueryData, LlmVectorStoresListFilesQueryError >, ): UseSuspenseQueryResult< LlmVectorStoresListFilesQueryData, LlmVectorStoresListFilesQueryError > { const client = useSDKContext(); return useSuspenseQuery({ ...buildLlmVectorStoresListFilesQuery( client, request, options, ), ...options, }); } export function setLlmVectorStoresListFilesData( client: QueryClient, queryKeyBase: [ vectorStoreId: string, parameters: { limit?: number | undefined; order?: operations.ListVectorStoreFilesQueryParamOrder | undefined; after?: string | undefined; before?: string | undefined; filter?: operations.Filter | undefined; xOnBehalfOf?: string | undefined; }, ], data: LlmVectorStoresListFilesQueryData, ): LlmVectorStoresListFilesQueryData | undefined { const key = queryKeyLlmVectorStoresListFiles(...queryKeyBase); return client.setQueryData(key, data); } export function invalidateLlmVectorStoresListFiles( client: QueryClient, queryKeyBase: TupleToPrefixes< [ vectorStoreId: string, parameters: { limit?: number | undefined; order?: operations.ListVectorStoreFilesQueryParamOrder | undefined; after?: string | undefined; before?: string | undefined; filter?: operations.Filter | undefined; xOnBehalfOf?: string | undefined; }, ] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "vectorStores", "listFiles", ...queryKeyBase], }); } export function invalidateAllLlmVectorStoresListFiles( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "vectorStores", "listFiles"], }); }