/* * 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 { buildLlmMemoryStoresGetEntryQuery, LlmMemoryStoresGetEntryQueryData, prefetchLlmMemoryStoresGetEntry, queryKeyLlmMemoryStoresGetEntry, } from "./llmMemoryStoresGetEntry.core.js"; export { buildLlmMemoryStoresGetEntryQuery, type LlmMemoryStoresGetEntryQueryData, prefetchLlmMemoryStoresGetEntry, queryKeyLlmMemoryStoresGetEntry, }; export type LlmMemoryStoresGetEntryQueryError = | SDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Retrieve memory entry */ export function useLlmMemoryStoresGetEntry( request: operations.GetMemoryEntryRequest, options?: QueryHookOptions< LlmMemoryStoresGetEntryQueryData, LlmMemoryStoresGetEntryQueryError >, ): UseQueryResult< LlmMemoryStoresGetEntryQueryData, LlmMemoryStoresGetEntryQueryError > { const client = useSDKContext(); return useQuery({ ...buildLlmMemoryStoresGetEntryQuery( client, request, options, ), ...options, }); } /** * Retrieve memory entry */ export function useLlmMemoryStoresGetEntrySuspense( request: operations.GetMemoryEntryRequest, options?: SuspenseQueryHookOptions< LlmMemoryStoresGetEntryQueryData, LlmMemoryStoresGetEntryQueryError >, ): UseSuspenseQueryResult< LlmMemoryStoresGetEntryQueryData, LlmMemoryStoresGetEntryQueryError > { const client = useSDKContext(); return useSuspenseQuery({ ...buildLlmMemoryStoresGetEntryQuery( client, request, options, ), ...options, }); } export function setLlmMemoryStoresGetEntryData( client: QueryClient, queryKeyBase: [ memoryStoreId: string, entryId: string, parameters: { xOnBehalfOf?: string | undefined }, ], data: LlmMemoryStoresGetEntryQueryData, ): LlmMemoryStoresGetEntryQueryData | undefined { const key = queryKeyLlmMemoryStoresGetEntry(...queryKeyBase); return client.setQueryData(key, data); } export function invalidateLlmMemoryStoresGetEntry( client: QueryClient, queryKeyBase: TupleToPrefixes< [ memoryStoreId: string, entryId: string, parameters: { xOnBehalfOf?: string | undefined }, ] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "memoryStores", "getEntry", ...queryKeyBase], }); } export function invalidateAllLlmMemoryStoresGetEntry( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "memoryStores", "getEntry"], }); }