/* * 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 { buildLlmSpeechListTtsHistoryQuery, LlmSpeechListTtsHistoryQueryData, prefetchLlmSpeechListTtsHistory, queryKeyLlmSpeechListTtsHistory, } from "./llmSpeechListTtsHistory.core.js"; export { buildLlmSpeechListTtsHistoryQuery, type LlmSpeechListTtsHistoryQueryData, prefetchLlmSpeechListTtsHistory, queryKeyLlmSpeechListTtsHistory, }; export type LlmSpeechListTtsHistoryQueryError = | SDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * List text-to-speech history * * @remarks * List stored text-to-speech generations for the authenticated user, newest first by default. */ export function useLlmSpeechListTtsHistory( request: operations.ListTextToSpeechHistoryRequest, options?: QueryHookOptions< LlmSpeechListTtsHistoryQueryData, LlmSpeechListTtsHistoryQueryError >, ): UseQueryResult< LlmSpeechListTtsHistoryQueryData, LlmSpeechListTtsHistoryQueryError > { const client = useSDKContext(); return useQuery({ ...buildLlmSpeechListTtsHistoryQuery( client, request, options, ), ...options, }); } /** * List text-to-speech history * * @remarks * List stored text-to-speech generations for the authenticated user, newest first by default. */ export function useLlmSpeechListTtsHistorySuspense( request: operations.ListTextToSpeechHistoryRequest, options?: SuspenseQueryHookOptions< LlmSpeechListTtsHistoryQueryData, LlmSpeechListTtsHistoryQueryError >, ): UseSuspenseQueryResult< LlmSpeechListTtsHistoryQueryData, LlmSpeechListTtsHistoryQueryError > { const client = useSDKContext(); return useSuspenseQuery({ ...buildLlmSpeechListTtsHistoryQuery( client, request, options, ), ...options, }); } export function setLlmSpeechListTtsHistoryData( client: QueryClient, queryKeyBase: [ parameters: { after?: string | undefined; limit?: number | undefined; order?: operations.ListTextToSpeechHistoryQueryParamOrder | undefined; model?: string | undefined; xOnBehalfOf?: string | undefined; }, ], data: LlmSpeechListTtsHistoryQueryData, ): LlmSpeechListTtsHistoryQueryData | undefined { const key = queryKeyLlmSpeechListTtsHistory(...queryKeyBase); return client.setQueryData(key, data); } export function invalidateLlmSpeechListTtsHistory( client: QueryClient, queryKeyBase: TupleToPrefixes< [parameters: { after?: string | undefined; limit?: number | undefined; order?: operations.ListTextToSpeechHistoryQueryParamOrder | undefined; model?: string | undefined; xOnBehalfOf?: string | undefined; }] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "speech", "listTtsHistory", ...queryKeyBase], }); } export function invalidateAllLlmSpeechListTtsHistory( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "speech", "listTtsHistory"], }); }