@byte_fluffy/nexra-sdk 0.1.0-alpha.50 → 0.1.0-alpha.52
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/catalog.js
CHANGED
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
listModelSpecs,
|
|
10
10
|
projectMediaGeometry,
|
|
11
11
|
resolveNexraLanguageReasoning
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-V3KBU3J5.js";
|
|
13
|
+
import "./chunk-LEZWVFQH.js";
|
|
14
14
|
export {
|
|
15
15
|
CatalogClient,
|
|
16
16
|
applyMediaGeometry,
|
|
@@ -747,9 +747,9 @@ function isNexraMediaInput(value) {
|
|
|
747
747
|
}
|
|
748
748
|
function nexraMediaOperationForMode(mode) {
|
|
749
749
|
if (["text-to-image", "image-to-image"].includes(mode)) return "image.generate";
|
|
750
|
-
if (["text-to-video", "image-to-video", "multimodal-to-video", "avatar-video"].includes(mode)) return "video.generate";
|
|
750
|
+
if (["text-to-video", "image-to-video", "multimodal-to-video", "avatar-video", "draft-to-video"].includes(mode)) return "video.generate";
|
|
751
751
|
if (mode === "audio-to-text") return "audio.transcribe";
|
|
752
|
-
if (["text-to-speech", "text-to-music", "text-to-sfx"].includes(mode)) return "audio.generate";
|
|
752
|
+
if (["text-to-speech", "text-to-music", "text-to-sfx", "voice-design"].includes(mode)) return "audio.generate";
|
|
753
753
|
if (mode === "image-upscale") return "image.upscale";
|
|
754
754
|
if (mode === "video-upscale") return "video.upscale";
|
|
755
755
|
if (mode === "video-depth") return "video.depth";
|
|
@@ -768,11 +768,11 @@ function nexraMediaInputSchemaForMode(mode) {
|
|
|
768
768
|
for (const variant of variants) {
|
|
769
769
|
const variantProperties = variant.properties;
|
|
770
770
|
if (variantProperties.type.const === "text") {
|
|
771
|
-
variantProperties.role = { type: "string", enum: ["script"] };
|
|
771
|
+
variantProperties.role = { type: "string", enum: ["script", "prompt"] };
|
|
772
772
|
}
|
|
773
773
|
}
|
|
774
774
|
}
|
|
775
|
-
const allowed = mode === "text-to-image" || mode === "text-to-video" || mode === "text-to-music" || mode === "text-to-sfx" ? /* @__PURE__ */ new Set(["text"]) : mode === "image-to-image" ? /* @__PURE__ */ new Set(["text", "image"]) : mode === "image-to-video" ? /* @__PURE__ */ new Set(["text", "image", "audio"]) : mode === "text-to-speech" ? /* @__PURE__ */ new Set(["text", "audio"]) : /* @__PURE__ */ new Set(["text", "image", "video", "audio"]);
|
|
775
|
+
const allowed = mode === "draft-to-video" ? /* @__PURE__ */ new Set(["draft_task"]) : mode === "text-to-image" || mode === "text-to-video" || mode === "text-to-music" || mode === "text-to-sfx" ? /* @__PURE__ */ new Set(["text"]) : mode === "image-to-image" ? /* @__PURE__ */ new Set(["text", "image"]) : mode === "image-to-video" ? /* @__PURE__ */ new Set(["text", "image", "audio"]) : mode === "text-to-speech" ? /* @__PURE__ */ new Set(["text", "audio"]) : /* @__PURE__ */ new Set(["text", "image", "video", "audio"]);
|
|
776
776
|
items.oneOf = variants.filter((variant) => allowed.has(String(variant.properties.type.const)));
|
|
777
777
|
if (mode === "image-to-video") {
|
|
778
778
|
for (const variant of items.oneOf) {
|
|
@@ -798,7 +798,7 @@ function nexraMediaInputSchemaForMode(mode) {
|
|
|
798
798
|
const requiredMedia = ["video-depth", "video-segment"].includes(mode) ? "video" : mode === "image-to-image" || mode === "image-to-video" || mode === "avatar-video" ? "image" : void 0;
|
|
799
799
|
const requiresReferenceMedia = mode === "multimodal-to-video";
|
|
800
800
|
const hasTextPart = items.oneOf.some((variant) => variant.properties.type.const === "text");
|
|
801
|
-
|
|
801
|
+
const contentRules = [
|
|
802
802
|
...mode === "avatar-video" || !hasTextPart ? [] : [{
|
|
803
803
|
contains: { type: "object", properties: { type: { const: "text" } }, required: ["type"] },
|
|
804
804
|
minContains: 1
|
|
@@ -812,6 +812,8 @@ function nexraMediaInputSchemaForMode(mode) {
|
|
|
812
812
|
minContains: 1
|
|
813
813
|
}] : []
|
|
814
814
|
];
|
|
815
|
+
if (contentRules.length) content.allOf = contentRules;
|
|
816
|
+
else delete content.allOf;
|
|
815
817
|
if (mode === "text-to-speech") {
|
|
816
818
|
properties.voice = { ...properties.voice, "x-ui": { order: 10, control: "resource", resource: "voice" } };
|
|
817
819
|
}
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
normalizePublicErrorInput,
|
|
3
3
|
pickPublicErrorFields,
|
|
4
4
|
sortRatioDisplayOrder
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-LEZWVFQH.js";
|
|
6
6
|
|
|
7
7
|
// src/catalog/generated/audio.generated.json
|
|
8
8
|
var audio_generated_default = [
|
|
@@ -2799,6 +2799,331 @@ var audio_generated_default = [
|
|
|
2799
2799
|
|
|
2800
2800
|
// src/catalog/generated/image.generated.json
|
|
2801
2801
|
var image_generated_default = [
|
|
2802
|
+
{
|
|
2803
|
+
id: "bytedance/doubao-seedream-5-0-flash-260915",
|
|
2804
|
+
contractVersion: 1,
|
|
2805
|
+
developer: "bytedance",
|
|
2806
|
+
displayName: "Seedream 5.0 Flash",
|
|
2807
|
+
summary: "\u652F\u6301\u56FE\u50CF\u751F\u6210\u3001\u591A\u56FE\u7F16\u8F91\u53CA\u5355\u56FE\u5206\u5C42\u3002",
|
|
2808
|
+
kind: "image",
|
|
2809
|
+
family: "Doubao Seedream Flash",
|
|
2810
|
+
versionLabel: "5.0",
|
|
2811
|
+
aliases: [
|
|
2812
|
+
"seedream-5-0-flash",
|
|
2813
|
+
"seedream-5.0-flash",
|
|
2814
|
+
"volcengine/doubao-seedream-5-0-flash-260915"
|
|
2815
|
+
],
|
|
2816
|
+
capabilities: {
|
|
2817
|
+
inputModalities: [
|
|
2818
|
+
"text",
|
|
2819
|
+
"image"
|
|
2820
|
+
],
|
|
2821
|
+
outputModalities: [
|
|
2822
|
+
"image"
|
|
2823
|
+
],
|
|
2824
|
+
inputModes: [
|
|
2825
|
+
"text-to-image",
|
|
2826
|
+
"image-to-image"
|
|
2827
|
+
],
|
|
2828
|
+
features: []
|
|
2829
|
+
},
|
|
2830
|
+
operations: [
|
|
2831
|
+
{
|
|
2832
|
+
operation: "image.generate",
|
|
2833
|
+
inputModalities: [
|
|
2834
|
+
"text",
|
|
2835
|
+
"image"
|
|
2836
|
+
],
|
|
2837
|
+
outputModalities: [
|
|
2838
|
+
"image"
|
|
2839
|
+
],
|
|
2840
|
+
inputSchema: {
|
|
2841
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
2842
|
+
type: "object",
|
|
2843
|
+
properties: {
|
|
2844
|
+
content: {
|
|
2845
|
+
type: "array",
|
|
2846
|
+
minItems: 1,
|
|
2847
|
+
items: {
|
|
2848
|
+
oneOf: [
|
|
2849
|
+
{
|
|
2850
|
+
type: "object",
|
|
2851
|
+
properties: {
|
|
2852
|
+
type: {
|
|
2853
|
+
const: "text"
|
|
2854
|
+
},
|
|
2855
|
+
text: {
|
|
2856
|
+
type: "string",
|
|
2857
|
+
minLength: 1
|
|
2858
|
+
},
|
|
2859
|
+
role: {
|
|
2860
|
+
const: "prompt",
|
|
2861
|
+
title: "\u7528\u9014"
|
|
2862
|
+
}
|
|
2863
|
+
},
|
|
2864
|
+
required: [
|
|
2865
|
+
"type",
|
|
2866
|
+
"text"
|
|
2867
|
+
],
|
|
2868
|
+
additionalProperties: false
|
|
2869
|
+
},
|
|
2870
|
+
{
|
|
2871
|
+
type: "object",
|
|
2872
|
+
properties: {
|
|
2873
|
+
type: {
|
|
2874
|
+
const: "image"
|
|
2875
|
+
},
|
|
2876
|
+
source: {
|
|
2877
|
+
oneOf: [
|
|
2878
|
+
{
|
|
2879
|
+
type: "string",
|
|
2880
|
+
minLength: 1,
|
|
2881
|
+
format: "uri"
|
|
2882
|
+
},
|
|
2883
|
+
{
|
|
2884
|
+
type: "object",
|
|
2885
|
+
properties: {
|
|
2886
|
+
assetId: {
|
|
2887
|
+
type: "string",
|
|
2888
|
+
minLength: 1
|
|
2889
|
+
}
|
|
2890
|
+
},
|
|
2891
|
+
required: [
|
|
2892
|
+
"assetId"
|
|
2893
|
+
],
|
|
2894
|
+
additionalProperties: false
|
|
2895
|
+
}
|
|
2896
|
+
]
|
|
2897
|
+
},
|
|
2898
|
+
role: {
|
|
2899
|
+
type: "string",
|
|
2900
|
+
enum: [
|
|
2901
|
+
"source",
|
|
2902
|
+
"reference"
|
|
2903
|
+
],
|
|
2904
|
+
title: "\u7528\u9014"
|
|
2905
|
+
}
|
|
2906
|
+
},
|
|
2907
|
+
required: [
|
|
2908
|
+
"type",
|
|
2909
|
+
"source"
|
|
2910
|
+
],
|
|
2911
|
+
additionalProperties: false
|
|
2912
|
+
}
|
|
2913
|
+
]
|
|
2914
|
+
},
|
|
2915
|
+
"x-ui": {
|
|
2916
|
+
control: "content-parts",
|
|
2917
|
+
order: 0
|
|
2918
|
+
},
|
|
2919
|
+
title: "\u8F93\u5165\u5185\u5BB9",
|
|
2920
|
+
description: "\u666E\u901A\u751F\u56FE\u9700\u8981\u4E00\u6761\u63D0\u793A\u8BCD\uFF0C\u53EF\u9009\u53C2\u8003\u56FE\u7247\uFF1B\u56FE\u5C42\u62C6\u5206\u9700\u8981\u4E00\u5F20\u56FE\u7247\uFF0C\u53EF\u9009\u63D0\u793A\u8BCD\u3002",
|
|
2921
|
+
maxItems: 11,
|
|
2922
|
+
allOf: [
|
|
2923
|
+
{
|
|
2924
|
+
contains: {
|
|
2925
|
+
type: "object",
|
|
2926
|
+
properties: {
|
|
2927
|
+
type: {
|
|
2928
|
+
const: "text"
|
|
2929
|
+
}
|
|
2930
|
+
},
|
|
2931
|
+
required: [
|
|
2932
|
+
"type"
|
|
2933
|
+
]
|
|
2934
|
+
},
|
|
2935
|
+
minContains: 0,
|
|
2936
|
+
maxContains: 1
|
|
2937
|
+
},
|
|
2938
|
+
{
|
|
2939
|
+
contains: {
|
|
2940
|
+
type: "object",
|
|
2941
|
+
properties: {
|
|
2942
|
+
type: {
|
|
2943
|
+
const: "image"
|
|
2944
|
+
}
|
|
2945
|
+
},
|
|
2946
|
+
required: [
|
|
2947
|
+
"type"
|
|
2948
|
+
]
|
|
2949
|
+
},
|
|
2950
|
+
minContains: 0,
|
|
2951
|
+
maxContains: 10
|
|
2952
|
+
}
|
|
2953
|
+
]
|
|
2954
|
+
},
|
|
2955
|
+
output_format: {
|
|
2956
|
+
type: "string",
|
|
2957
|
+
enum: [
|
|
2958
|
+
"png",
|
|
2959
|
+
"jpeg"
|
|
2960
|
+
],
|
|
2961
|
+
title: "\u56FE\u7247\u683C\u5F0F",
|
|
2962
|
+
"x-ui": {
|
|
2963
|
+
order: 14,
|
|
2964
|
+
control: "segmented",
|
|
2965
|
+
optionLabels: {
|
|
2966
|
+
png: "PNG",
|
|
2967
|
+
jpeg: "JPEG"
|
|
2968
|
+
}
|
|
2969
|
+
}
|
|
2970
|
+
},
|
|
2971
|
+
aspect_ratio: {
|
|
2972
|
+
type: "string",
|
|
2973
|
+
enum: [
|
|
2974
|
+
"1:1",
|
|
2975
|
+
"4:3",
|
|
2976
|
+
"3:4",
|
|
2977
|
+
"16:9",
|
|
2978
|
+
"9:16",
|
|
2979
|
+
"3:2",
|
|
2980
|
+
"2:3",
|
|
2981
|
+
"21:9"
|
|
2982
|
+
],
|
|
2983
|
+
default: "1:1",
|
|
2984
|
+
title: "\u753B\u9762\u6BD4\u4F8B",
|
|
2985
|
+
description: "\u9009\u62E9\u8F93\u51FA\u753B\u9762\u7684\u5BBD\u9AD8\u6BD4\u4F8B\u3002",
|
|
2986
|
+
"x-ui": {
|
|
2987
|
+
order: 10,
|
|
2988
|
+
control: "segmented"
|
|
2989
|
+
}
|
|
2990
|
+
},
|
|
2991
|
+
resolution: {
|
|
2992
|
+
type: "string",
|
|
2993
|
+
enum: [
|
|
2994
|
+
"1K",
|
|
2995
|
+
"1.5K",
|
|
2996
|
+
"2K"
|
|
2997
|
+
],
|
|
2998
|
+
default: "2K",
|
|
2999
|
+
title: "\u5206\u8FA8\u7387",
|
|
3000
|
+
description: "\u9009\u62E9\u8F93\u51FA\u56FE\u7247\u7684\u5206\u8FA8\u7387\u6863\u4F4D\u3002",
|
|
3001
|
+
"x-ui": {
|
|
3002
|
+
order: 11,
|
|
3003
|
+
control: "segmented"
|
|
3004
|
+
}
|
|
3005
|
+
},
|
|
3006
|
+
output_mode: {
|
|
3007
|
+
type: "string",
|
|
3008
|
+
enum: [
|
|
3009
|
+
"image",
|
|
3010
|
+
"layers"
|
|
3011
|
+
],
|
|
3012
|
+
title: "\u8F93\u51FA\u6A21\u5F0F",
|
|
3013
|
+
"x-ui": {
|
|
3014
|
+
hidden: true
|
|
3015
|
+
}
|
|
3016
|
+
},
|
|
3017
|
+
prompt_optimization: {
|
|
3018
|
+
type: "string",
|
|
3019
|
+
enum: [
|
|
3020
|
+
"standard"
|
|
3021
|
+
],
|
|
3022
|
+
title: "\u4F18\u5316\u6A21\u5F0F",
|
|
3023
|
+
"x-ui": {
|
|
3024
|
+
hidden: true
|
|
3025
|
+
}
|
|
3026
|
+
}
|
|
3027
|
+
},
|
|
3028
|
+
required: [
|
|
3029
|
+
"content"
|
|
3030
|
+
],
|
|
3031
|
+
additionalProperties: false,
|
|
3032
|
+
allOf: [
|
|
3033
|
+
{
|
|
3034
|
+
if: {
|
|
3035
|
+
properties: {
|
|
3036
|
+
output_mode: {
|
|
3037
|
+
const: "layers"
|
|
3038
|
+
}
|
|
3039
|
+
},
|
|
3040
|
+
required: [
|
|
3041
|
+
"output_mode"
|
|
3042
|
+
]
|
|
3043
|
+
},
|
|
3044
|
+
then: {
|
|
3045
|
+
properties: {
|
|
3046
|
+
content: {
|
|
3047
|
+
type: "array",
|
|
3048
|
+
minItems: 1,
|
|
3049
|
+
maxItems: 2,
|
|
3050
|
+
allOf: [
|
|
3051
|
+
{
|
|
3052
|
+
type: "array",
|
|
3053
|
+
contains: {
|
|
3054
|
+
type: "object",
|
|
3055
|
+
properties: {
|
|
3056
|
+
type: {
|
|
3057
|
+
const: "image"
|
|
3058
|
+
}
|
|
3059
|
+
},
|
|
3060
|
+
required: [
|
|
3061
|
+
"type"
|
|
3062
|
+
]
|
|
3063
|
+
},
|
|
3064
|
+
minContains: 1,
|
|
3065
|
+
maxContains: 1
|
|
3066
|
+
}
|
|
3067
|
+
]
|
|
3068
|
+
},
|
|
3069
|
+
aspect_ratio: false,
|
|
3070
|
+
output_format: {
|
|
3071
|
+
const: "png"
|
|
3072
|
+
}
|
|
3073
|
+
}
|
|
3074
|
+
},
|
|
3075
|
+
else: {
|
|
3076
|
+
properties: {
|
|
3077
|
+
content: {
|
|
3078
|
+
type: "array",
|
|
3079
|
+
allOf: [
|
|
3080
|
+
{
|
|
3081
|
+
type: "array",
|
|
3082
|
+
contains: {
|
|
3083
|
+
type: "object",
|
|
3084
|
+
properties: {
|
|
3085
|
+
type: {
|
|
3086
|
+
const: "text"
|
|
3087
|
+
}
|
|
3088
|
+
},
|
|
3089
|
+
required: [
|
|
3090
|
+
"type"
|
|
3091
|
+
]
|
|
3092
|
+
},
|
|
3093
|
+
minContains: 1,
|
|
3094
|
+
maxContains: 1
|
|
3095
|
+
}
|
|
3096
|
+
]
|
|
3097
|
+
},
|
|
3098
|
+
prompt_optimization: false
|
|
3099
|
+
}
|
|
3100
|
+
}
|
|
3101
|
+
}
|
|
3102
|
+
]
|
|
3103
|
+
},
|
|
3104
|
+
outputSchema: {},
|
|
3105
|
+
metering: {
|
|
3106
|
+
schemaVersion: 1,
|
|
3107
|
+
kind: "non_token",
|
|
3108
|
+
metrics: [
|
|
3109
|
+
{
|
|
3110
|
+
metric: "requests",
|
|
3111
|
+
requirement: "required"
|
|
3112
|
+
},
|
|
3113
|
+
{
|
|
3114
|
+
metric: "input_images",
|
|
3115
|
+
requirement: "informational"
|
|
3116
|
+
},
|
|
3117
|
+
{
|
|
3118
|
+
metric: "output_images",
|
|
3119
|
+
requirement: "required"
|
|
3120
|
+
}
|
|
3121
|
+
]
|
|
3122
|
+
}
|
|
3123
|
+
}
|
|
3124
|
+
],
|
|
3125
|
+
endpoints: []
|
|
3126
|
+
},
|
|
2802
3127
|
{
|
|
2803
3128
|
id: "bytedance/image-enhancement",
|
|
2804
3129
|
contractVersion: 1,
|
|
@@ -61784,7 +62109,7 @@ var NexraWaitTimeoutError = class extends Error {
|
|
|
61784
62109
|
};
|
|
61785
62110
|
|
|
61786
62111
|
// src/generated/version.generated.ts
|
|
61787
|
-
var SDK_VERSION = "0.1.0-alpha.
|
|
62112
|
+
var SDK_VERSION = "0.1.0-alpha.52";
|
|
61788
62113
|
|
|
61789
62114
|
// src/transport.ts
|
|
61790
62115
|
var DEFAULT_BASE_URL = "https://api.nexra-ai.com/v1";
|
|
@@ -62045,6 +62370,7 @@ var productDisplayNames = /* @__PURE__ */ new Map([
|
|
|
62045
62370
|
["bytedance/doubao-seedance-2-5-260628", "Seedance 2.5"],
|
|
62046
62371
|
["bytedance/doubao-seedream-5-0-260128", "Seedream 5.0"],
|
|
62047
62372
|
["bytedance/doubao-seedream-5-0-pro-260628", "Seedream 5.0 Pro"],
|
|
62373
|
+
["bytedance/doubao-seedream-5-0-flash-260915", "Seedream 5.0 Flash"],
|
|
62048
62374
|
["bytedance/doubao-tts-v1", "Doubao TTS v1"],
|
|
62049
62375
|
["bytedance/doubao-tts-v2", "Doubao TTS v2"],
|
|
62050
62376
|
["deepseek/deepseek-v4-1-flash", "DeepSeek V4.1 Flash"],
|
package/dist/index.js
CHANGED
|
@@ -20,14 +20,14 @@ import {
|
|
|
20
20
|
projectMediaGeometry,
|
|
21
21
|
queryString,
|
|
22
22
|
sleep
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-V3KBU3J5.js";
|
|
24
24
|
import {
|
|
25
25
|
MEDIA_KINDS,
|
|
26
26
|
TASK_STATUSES,
|
|
27
27
|
createTaskRequest,
|
|
28
28
|
extractUpstreamErrorMessage,
|
|
29
29
|
isTerminalTaskStatus
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-LEZWVFQH.js";
|
|
31
31
|
|
|
32
32
|
// src/assets.ts
|
|
33
33
|
var AssetsClient = class {
|
package/dist/language.js
CHANGED
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
jsonBody,
|
|
7
7
|
parseServerSentEvents,
|
|
8
8
|
resolveNexraLanguageReasoning
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-V3KBU3J5.js";
|
|
10
10
|
import {
|
|
11
11
|
isPublicErrorCode,
|
|
12
12
|
publicErrorMessage,
|
|
13
13
|
resolvePublicErrorLocale
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-LEZWVFQH.js";
|
|
15
15
|
|
|
16
16
|
// src/language/index.ts
|
|
17
17
|
import { createAnthropic } from "@ai-sdk/anthropic";
|
package/dist/media.js
CHANGED