/* * 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 { buildLlmVectorStoresGetFileQuery, LlmVectorStoresGetFileQueryData, prefetchLlmVectorStoresGetFile, queryKeyLlmVectorStoresGetFile, } from "./llmVectorStoresGetFile.core.js"; export { buildLlmVectorStoresGetFileQuery, type LlmVectorStoresGetFileQueryData, prefetchLlmVectorStoresGetFile, queryKeyLlmVectorStoresGetFile, }; export type LlmVectorStoresGetFileQueryError = | SDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Retrieve a vector store file * * @remarks * Retrieves detailed information about a specific file within a vector store. */ export function useLlmVectorStoresGetFile( request: operations.GetVectorStoreFileRequest, options?: QueryHookOptions< LlmVectorStoresGetFileQueryData, LlmVectorStoresGetFileQueryError >, ): UseQueryResult< LlmVectorStoresGetFileQueryData, LlmVectorStoresGetFileQueryError > { const client = useSDKContext(); return useQuery({ ...buildLlmVectorStoresGetFileQuery( client, request, options, ), ...options, }); } /** * Retrieve a vector store file * * @remarks * Retrieves detailed information about a specific file within a vector store. */ export function useLlmVectorStoresGetFileSuspense( request: operations.GetVectorStoreFileRequest, options?: SuspenseQueryHookOptions< LlmVectorStoresGetFileQueryData, LlmVectorStoresGetFileQueryError >, ): UseSuspenseQueryResult< LlmVectorStoresGetFileQueryData, LlmVectorStoresGetFileQueryError > { const client = useSDKContext(); return useSuspenseQuery({ ...buildLlmVectorStoresGetFileQuery( client, request, options, ), ...options, }); } export function setLlmVectorStoresGetFileData( client: QueryClient, queryKeyBase: [ vectorStoreId: string, fileId: string, parameters: { xOnBehalfOf?: string | undefined }, ], data: LlmVectorStoresGetFileQueryData, ): LlmVectorStoresGetFileQueryData | undefined { const key = queryKeyLlmVectorStoresGetFile(...queryKeyBase); return client.setQueryData(key, data); } export function invalidateLlmVectorStoresGetFile( client: QueryClient, queryKeyBase: TupleToPrefixes< [ vectorStoreId: string, fileId: string, parameters: { xOnBehalfOf?: string | undefined }, ] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "vectorStores", "getFile", ...queryKeyBase], }); } export function invalidateAllLlmVectorStoresGetFile( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "vectorStores", "getFile"], }); }