UNPKG

@huggingface/inference

Version:

Typescript client for the Hugging Face Inference Providers and Inference Endpoints

20 lines (17 loc) 440 B
import type { BaseArgs, InferenceProvider, RequestArgs } from "../../types"; import { omit } from "../../utils/omit"; /** * @deprecated */ export interface LegacyAudioInput { data: Blob | ArrayBuffer; provider?: InferenceProvider; } export function preparePayload(args: BaseArgs & ({ inputs: Blob } | LegacyAudioInput)): RequestArgs { return "data" in args ? args : { ...omit(args, "inputs"), data: args.inputs, }; }