/* * 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 { buildLlmVectorStoresListFilesInBatchQuery, LlmVectorStoresListFilesInBatchQueryData, prefetchLlmVectorStoresListFilesInBatch, queryKeyLlmVectorStoresListFilesInBatch, } from "./llmVectorStoresListFilesInBatch.core.js"; export { buildLlmVectorStoresListFilesInBatchQuery, type LlmVectorStoresListFilesInBatchQueryData, prefetchLlmVectorStoresListFilesInBatch, queryKeyLlmVectorStoresListFilesInBatch, }; export type LlmVectorStoresListFilesInBatchQueryError = | SDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * List files in a batch * * @remarks * Retrieves a paginated list of all files within a specific batch operation. */ export function useLlmVectorStoresListFilesInBatch( request: operations.ListVectorStoreFilesInBatchRequest, options?: QueryHookOptions< LlmVectorStoresListFilesInBatchQueryData, LlmVectorStoresListFilesInBatchQueryError >, ): UseQueryResult< LlmVectorStoresListFilesInBatchQueryData, LlmVectorStoresListFilesInBatchQueryError > { const client = useSDKContext(); return useQuery({ ...buildLlmVectorStoresListFilesInBatchQuery( client, request, options, ), ...options, }); } /** * List files in a batch * * @remarks * Retrieves a paginated list of all files within a specific batch operation. */ export function useLlmVectorStoresListFilesInBatchSuspense( request: operations.ListVectorStoreFilesInBatchRequest, options?: SuspenseQueryHookOptions< LlmVectorStoresListFilesInBatchQueryData, LlmVectorStoresListFilesInBatchQueryError >, ): UseSuspenseQueryResult< LlmVectorStoresListFilesInBatchQueryData, LlmVectorStoresListFilesInBatchQueryError > { const client = useSDKContext(); return useSuspenseQuery({ ...buildLlmVectorStoresListFilesInBatchQuery( client, request, options, ), ...options, }); } export function setLlmVectorStoresListFilesInBatchData( client: QueryClient, queryKeyBase: [ vectorStoreId: string, batchId: string, parameters: { limit?: number | undefined; order?: operations.ListVectorStoreFilesInBatchQueryParamOrder | undefined; after?: string | undefined; before?: string | undefined; filter?: operations.QueryParamFilter | undefined; xOnBehalfOf?: string | undefined; }, ], data: LlmVectorStoresListFilesInBatchQueryData, ): LlmVectorStoresListFilesInBatchQueryData | undefined { const key = queryKeyLlmVectorStoresListFilesInBatch(...queryKeyBase); return client.setQueryData( key, data, ); } export function invalidateLlmVectorStoresListFilesInBatch( client: QueryClient, queryKeyBase: TupleToPrefixes< [ vectorStoreId: string, batchId: string, parameters: { limit?: number | undefined; order?: | operations.ListVectorStoreFilesInBatchQueryParamOrder | undefined; after?: string | undefined; before?: string | undefined; filter?: operations.QueryParamFilter | undefined; xOnBehalfOf?: string | undefined; }, ] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: [ "@meetkai/mka1", "vectorStores", "listFilesInBatch", ...queryKeyBase, ], }); } export function invalidateAllLlmVectorStoresListFilesInBatch( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "vectorStores", "listFilesInBatch"], }); }