/* * 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 { buildLlmModelsListEffectivePricesQuery, LlmModelsListEffectivePricesQueryData, prefetchLlmModelsListEffectivePrices, queryKeyLlmModelsListEffectivePrices, } from "./llmModelsListEffectivePrices.core.js"; export { buildLlmModelsListEffectivePricesQuery, type LlmModelsListEffectivePricesQueryData, prefetchLlmModelsListEffectivePrices, queryKeyLlmModelsListEffectivePrices, }; export type LlmModelsListEffectivePricesQueryError = | SDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * List effective prices for the caller's models * * @remarks * For every active model, returns its registry-aware price: an org row, a cluster default for cluster lineage, or unpriced ($0). */ export function useLlmModelsListEffectivePrices( request: operations.ListEffectivePricesRequest, options?: QueryHookOptions< LlmModelsListEffectivePricesQueryData, LlmModelsListEffectivePricesQueryError >, ): UseQueryResult< LlmModelsListEffectivePricesQueryData, LlmModelsListEffectivePricesQueryError > { const client = useSDKContext(); return useQuery({ ...buildLlmModelsListEffectivePricesQuery( client, request, options, ), ...options, }); } /** * List effective prices for the caller's models * * @remarks * For every active model, returns its registry-aware price: an org row, a cluster default for cluster lineage, or unpriced ($0). */ export function useLlmModelsListEffectivePricesSuspense( request: operations.ListEffectivePricesRequest, options?: SuspenseQueryHookOptions< LlmModelsListEffectivePricesQueryData, LlmModelsListEffectivePricesQueryError >, ): UseSuspenseQueryResult< LlmModelsListEffectivePricesQueryData, LlmModelsListEffectivePricesQueryError > { const client = useSDKContext(); return useSuspenseQuery({ ...buildLlmModelsListEffectivePricesQuery( client, request, options, ), ...options, }); } export function setLlmModelsListEffectivePricesData( client: QueryClient, queryKeyBase: [parameters: { xOnBehalfOf?: string | undefined }], data: LlmModelsListEffectivePricesQueryData, ): LlmModelsListEffectivePricesQueryData | undefined { const key = queryKeyLlmModelsListEffectivePrices(...queryKeyBase); return client.setQueryData(key, data); } export function invalidateLlmModelsListEffectivePrices( client: QueryClient, queryKeyBase: TupleToPrefixes< [parameters: { xOnBehalfOf?: string | undefined }] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: [ "@meetkai/mka1", "models", "listEffectivePrices", ...queryKeyBase, ], }); } export function invalidateAllLlmModelsListEffectivePrices( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "models", "listEffectivePrices"], }); }