@nodetool-ai/runtime 0.7.0-rc.20 → 0.7.0-rc.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/providers/aki-provider.d.ts +11 -46
- package/dist/providers/aki-provider.d.ts.map +1 -1
- package/dist/providers/aki-provider.js +52 -311
- package/dist/providers/aki-provider.js.map +1 -1
- package/dist/providers/together-provider.d.ts +67 -1
- package/dist/providers/together-provider.d.ts.map +1 -1
- package/dist/providers/together-provider.js +703 -1
- package/dist/providers/together-provider.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import OpenAI from "openai";
|
|
2
2
|
import { OpenAIProvider } from "./openai-provider.js";
|
|
3
|
-
import type { LanguageModel } from "./types.js";
|
|
3
|
+
import type { ASRModel, EmbeddingModel, EncodedAudioResult, ImageModel, ImageToImageParams, ImageToVideoParams, LanguageModel, StreamingAudioChunk, TextToImageParams, TextToVideoParams, TTSModel, VideoModel } from "./types.js";
|
|
4
4
|
interface TogetherProviderOptions {
|
|
5
5
|
client?: OpenAI;
|
|
6
6
|
clientFactory?: (apiKey: string) => OpenAI;
|
|
@@ -15,6 +15,72 @@ export declare class TogetherProvider extends OpenAIProvider {
|
|
|
15
15
|
getContainerEnv(): Record<string, string>;
|
|
16
16
|
hasToolSupport(_model: string): Promise<boolean>;
|
|
17
17
|
getAvailableLanguageModels(): Promise<LanguageModel[]>;
|
|
18
|
+
getAvailableImageModels(): Promise<ImageModel[]>;
|
|
19
|
+
/**
|
|
20
|
+
* Text-to-image generation via Together's `/v1/images/generations` endpoint.
|
|
21
|
+
* Uses Together's native `width` / `height` params rather than OpenAI's
|
|
22
|
+
* combined `size` string so we can pass the full resolution range.
|
|
23
|
+
*/
|
|
24
|
+
textToImage(params: TextToImageParams): Promise<Uint8Array>;
|
|
25
|
+
/**
|
|
26
|
+
* Image-to-image editing via Together's Kontext models.
|
|
27
|
+
* The image is encoded as a base64 data URI and passed as `image_url`.
|
|
28
|
+
* This requires a model that supports the `image_url` parameter
|
|
29
|
+
* (e.g. FLUX.1-kontext-pro, FLUX.1-kontext-max, FLUX.2-pro/dev/flex).
|
|
30
|
+
*/
|
|
31
|
+
imageToImage(image: Uint8Array, params: ImageToImageParams): Promise<Uint8Array>;
|
|
32
|
+
getAvailableTTSModels(): Promise<TTSModel[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Stream TTS audio as raw PCM Int16 samples.
|
|
35
|
+
* Together's `/v1/audio/speech` endpoint uses "wav" / "mp3" / "raw" rather
|
|
36
|
+
* than OpenAI's "pcm" label, so we request "wav" and strip the header.
|
|
37
|
+
*/
|
|
38
|
+
textToSpeech(args: {
|
|
39
|
+
text: string;
|
|
40
|
+
model: string;
|
|
41
|
+
voice?: string;
|
|
42
|
+
speed?: number;
|
|
43
|
+
audioFormat?: string;
|
|
44
|
+
}): AsyncGenerator<StreamingAudioChunk>;
|
|
45
|
+
/**
|
|
46
|
+
* Return fully-encoded TTS audio (mp3, wav, or mulaw).
|
|
47
|
+
* Returns `null` for unsupported formats so the caller falls back to the
|
|
48
|
+
* streaming PCM path.
|
|
49
|
+
*/
|
|
50
|
+
textToSpeechEncoded(args: {
|
|
51
|
+
text: string;
|
|
52
|
+
model: string;
|
|
53
|
+
voice?: string;
|
|
54
|
+
speed?: number;
|
|
55
|
+
audioFormat?: string;
|
|
56
|
+
}): Promise<EncodedAudioResult | null>;
|
|
57
|
+
getAvailableASRModels(): Promise<ASRModel[]>;
|
|
58
|
+
getAvailableEmbeddingModels(): Promise<EmbeddingModel[]>;
|
|
59
|
+
getAvailableVideoModels(): Promise<VideoModel[]>;
|
|
60
|
+
/**
|
|
61
|
+
* Map generic resolution / aspect-ratio hints to concrete pixel dimensions
|
|
62
|
+
* suitable for Together's video API.
|
|
63
|
+
*/
|
|
64
|
+
private resolveVideoDimensions;
|
|
65
|
+
/**
|
|
66
|
+
* Poll Together's video job endpoint until it reaches a terminal state.
|
|
67
|
+
* Returns the final response payload.
|
|
68
|
+
*/
|
|
69
|
+
private pollVideoJob;
|
|
70
|
+
/**
|
|
71
|
+
* Download a completed video from its signed URL and return the raw bytes.
|
|
72
|
+
*/
|
|
73
|
+
private downloadVideo;
|
|
74
|
+
/**
|
|
75
|
+
* Text-to-video generation via Together's asynchronous `/v2/videos` API.
|
|
76
|
+
* Submits the job then polls until completion, returning the raw video bytes.
|
|
77
|
+
*/
|
|
78
|
+
textToVideo(params: TextToVideoParams): Promise<Uint8Array>;
|
|
79
|
+
/**
|
|
80
|
+
* Image-to-video generation via Together's asynchronous `/v2/videos` API.
|
|
81
|
+
* The first frame is supplied as a base64-encoded image in `frame_images`.
|
|
82
|
+
*/
|
|
83
|
+
imageToVideo(image: Uint8Array, params: ImageToVideoParams): Promise<Uint8Array>;
|
|
18
84
|
}
|
|
19
85
|
export {};
|
|
20
86
|
//# sourceMappingURL=together-provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"together-provider.d.ts","sourceRoot":"","sources":["../../src/providers/together-provider.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"together-provider.d.ts","sourceRoot":"","sources":["../../src/providers/together-provider.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,QAAQ,EACR,UAAU,EACX,MAAM,YAAY,CAAC;AAEpB,UAAU,uBAAuB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAA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