/* * 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 { buildLlmResponsesGetQuery, LlmResponsesGetQueryData, prefetchLlmResponsesGet, queryKeyLlmResponsesGet, } from "./llmResponsesGet.core.js"; export { buildLlmResponsesGetQuery, type LlmResponsesGetQueryData, prefetchLlmResponsesGet, queryKeyLlmResponsesGet, }; export type LlmResponsesGetQueryError = | SDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; export { GetAcceptEnum } from "../funcs/llmResponsesGet.js"; /** * Retrieve response by ID with status and results * * @remarks * Retrieves a previously created agent response by its unique ID. When stream=true, returns Server-Sent Events for real-time updates on in-progress background responses. */ export function useLlmResponsesGet( request: operations.GetResponseRequest, options?: QueryHookOptions< LlmResponsesGetQueryData, LlmResponsesGetQueryError >, ): UseQueryResult { const client = useSDKContext(); return useQuery({ ...buildLlmResponsesGetQuery( client, request, options, ), ...options, }); } /** * Retrieve response by ID with status and results * * @remarks * Retrieves a previously created agent response by its unique ID. When stream=true, returns Server-Sent Events for real-time updates on in-progress background responses. */ export function useLlmResponsesGetSuspense( request: operations.GetResponseRequest, options?: SuspenseQueryHookOptions< LlmResponsesGetQueryData, LlmResponsesGetQueryError >, ): UseSuspenseQueryResult { const client = useSDKContext(); return useSuspenseQuery({ ...buildLlmResponsesGetQuery( client, request, options, ), ...options, }); } export function setLlmResponsesGetData( client: QueryClient, queryKeyBase: [ responseId: string, parameters: { include?: Array | undefined; includeObfuscation?: boolean | undefined; startingAfter?: number | undefined; stream?: boolean | undefined; xOnBehalfOf?: string | undefined; }, ], data: LlmResponsesGetQueryData, ): LlmResponsesGetQueryData | undefined { const key = queryKeyLlmResponsesGet(...queryKeyBase); return client.setQueryData(key, data); } export function invalidateLlmResponsesGet( client: QueryClient, queryKeyBase: TupleToPrefixes< [ responseId: string, parameters: { include?: Array | undefined; includeObfuscation?: boolean | undefined; startingAfter?: number | undefined; stream?: boolean | undefined; xOnBehalfOf?: string | undefined; }, ] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "responses", "get", ...queryKeyBase], }); } export function invalidateAllLlmResponsesGet( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "responses", "get"], }); }