@brotu/ai 0.1.0
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/CATALOG.md +387 -0
- package/LICENSE +21 -0
- package/README.md +115 -0
- package/dist/adapters/byteplus.adapter.d.ts +51 -0
- package/dist/adapters/byteplus.adapter.d.ts.map +1 -0
- package/dist/adapters/elevenlabs.adapter.d.ts +48 -0
- package/dist/adapters/elevenlabs.adapter.d.ts.map +1 -0
- package/dist/adapters/estimate.d.ts +10 -0
- package/dist/adapters/estimate.d.ts.map +1 -0
- package/dist/adapters/google.adapter.d.ts +52 -0
- package/dist/adapters/google.adapter.d.ts.map +1 -0
- package/dist/adapters/kling.adapter.d.ts +57 -0
- package/dist/adapters/kling.adapter.d.ts.map +1 -0
- package/dist/adapters/openai.adapter.d.ts +40 -0
- package/dist/adapters/openai.adapter.d.ts.map +1 -0
- package/dist/adapters/qwen.adapter.d.ts +53 -0
- package/dist/adapters/qwen.adapter.d.ts.map +1 -0
- package/dist/catalog.cjs +988 -0
- package/dist/catalog.d.ts +27 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/catalog.js +20 -0
- package/dist/chunk-GKLTQ55S.js +1176 -0
- package/dist/client.d.ts +86 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/constants/model.types.d.ts +118 -0
- package/dist/constants/model.types.d.ts.map +1 -0
- package/dist/helpers/result.d.ts +54 -0
- package/dist/helpers/result.d.ts.map +1 -0
- package/dist/index.cjs +3568 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2386 -0
- package/dist/lib/jobs.d.ts +46 -0
- package/dist/lib/jobs.d.ts.map +1 -0
- package/dist/lib/storage.d.ts +33 -0
- package/dist/lib/storage.d.ts.map +1 -0
- package/dist/ports/content-generator.port.d.ts +170 -0
- package/dist/ports/content-generator.port.d.ts.map +1 -0
- package/dist/providers/byteplus.models.d.ts +51 -0
- package/dist/providers/byteplus.models.d.ts.map +1 -0
- package/dist/providers/elevenlabs.models.d.ts +27 -0
- package/dist/providers/elevenlabs.models.d.ts.map +1 -0
- package/dist/providers/google.models.d.ts +42 -0
- package/dist/providers/google.models.d.ts.map +1 -0
- package/dist/providers/kling.models.d.ts +159 -0
- package/dist/providers/kling.models.d.ts.map +1 -0
- package/dist/providers/openai.models.d.ts +27 -0
- package/dist/providers/openai.models.d.ts.map +1 -0
- package/dist/providers/qwen.models.d.ts +88 -0
- package/dist/providers/qwen.models.d.ts.map +1 -0
- package/dist/types.d.ts +55 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +72 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type Job, type JobSnapshot } from "../lib/jobs";
|
|
2
|
+
import { type AudioGenerationParams, type ContentGeneratorPort, type CostEstimate, type GenerationOutput, type GenerationParams, type GenerationResult, type GenerationType, type ImageGenerationParams, type TextGenerationParams, type VideoGenerationParams } from "../ports/content-generator.port";
|
|
3
|
+
export interface GoogleAdapterOptions {
|
|
4
|
+
apiKey: string;
|
|
5
|
+
baseUrl?: string;
|
|
6
|
+
maxPollAttempts?: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Google, through the Gemini Developer API.
|
|
10
|
+
*
|
|
11
|
+
* The host runs two conventions side by side and they cannot share a
|
|
12
|
+
* serializer: images use the Interactions API with snake_case `input` /
|
|
13
|
+
* `response_format`, while Veo uses the older `instances` / `parameters`
|
|
14
|
+
* envelope in camelCase. Each has its own builder below for that reason.
|
|
15
|
+
*/
|
|
16
|
+
export declare class GoogleAdapter implements ContentGeneratorPort {
|
|
17
|
+
readonly providerName = "google";
|
|
18
|
+
readonly supportedTypes: GenerationType[];
|
|
19
|
+
private readonly opts;
|
|
20
|
+
constructor(opts: GoogleAdapterOptions);
|
|
21
|
+
private get baseUrl();
|
|
22
|
+
private get headers();
|
|
23
|
+
private request;
|
|
24
|
+
generateImage(params: ImageGenerationParams): Promise<GenerationResult>;
|
|
25
|
+
private veoBody;
|
|
26
|
+
/**
|
|
27
|
+
* Omni speaks the Interactions API, so it gets its own builder — snake_case
|
|
28
|
+
* `input`/`response_format`, against Veo's camelCase predict envelope.
|
|
29
|
+
*/
|
|
30
|
+
private omniBody;
|
|
31
|
+
/** Generate or refine a video conversationally. Returns the interaction. */
|
|
32
|
+
omniVideo(params: VideoGenerationParams & {
|
|
33
|
+
previousInteractionId?: string;
|
|
34
|
+
}): Promise<{
|
|
35
|
+
interactionId?: string;
|
|
36
|
+
outputs: GenerationOutput[];
|
|
37
|
+
}>;
|
|
38
|
+
private runVideo;
|
|
39
|
+
/** Resume a Veo operation submitted earlier, possibly by another process. */
|
|
40
|
+
completeJob(job: Job): Promise<JobSnapshot>;
|
|
41
|
+
generateVideo(params: VideoGenerationParams): Promise<GenerationResult>;
|
|
42
|
+
generateAudio(_params: AudioGenerationParams): Promise<GenerationResult>;
|
|
43
|
+
generateText(_params: TextGenerationParams): Promise<GenerationResult>;
|
|
44
|
+
estimateCost(type: GenerationType, params: GenerationParams): Promise<CostEstimate>;
|
|
45
|
+
supportsModel(model: string): boolean;
|
|
46
|
+
getAvailableModels(): {
|
|
47
|
+
id: string;
|
|
48
|
+
name: string;
|
|
49
|
+
type: GenerationType;
|
|
50
|
+
}[];
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=google.adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google.adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/google.adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,GAAG,EACR,KAAK,WAAW,EAEhB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,YAAY,EAEjB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,qBA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C,YAAY,CAAC,CAEvB;IAED,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEpC;IAED,kBAAkB;;;cAKE,cAAc;QAQjC;CACD"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type Job, type JobSnapshot } from "../lib/jobs";
|
|
2
|
+
import { type AudioGenerationParams, type ContentGeneratorPort, type CostEstimate, type GenerationParams, type GenerationResult, type GenerationType, type ImageGenerationParams, type TextGenerationParams, type VideoGenerationParams } from "../ports/content-generator.port";
|
|
3
|
+
import { type KlingCapability } from "../providers/kling.models";
|
|
4
|
+
export interface KlingAdapterOptions {
|
|
5
|
+
apiKey: string;
|
|
6
|
+
baseUrl?: string;
|
|
7
|
+
/** Guards a job that never settles. Defaults to twenty minutes of polling. */
|
|
8
|
+
maxPollAttempts?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare class KlingAdapter implements ContentGeneratorPort {
|
|
11
|
+
readonly providerName = "kling";
|
|
12
|
+
readonly supportedTypes: GenerationType[];
|
|
13
|
+
private readonly opts;
|
|
14
|
+
constructor(opts: KlingAdapterOptions);
|
|
15
|
+
private get baseUrl();
|
|
16
|
+
private request;
|
|
17
|
+
private binding;
|
|
18
|
+
private submitPath;
|
|
19
|
+
private legacyBody;
|
|
20
|
+
private nextBody;
|
|
21
|
+
private submitTask;
|
|
22
|
+
private queryTask;
|
|
23
|
+
private outputsFrom;
|
|
24
|
+
/** A capability job carries `kling:<name>:<resultField>` in its model slot. */
|
|
25
|
+
private resultFieldOf;
|
|
26
|
+
private snapshot;
|
|
27
|
+
private run;
|
|
28
|
+
/**
|
|
29
|
+
* Submit any declared capability and hand back a job.
|
|
30
|
+
*
|
|
31
|
+
* The three axes that differ between them — API family, body, result field —
|
|
32
|
+
* all come from the capability itself, so this runs every one of them.
|
|
33
|
+
*/
|
|
34
|
+
submitCapability<TInput>(name: string, capability: KlingCapability<TInput>, input: TInput): Promise<Job>;
|
|
35
|
+
/** Resume a job submitted earlier, possibly by another process. */
|
|
36
|
+
completeJob(job: Job): Promise<JobSnapshot>;
|
|
37
|
+
generateImage(params: ImageGenerationParams): Promise<GenerationResult>;
|
|
38
|
+
generateVideo(params: VideoGenerationParams): Promise<GenerationResult>;
|
|
39
|
+
/** Your own cloned voices. Presets are in KLING_VOICES. */
|
|
40
|
+
listVoices(): Promise<Array<{
|
|
41
|
+
voiceId: string;
|
|
42
|
+
name?: string;
|
|
43
|
+
}>>;
|
|
44
|
+
/**
|
|
45
|
+
* Speech. Synchronous, and snake_case — unlike both video APIs on this host.
|
|
46
|
+
*/
|
|
47
|
+
generateAudio(params: AudioGenerationParams): Promise<GenerationResult>;
|
|
48
|
+
generateText(_params: TextGenerationParams): Promise<GenerationResult>;
|
|
49
|
+
estimateCost(type: GenerationType, params: GenerationParams): Promise<CostEstimate>;
|
|
50
|
+
supportsModel(model: string): boolean;
|
|
51
|
+
getAvailableModels(): {
|
|
52
|
+
id: string;
|
|
53
|
+
name: string;
|
|
54
|
+
type: GenerationType;
|
|
55
|
+
}[];
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=kling.adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kling.adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/kling.adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,GAAG,EACR,KAAK,WAAW,EAEhB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,YAAY,EAGjB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAIN,KAAK,eAAe,EAGpB,MAAM,2BAA2B,CAAC;AAGnC,MAAM,WAAW,mBAAmB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC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,EAAE,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAErE;IAEK,YAAY,CACjB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,gBAAgB,GACtB,OAAO,CAAC,YAAY,CAAC,CAEvB;IAED,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEpC;IAED,kBAAkB;;;cAIM,cAAc;QAErC;CACD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Job, JobSnapshot } from "../lib/jobs";
|
|
2
|
+
import type { AudioGenerationParams, ContentGeneratorPort, CostEstimate, GenerationParams, GenerationResult, GenerationType, ImageGenerationParams, TextGenerationParams, VideoGenerationParams } from "../ports/content-generator.port";
|
|
3
|
+
export interface OpenAIAdapterOptions {
|
|
4
|
+
apiKey: string;
|
|
5
|
+
baseUrl?: string;
|
|
6
|
+
/** Sent as OpenAI-Organization when set. */
|
|
7
|
+
organization?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* OpenAI image generation.
|
|
11
|
+
*
|
|
12
|
+
* Two things shape this adapter. It is synchronous — there is no job to poll,
|
|
13
|
+
* so `submit()` hands back an already-settled one. And the gpt-image models
|
|
14
|
+
* return **base64 only**, never a URL, so outputs come back as data URIs. Give
|
|
15
|
+
* the client a `storage` bucket and they are copied into it; `fetch` reads a
|
|
16
|
+
* data URI directly, so nothing special is needed for that.
|
|
17
|
+
*/
|
|
18
|
+
export declare class OpenAIAdapter implements ContentGeneratorPort {
|
|
19
|
+
readonly providerName = "openai";
|
|
20
|
+
readonly supportedTypes: GenerationType[];
|
|
21
|
+
private readonly opts;
|
|
22
|
+
constructor(opts: OpenAIAdapterOptions);
|
|
23
|
+
private get baseUrl();
|
|
24
|
+
private binding;
|
|
25
|
+
private buildBody;
|
|
26
|
+
generateImage(params: ImageGenerationParams): Promise<GenerationResult>;
|
|
27
|
+
generateVideo(_params: VideoGenerationParams): Promise<GenerationResult>;
|
|
28
|
+
generateAudio(_params: AudioGenerationParams): Promise<GenerationResult>;
|
|
29
|
+
generateText(_params: TextGenerationParams): Promise<GenerationResult>;
|
|
30
|
+
/** Synchronous provider: there is never a queued job to come back to. */
|
|
31
|
+
completeJob(job: Job): Promise<JobSnapshot>;
|
|
32
|
+
estimateCost(type: GenerationType, params: GenerationParams): Promise<CostEstimate>;
|
|
33
|
+
supportsModel(model: string): boolean;
|
|
34
|
+
getAvailableModels(): {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
type: GenerationType;
|
|
38
|
+
}[];
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=openai.adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai.adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/openai.adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EACX,qBAAqB,EACrB,oBAAoB,EACpB,YAAY,EAEZ,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,MAAM,iCAAiC,CAAC;AAOzC,MAAM,WAAW,oBAAoB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAUD;;;;;;;;GAQG;AACH,qBAAa,aAAc,YAAW,oBAAoB;IACzD,QAAQ,CAAC,YAAY,YAAY;IAEjC,QAAQ,CAAC,cAAc,EAAE,cAAc,EAAE,CAAa;IAEtD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAuB;IAE5C,YAAY,IAAI,EAAE,oBAAoB,EAErC;IAED,OAAO,KAAK,OAAO,GAElB;IAED,OAAO,CAAC,OAAO;IAWf,OAAO,CAAC,SAAS;IA6CX,aAAa,CAClB,MAAM,EAAE,qBAAqB,GAC3B,OAAO,CAAC,gBAAgB,CAAC,CAmE3B;IAED,aAAa,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAIvE;IAED,aAAa,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAEvE;IAED,YAAY,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAErE;IAED,yEAAyE;IACnE,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,WAAW,CAAC,CAKhD;IAEK,YAAY,CACjB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,gBAAgB,GACtB,OAAO,CAAC,YAAY,CAAC,CAgBvB;IAED,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEpC;IAED,kBAAkB;;;cAIC,cAAc;QAEhC;CACD"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type Job, type JobSnapshot } from "../lib/jobs";
|
|
2
|
+
import { type AudioGenerationParams, type ContentGeneratorPort, type CostEstimate, type GenerationParams, type GenerationResult, type GenerationType, type ImageGenerationParams, type TextGenerationParams, type VideoGenerationParams } from "../ports/content-generator.port";
|
|
3
|
+
export interface QwenAdapterOptions {
|
|
4
|
+
apiKey: string;
|
|
5
|
+
baseUrl?: string;
|
|
6
|
+
maxPollAttempts?: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Qwen Cloud / DashScope International.
|
|
10
|
+
*
|
|
11
|
+
* Verified end to end against the live API: this adapter's request shape queued
|
|
12
|
+
* a real task and the poll returned a playable video, which is why the field
|
|
13
|
+
* names here are transcribed rather than inferred.
|
|
14
|
+
*/
|
|
15
|
+
export declare class QwenAdapter implements ContentGeneratorPort {
|
|
16
|
+
readonly providerName = "qwen";
|
|
17
|
+
readonly supportedTypes: GenerationType[];
|
|
18
|
+
private readonly opts;
|
|
19
|
+
constructor(opts: QwenAdapterOptions);
|
|
20
|
+
private get baseUrl();
|
|
21
|
+
private request;
|
|
22
|
+
private binding;
|
|
23
|
+
private videoBody;
|
|
24
|
+
private outputsFrom;
|
|
25
|
+
private snapshot;
|
|
26
|
+
private run;
|
|
27
|
+
/** Resume a job submitted earlier, possibly by another process. */
|
|
28
|
+
completeJob(job: Job): Promise<JobSnapshot>;
|
|
29
|
+
generateVideo(params: VideoGenerationParams): Promise<GenerationResult>;
|
|
30
|
+
/**
|
|
31
|
+
* Every image model wired up here answers inline, so this makes no task.
|
|
32
|
+
*
|
|
33
|
+
* That is not a style choice: sending `X-DashScope-Async: enable` to a
|
|
34
|
+
* sync-only model returns 429, which reads as rate limiting and never clears
|
|
35
|
+
* on retry. The header is gated on the model's own flag for that reason.
|
|
36
|
+
*/
|
|
37
|
+
generateImage(params: ImageGenerationParams): Promise<GenerationResult>;
|
|
38
|
+
/**
|
|
39
|
+
* Speech. Synchronous: the audio URL comes back on the same response, with a
|
|
40
|
+
* real expiry attached rather than one we guess at.
|
|
41
|
+
*/
|
|
42
|
+
generateAudio(params: AudioGenerationParams): Promise<GenerationResult>;
|
|
43
|
+
/** Text, through the OpenAI-compatible surface. Synchronous. */
|
|
44
|
+
generateText(params: TextGenerationParams): Promise<GenerationResult>;
|
|
45
|
+
estimateCost(type: GenerationType, params: GenerationParams): Promise<CostEstimate>;
|
|
46
|
+
supportsModel(model: string): boolean;
|
|
47
|
+
getAvailableModels(): {
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
type: GenerationType;
|
|
51
|
+
}[];
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=qwen.adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qwen.adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/qwen.adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,GAAG,EACR,KAAK,WAAW,EAEhB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,KAAK,qBAAqB,EAC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