/* * 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 { buildLlmFeedbackExportCompletionFeedbackQuery, LlmFeedbackExportCompletionFeedbackQueryData, prefetchLlmFeedbackExportCompletionFeedback, queryKeyLlmFeedbackExportCompletionFeedback, } from "./llmFeedbackExportCompletionFeedback.core.js"; export { buildLlmFeedbackExportCompletionFeedbackQuery, type LlmFeedbackExportCompletionFeedbackQueryData, prefetchLlmFeedbackExportCompletionFeedback, queryKeyLlmFeedbackExportCompletionFeedback, }; export type LlmFeedbackExportCompletionFeedbackQueryError = | SDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Export completion feedback as CSV * * @remarks * Synchronously exports the completion 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 useLlmFeedbackExportCompletionFeedback( request: operations.ExportCompletionFeedbackRequest, options?: QueryHookOptions< LlmFeedbackExportCompletionFeedbackQueryData, LlmFeedbackExportCompletionFeedbackQueryError >, ): UseQueryResult< LlmFeedbackExportCompletionFeedbackQueryData, LlmFeedbackExportCompletionFeedbackQueryError > { const client = useSDKContext(); return useQuery({ ...buildLlmFeedbackExportCompletionFeedbackQuery( client, request, options, ), ...options, }); } /** * Export completion feedback as CSV * * @remarks * Synchronously exports the completion 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 useLlmFeedbackExportCompletionFeedbackSuspense( request: operations.ExportCompletionFeedbackRequest, options?: SuspenseQueryHookOptions< LlmFeedbackExportCompletionFeedbackQueryData, LlmFeedbackExportCompletionFeedbackQueryError >, ): UseSuspenseQueryResult< LlmFeedbackExportCompletionFeedbackQueryData, LlmFeedbackExportCompletionFeedbackQueryError > { const client = useSDKContext(); return useSuspenseQuery({ ...buildLlmFeedbackExportCompletionFeedbackQuery( client, request, options, ), ...options, }); } export function setLlmFeedbackExportCompletionFeedbackData( client: QueryClient, queryKeyBase: [ parameters: { order?: operations.ExportCompletionFeedbackQueryParamOrder | undefined; rating?: operations.ExportCompletionFeedbackQueryParamRating | undefined; xOnBehalfOf?: string | undefined; }, ], data: LlmFeedbackExportCompletionFeedbackQueryData, ): LlmFeedbackExportCompletionFeedbackQueryData | undefined { const key = queryKeyLlmFeedbackExportCompletionFeedback(...queryKeyBase); return client.setQueryData( key, data, ); } export function invalidateLlmFeedbackExportCompletionFeedback( client: QueryClient, queryKeyBase: TupleToPrefixes< [parameters: { order?: operations.ExportCompletionFeedbackQueryParamOrder | undefined; rating?: operations.ExportCompletionFeedbackQueryParamRating | undefined; xOnBehalfOf?: string | undefined; }] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: [ "@meetkai/mka1", "feedback", "exportCompletionFeedback", ...queryKeyBase, ], }); } export function invalidateAllLlmFeedbackExportCompletionFeedback( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "feedback", "exportCompletionFeedback"], }); }