/* * 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 { buildLlmResponsesListInputItemsQuery, LlmResponsesListInputItemsQueryData, prefetchLlmResponsesListInputItems, queryKeyLlmResponsesListInputItems, } from "./llmResponsesListInputItems.core.js"; export { buildLlmResponsesListInputItemsQuery, type LlmResponsesListInputItemsQueryData, prefetchLlmResponsesListInputItems, queryKeyLlmResponsesListInputItems, }; export type LlmResponsesListInputItemsQueryError = | SDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * List paginated input items for a response * * @remarks * Retrieves a paginated list of all input items provided when creating the specified agent response. */ export function useLlmResponsesListInputItems( request: operations.ListInputItemsRequest, options?: QueryHookOptions< LlmResponsesListInputItemsQueryData, LlmResponsesListInputItemsQueryError >, ): UseQueryResult< LlmResponsesListInputItemsQueryData, LlmResponsesListInputItemsQueryError > { const client = useSDKContext(); return useQuery({ ...buildLlmResponsesListInputItemsQuery( client, request, options, ), ...options, }); } /** * List paginated input items for a response * * @remarks * Retrieves a paginated list of all input items provided when creating the specified agent response. */ export function useLlmResponsesListInputItemsSuspense( request: operations.ListInputItemsRequest, options?: SuspenseQueryHookOptions< LlmResponsesListInputItemsQueryData, LlmResponsesListInputItemsQueryError >, ): UseSuspenseQueryResult< LlmResponsesListInputItemsQueryData, LlmResponsesListInputItemsQueryError > { const client = useSDKContext(); return useSuspenseQuery({ ...buildLlmResponsesListInputItemsQuery( client, request, options, ), ...options, }); } export function setLlmResponsesListInputItemsData( client: QueryClient, queryKeyBase: [ responseId: string, parameters: { after?: string | undefined; include?: Array | undefined; limit?: number | undefined; order?: operations.ListInputItemsQueryParamOrder | undefined; xOnBehalfOf?: string | undefined; }, ], data: LlmResponsesListInputItemsQueryData, ): LlmResponsesListInputItemsQueryData | undefined { const key = queryKeyLlmResponsesListInputItems(...queryKeyBase); return client.setQueryData(key, data); } export function invalidateLlmResponsesListInputItems( client: QueryClient, queryKeyBase: TupleToPrefixes< [ responseId: string, parameters: { after?: string | undefined; include?: Array | undefined; limit?: number | undefined; order?: operations.ListInputItemsQueryParamOrder | undefined; xOnBehalfOf?: string | undefined; }, ] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "responses", "listInputItems", ...queryKeyBase], }); } export function invalidateAllLlmResponsesListInputItems( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "responses", "listInputItems"], }); }