/** * See the registered mapping of HF model ID => Together model ID here: * * https://huggingface.co/api/partners/together/models * * This is a publicly available mapping. * * If you want to try to run inference for a new model locally before it's registered on huggingface.co, * you can add it to the dictionary "HARDCODED_MODEL_ID_MAPPING" in consts.ts, for dev purposes. * * - If you work at Together and want to update this mapping, please use the model mapping API we provide on huggingface.co * - If you're a community member and want to add a new supported HF model to Together, please open an issue on the present repo * and we will tag Together team members. * * Thanks! */ import type { AutomaticSpeechRecognitionOutput, ChatCompletionOutput, FeatureExtractionOutput, TextGenerationOutput, TextGenerationOutputFinishReason } from "@huggingface/tasks"; import type { BodyParams, OutputType, RequestArgs } from "../types.js"; import { BaseConversationalTask, BaseTextGenerationTask, TaskProviderHelper, type AutomaticSpeechRecognitionTaskHelper, type FeatureExtractionTaskHelper, type ImageToImageTaskHelper, type ImageToVideoTaskHelper, type TextToImageTaskHelper, type TextToSpeechTaskHelper, type TextToVideoTaskHelper } from "./providerHelper.js"; import type { ChatCompletionInput } from "../../../tasks/dist/commonjs/index.js"; import type { AutomaticSpeechRecognitionArgs } from "../tasks/audio/automaticSpeechRecognition.js"; import type { ImageToImageArgs } from "../tasks/cv/imageToImage.js"; import type { ImageToVideoArgs } from "../tasks/cv/imageToVideo.js"; interface TogetherTextCompletionOutput extends Omit { choices: Array<{ text: string; finish_reason: TextGenerationOutputFinishReason; seed: number; logprobs: unknown; index: number; }>; } interface TogetherImageGeneration { data: Array<{ b64_json?: string; url?: string; }>; } interface TogetherEmbeddingsResponse { data: Array<{ embedding: number[]; index: number; object: string; }>; model: string; object: string; } interface TogetherAudioTranscriptionSegment { id: number; start: number; end: number; text: string; } interface TogetherAudioTranscriptionResponse { text: string; segments?: TogetherAudioTranscriptionSegment[]; } interface TogetherVideoJobResponse { id: string; status?: string; outputs?: { video_url?: string; }; error?: { message?: string; }; } export declare class TogetherConversationalTask extends BaseConversationalTask { constructor(); preparePayload(params: BodyParams): Record; } export declare class TogetherTextGenerationTask extends BaseTextGenerationTask { constructor(); preparePayload(params: BodyParams): Record; getResponse(response: TogetherTextCompletionOutput): Promise; } export declare class TogetherTextToImageTask extends TaskProviderHelper implements TextToImageTaskHelper { constructor(); makeRoute(): string; preparePayload(params: BodyParams): Record; /** Task label used in malformed-response errors. Overridden by subclasses. */ protected get imageTaskLabel(): string; getResponse(response: TogetherImageGeneration, url?: string, headers?: HeadersInit, outputType?: OutputType, signal?: AbortSignal): Promise>; } export declare class TogetherImageToImageTask extends TogetherTextToImageTask implements ImageToImageTaskHelper { protected get imageTaskLabel(): string; preparePayload(params: BodyParams): Record; preparePayloadAsync(args: ImageToImageArgs): Promise; getResponse(response: TogetherImageGeneration, url?: string, headers?: HeadersInit, outputType?: OutputType): Promise; } /** Shared base for Together's async video tasks (text-to-video, image-to-video). */ declare abstract class TogetherVideoTask extends TaskProviderHelper { constructor(); makeRoute(): string; getResponse(response: TogetherVideoJobResponse, url?: string, headers?: Record, _outputType?: OutputType, signal?: AbortSignal): Promise; } export declare class TogetherTextToVideoTask extends TogetherVideoTask implements TextToVideoTaskHelper { preparePayload(params: BodyParams): Record; } export declare class TogetherImageToVideoTask extends TogetherVideoTask implements ImageToVideoTaskHelper { preparePayload(params: BodyParams): Record; preparePayloadAsync(args: ImageToVideoArgs): Promise; } export declare class TogetherFeatureExtractionTask extends TaskProviderHelper implements FeatureExtractionTaskHelper { constructor(); makeRoute(): string; preparePayload(params: BodyParams): Record; getResponse(response: TogetherEmbeddingsResponse): Promise; } export declare class TogetherTextToSpeechTask extends TaskProviderHelper implements TextToSpeechTaskHelper { constructor(); makeRoute(): string; preparePayload(params: BodyParams): Record; getResponse(response: Blob): Promise; } export declare class TogetherAutomaticSpeechRecognitionTask extends TaskProviderHelper implements AutomaticSpeechRecognitionTaskHelper { constructor(); makeRoute(): string; preparePayload(params: BodyParams): Record; makeBody(params: BodyParams): BodyInit; preparePayloadAsync(args: AutomaticSpeechRecognitionArgs): Promise; getResponse(response: TogetherAudioTranscriptionResponse): Promise; } export {}; //# sourceMappingURL=together.d.ts.map