/* * 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 { buildLlmVectorStoresGetFileContentQuery, LlmVectorStoresGetFileContentQueryData, prefetchLlmVectorStoresGetFileContent, queryKeyLlmVectorStoresGetFileContent, } from "./llmVectorStoresGetFileContent.core.js"; export { buildLlmVectorStoresGetFileContentQuery, type LlmVectorStoresGetFileContentQueryData, prefetchLlmVectorStoresGetFileContent, queryKeyLlmVectorStoresGetFileContent, }; export type LlmVectorStoresGetFileContentQueryError = | SDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Retrieve parsed file content * * @remarks * Retrieves the complete parsed contents of a file within a vector store. */ export function useLlmVectorStoresGetFileContent( request: operations.GetVectorStoreFileContentRequest, options?: QueryHookOptions< LlmVectorStoresGetFileContentQueryData, LlmVectorStoresGetFileContentQueryError >, ): UseQueryResult< LlmVectorStoresGetFileContentQueryData, LlmVectorStoresGetFileContentQueryError > { const client = useSDKContext(); return useQuery({ ...buildLlmVectorStoresGetFileContentQuery( client, request, options, ), ...options, }); } /** * Retrieve parsed file content * * @remarks * Retrieves the complete parsed contents of a file within a vector store. */ export function useLlmVectorStoresGetFileContentSuspense( request: operations.GetVectorStoreFileContentRequest, options?: SuspenseQueryHookOptions< LlmVectorStoresGetFileContentQueryData, LlmVectorStoresGetFileContentQueryError >, ): UseSuspenseQueryResult< LlmVectorStoresGetFileContentQueryData, LlmVectorStoresGetFileContentQueryError > { const client = useSDKContext(); return useSuspenseQuery({ ...buildLlmVectorStoresGetFileContentQuery( client, request, options, ), ...options, }); } export function setLlmVectorStoresGetFileContentData( client: QueryClient, queryKeyBase: [ vectorStoreId: string, fileId: string, parameters: { xOnBehalfOf?: string | undefined }, ], data: LlmVectorStoresGetFileContentQueryData, ): LlmVectorStoresGetFileContentQueryData | undefined { const key = queryKeyLlmVectorStoresGetFileContent(...queryKeyBase); return client.setQueryData(key, data); } export function invalidateLlmVectorStoresGetFileContent( client: QueryClient, queryKeyBase: TupleToPrefixes< [ vectorStoreId: string, fileId: string, parameters: { xOnBehalfOf?: string | undefined }, ] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: [ "@meetkai/mka1", "vectorStores", "getFileContent", ...queryKeyBase, ], }); } export function invalidateAllLlmVectorStoresGetFileContent( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "vectorStores", "getFileContent"], }); }