/* * 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 { buildLlmFeedbackExportResponseFeedbackQuery, LlmFeedbackExportResponseFeedbackQueryData, prefetchLlmFeedbackExportResponseFeedback, queryKeyLlmFeedbackExportResponseFeedback, } from "./llmFeedbackExportResponseFeedback.core.js"; export { buildLlmFeedbackExportResponseFeedbackQuery, type LlmFeedbackExportResponseFeedbackQueryData, prefetchLlmFeedbackExportResponseFeedback, queryKeyLlmFeedbackExportResponseFeedback, }; export type LlmFeedbackExportResponseFeedbackQueryError = | SDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Export response feedback as CSV * * @remarks * Synchronously exports the response feedback entries visible to the caller as a CSV file, ordered by the creation date of the underlying request. Visibility matches the list endpoint: callers see their own feedback; org owners and admins see their whole team. Supports filtering by rating. The export is capped at 50,000 rows; when the cap is hit the response carries an X-Export-Truncated header and older rows (with the default descending order) are omitted. */ export function useLlmFeedbackExportResponseFeedback( request: operations.ExportResponseFeedbackRequest, options?: QueryHookOptions< LlmFeedbackExportResponseFeedbackQueryData, LlmFeedbackExportResponseFeedbackQueryError >, ): UseQueryResult< LlmFeedbackExportResponseFeedbackQueryData, LlmFeedbackExportResponseFeedbackQueryError > { const client = useSDKContext(); return useQuery({ ...buildLlmFeedbackExportResponseFeedbackQuery( client, request, options, ), ...options, }); } /** * Export response feedback as CSV * * @remarks * Synchronously exports the response feedback entries visible to the caller as a CSV file, ordered by the creation date of the underlying request. Visibility matches the list endpoint: callers see their own feedback; org owners and admins see their whole team. Supports filtering by rating. The export is capped at 50,000 rows; when the cap is hit the response carries an X-Export-Truncated header and older rows (with the default descending order) are omitted. */ export function useLlmFeedbackExportResponseFeedbackSuspense( request: operations.ExportResponseFeedbackRequest, options?: SuspenseQueryHookOptions< LlmFeedbackExportResponseFeedbackQueryData, LlmFeedbackExportResponseFeedbackQueryError >, ): UseSuspenseQueryResult< LlmFeedbackExportResponseFeedbackQueryData, LlmFeedbackExportResponseFeedbackQueryError > { const client = useSDKContext(); return useSuspenseQuery({ ...buildLlmFeedbackExportResponseFeedbackQuery( client, request, options, ), ...options, }); } export function setLlmFeedbackExportResponseFeedbackData( client: QueryClient, queryKeyBase: [ parameters: { order?: operations.ExportResponseFeedbackQueryParamOrder | undefined; rating?: operations.ExportResponseFeedbackQueryParamRating | undefined; xOnBehalfOf?: string | undefined; }, ], data: LlmFeedbackExportResponseFeedbackQueryData, ): LlmFeedbackExportResponseFeedbackQueryData | undefined { const key = queryKeyLlmFeedbackExportResponseFeedback(...queryKeyBase); return client.setQueryData( key, data, ); } export function invalidateLlmFeedbackExportResponseFeedback( client: QueryClient, queryKeyBase: TupleToPrefixes< [parameters: { order?: operations.ExportResponseFeedbackQueryParamOrder | undefined; rating?: operations.ExportResponseFeedbackQueryParamRating | undefined; xOnBehalfOf?: string | undefined; }] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: [ "@meetkai/mka1", "feedback", "exportResponseFeedback", ...queryKeyBase, ], }); } export function invalidateAllLlmFeedbackExportResponseFeedback( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "feedback", "exportResponseFeedback"], }); }