/* * 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 { buildLlmSpeechGetTtsHistoryContentQuery, LlmSpeechGetTtsHistoryContentQueryData, prefetchLlmSpeechGetTtsHistoryContent, queryKeyLlmSpeechGetTtsHistoryContent, } from "./llmSpeechGetTtsHistoryContent.core.js"; export { buildLlmSpeechGetTtsHistoryContentQuery, type LlmSpeechGetTtsHistoryContentQueryData, prefetchLlmSpeechGetTtsHistoryContent, queryKeyLlmSpeechGetTtsHistoryContent, }; export type LlmSpeechGetTtsHistoryContentQueryError = | SDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; export { GetTtsHistoryContentAcceptEnum } from "../funcs/llmSpeechGetTtsHistoryContent.js"; /** * Retrieve text-to-speech audio * * @remarks * Returns the stored audio for a text-to-speech generation as a binary response. */ export function useLlmSpeechGetTtsHistoryContent( request: operations.GetTextToSpeechHistoryContentRequest, options?: QueryHookOptions< LlmSpeechGetTtsHistoryContentQueryData, LlmSpeechGetTtsHistoryContentQueryError >, ): UseQueryResult< LlmSpeechGetTtsHistoryContentQueryData, LlmSpeechGetTtsHistoryContentQueryError > { const client = useSDKContext(); return useQuery({ ...buildLlmSpeechGetTtsHistoryContentQuery( client, request, options, ), ...options, }); } /** * Retrieve text-to-speech audio * * @remarks * Returns the stored audio for a text-to-speech generation as a binary response. */ export function useLlmSpeechGetTtsHistoryContentSuspense( request: operations.GetTextToSpeechHistoryContentRequest, options?: SuspenseQueryHookOptions< LlmSpeechGetTtsHistoryContentQueryData, LlmSpeechGetTtsHistoryContentQueryError >, ): UseSuspenseQueryResult< LlmSpeechGetTtsHistoryContentQueryData, LlmSpeechGetTtsHistoryContentQueryError > { const client = useSDKContext(); return useSuspenseQuery({ ...buildLlmSpeechGetTtsHistoryContentQuery( client, request, options, ), ...options, }); } export function setLlmSpeechGetTtsHistoryContentData( client: QueryClient, queryKeyBase: [ ttsId: string, parameters: { xOnBehalfOf?: string | undefined }, ], data: LlmSpeechGetTtsHistoryContentQueryData, ): LlmSpeechGetTtsHistoryContentQueryData | undefined { const key = queryKeyLlmSpeechGetTtsHistoryContent(...queryKeyBase); return client.setQueryData(key, data); } export function invalidateLlmSpeechGetTtsHistoryContent( client: QueryClient, queryKeyBase: TupleToPrefixes< [ttsId: string, parameters: { xOnBehalfOf?: string | undefined }] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: [ "@meetkai/mka1", "speech", "getTtsHistoryContent", ...queryKeyBase, ], }); } export function invalidateAllLlmSpeechGetTtsHistoryContent( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "speech", "getTtsHistoryContent"], }); }