/* * 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 { buildLlmVectorStoresGetQuery, LlmVectorStoresGetQueryData, prefetchLlmVectorStoresGet, queryKeyLlmVectorStoresGet, } from "./llmVectorStoresGet.core.js"; export { buildLlmVectorStoresGetQuery, type LlmVectorStoresGetQueryData, prefetchLlmVectorStoresGet, queryKeyLlmVectorStoresGet, }; export type LlmVectorStoresGetQueryError = | SDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Retrieve a vector store * * @remarks * Retrieves a vector store by its ID. */ export function useLlmVectorStoresGet( request: operations.GetVectorStoreRequest, options?: QueryHookOptions< LlmVectorStoresGetQueryData, LlmVectorStoresGetQueryError >, ): UseQueryResult { const client = useSDKContext(); return useQuery({ ...buildLlmVectorStoresGetQuery( client, request, options, ), ...options, }); } /** * Retrieve a vector store * * @remarks * Retrieves a vector store by its ID. */ export function useLlmVectorStoresGetSuspense( request: operations.GetVectorStoreRequest, options?: SuspenseQueryHookOptions< LlmVectorStoresGetQueryData, LlmVectorStoresGetQueryError >, ): UseSuspenseQueryResult< LlmVectorStoresGetQueryData, LlmVectorStoresGetQueryError > { const client = useSDKContext(); return useSuspenseQuery({ ...buildLlmVectorStoresGetQuery( client, request, options, ), ...options, }); } export function setLlmVectorStoresGetData( client: QueryClient, queryKeyBase: [ vectorStoreId: string, parameters: { xOnBehalfOf?: string | undefined }, ], data: LlmVectorStoresGetQueryData, ): LlmVectorStoresGetQueryData | undefined { const key = queryKeyLlmVectorStoresGet(...queryKeyBase); return client.setQueryData(key, data); } export function invalidateLlmVectorStoresGet( client: QueryClient, queryKeyBase: TupleToPrefixes< [vectorStoreId: string, parameters: { xOnBehalfOf?: string | undefined }] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "vectorStores", "get", ...queryKeyBase], }); } export function invalidateAllLlmVectorStoresGet( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "vectorStores", "get"], }); }