@sogni-ai/sogni-client 4.2.0-alpha.2 → 4.2.0-alpha.21
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/CHANGELOG.md +148 -0
- package/CLAUDE.md +25 -3
- package/README.md +411 -136
- package/dist/Account/index.d.ts +4 -2
- package/dist/Account/index.js +27 -23
- package/dist/Account/index.js.map +1 -1
- package/dist/Account/types.d.ts +7 -0
- package/dist/ApiClient/WebSocketClient/BrowserWebSocketClient/index.d.ts +3 -1
- package/dist/ApiClient/WebSocketClient/BrowserWebSocketClient/index.js +26 -2
- package/dist/ApiClient/WebSocketClient/BrowserWebSocketClient/index.js.map +1 -1
- package/dist/ApiClient/WebSocketClient/eventSubscriptions.d.ts +33 -0
- package/dist/ApiClient/WebSocketClient/eventSubscriptions.js +39 -0
- package/dist/ApiClient/WebSocketClient/eventSubscriptions.js.map +1 -0
- package/dist/ApiClient/WebSocketClient/events.d.ts +24 -7
- package/dist/ApiClient/WebSocketClient/index.d.ts +5 -1
- package/dist/ApiClient/WebSocketClient/index.js +24 -1
- package/dist/ApiClient/WebSocketClient/index.js.map +1 -1
- package/dist/ApiClient/WebSocketClient/messages.d.ts +2 -0
- package/dist/ApiClient/WebSocketClient/types.d.ts +2 -0
- package/dist/ApiClient/index.d.ts +6 -1
- package/dist/ApiClient/index.js +7 -3
- package/dist/ApiClient/index.js.map +1 -1
- package/dist/Chat/ChatTools.d.ts +5 -49
- package/dist/Chat/ChatTools.js +311 -88
- package/dist/Chat/ChatTools.js.map +1 -1
- package/dist/Chat/index.d.ts +11 -2
- package/dist/Chat/index.js +78 -4
- package/dist/Chat/index.js.map +1 -1
- package/dist/Chat/modelRouting.d.ts +100 -0
- package/dist/Chat/modelRouting.js +441 -0
- package/dist/Chat/modelRouting.js.map +1 -0
- package/dist/Chat/sogniHostedTools.generated.json +529 -0
- package/dist/Chat/tools.d.ts +9 -55
- package/dist/Chat/tools.js +72 -228
- package/dist/Chat/tools.js.map +1 -1
- package/dist/Chat/types.d.ts +91 -2
- package/dist/CreativeWorkflows/index.d.ts +23 -0
- package/dist/CreativeWorkflows/index.js +274 -0
- package/dist/CreativeWorkflows/index.js.map +1 -0
- package/dist/CreativeWorkflows/types.d.ts +106 -0
- package/dist/CreativeWorkflows/types.js +3 -0
- package/dist/CreativeWorkflows/types.js.map +1 -0
- package/dist/Projects/Job.d.ts +6 -0
- package/dist/Projects/Job.js +60 -5
- package/dist/Projects/Job.js.map +1 -1
- package/dist/Projects/Project.js +15 -3
- package/dist/Projects/Project.js.map +1 -1
- package/dist/Projects/createJobRequestMessage.js +140 -6
- package/dist/Projects/createJobRequestMessage.js.map +1 -1
- package/dist/Projects/index.d.ts +10 -1
- package/dist/Projects/index.js +197 -58
- package/dist/Projects/index.js.map +1 -1
- package/dist/Projects/types/ModelOptions.d.ts +3 -3
- package/dist/Projects/types/ModelOptions.js +12 -5
- package/dist/Projects/types/ModelOptions.js.map +1 -1
- package/dist/Projects/types/ModelTiersRaw.d.ts +7 -7
- package/dist/Projects/types/RawProject.d.ts +2 -0
- package/dist/Projects/types/events.d.ts +5 -4
- package/dist/Projects/types/index.d.ts +77 -7
- package/dist/Projects/types/index.js.map +1 -1
- package/dist/Projects/utils/index.d.ts +8 -1
- package/dist/Projects/utils/index.js +22 -8
- package/dist/Projects/utils/index.js.map +1 -1
- package/dist/index.d.ts +28 -3
- package/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/RestClient.d.ts +4 -1
- package/dist/lib/RestClient.js +17 -9
- package/dist/lib/RestClient.js.map +1 -1
- package/dist/lib/mediaValidation.d.ts +16 -0
- package/dist/lib/mediaValidation.js +280 -0
- package/dist/lib/mediaValidation.js.map +1 -0
- package/dist/lib/validation.d.ts +6 -1
- package/dist/lib/validation.js +28 -2
- package/dist/lib/validation.js.map +1 -1
- package/llms-full.txt +372 -133
- package/llms.txt +197 -86
- package/package.json +13 -4
- package/src/Account/index.ts +22 -2
- package/src/Account/types.ts +7 -0
- package/src/ApiClient/WebSocketClient/BrowserWebSocketClient/index.ts +47 -3
- package/src/ApiClient/WebSocketClient/eventSubscriptions.ts +92 -0
- package/src/ApiClient/WebSocketClient/events.ts +25 -7
- package/src/ApiClient/WebSocketClient/index.ts +33 -1
- package/src/ApiClient/WebSocketClient/messages.ts +2 -0
- package/src/ApiClient/WebSocketClient/types.ts +2 -0
- package/src/ApiClient/index.ts +32 -2
- package/src/Chat/ChatTools.ts +395 -95
- package/src/Chat/index.ts +149 -5
- package/src/Chat/modelRouting.ts +602 -0
- package/src/Chat/sogniHostedTools.generated.json +529 -0
- package/src/Chat/tools.ts +98 -245
- package/src/Chat/types.ts +100 -2
- package/src/CreativeWorkflows/index.ts +290 -0
- package/src/CreativeWorkflows/types.ts +134 -0
- package/src/Projects/Job.ts +76 -5
- package/src/Projects/Project.ts +13 -3
- package/src/Projects/createJobRequestMessage.ts +152 -13
- package/src/Projects/index.ts +230 -52
- package/src/Projects/types/ModelOptions.ts +15 -8
- package/src/Projects/types/ModelTiersRaw.ts +7 -7
- package/src/Projects/types/RawProject.ts +2 -0
- package/src/Projects/types/events.ts +5 -4
- package/src/Projects/types/index.ts +86 -6
- package/src/Projects/utils/index.ts +24 -8
- package/src/index.ts +93 -0
- package/src/lib/RestClient.ts +15 -5
- package/src/lib/mediaValidation.ts +367 -0
- package/src/lib/validation.ts +38 -2
|
@@ -0,0 +1,529 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "2026-04-30.1",
|
|
3
|
+
"source": "@sogni/creative-agent portable hosted Sogni tool contract",
|
|
4
|
+
"tools": [
|
|
5
|
+
{
|
|
6
|
+
"type": "function",
|
|
7
|
+
"function": {
|
|
8
|
+
"name": "sogni_generate_image",
|
|
9
|
+
"description": "Generate an image using AI image generation on the Sogni Supernet. Returns a URL to the generated image. Use this tool EVERY TIME the user asks to create, generate, draw, or make an image or picture. Do NOT generate URLs yourself — you MUST call this tool.",
|
|
10
|
+
"parameters": {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"properties": {
|
|
13
|
+
"prompt": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Detailed text description of the image to generate. Be specific about style, composition, lighting, colors, and subject matter."
|
|
16
|
+
},
|
|
17
|
+
"negative_prompt": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "Things to avoid in the generated image (e.g., \"blurry, low quality, distorted\")."
|
|
20
|
+
},
|
|
21
|
+
"width": {
|
|
22
|
+
"type": "number",
|
|
23
|
+
"description": "Image width in pixels. Default: 1024. For gpt-image-2, dimensions are flexible up to 3840px on either edge with max 3:1 aspect ratio and a total pixel budget from 655,360 to 8,294,400; the renderer snaps to the nearest valid multiple-of-16 size."
|
|
24
|
+
},
|
|
25
|
+
"height": {
|
|
26
|
+
"type": "number",
|
|
27
|
+
"description": "Image height in pixels. Default: 1024. For gpt-image-2, dimensions are flexible up to 3840px on either edge with max 3:1 aspect ratio and a total pixel budget from 655,360 to 8,294,400; the renderer snaps to the nearest valid multiple-of-16 size."
|
|
28
|
+
},
|
|
29
|
+
"model": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"description": "Image generation model to use. Use gpt-image-2 when the user asks for a ChatGPT, OpenAI, GPT, GPT-2, GPT Image, or gpt-image-2 image/model, when they explicitly request strong text rendering, or by default for complex single-image renders that need dense labels, crisp typography, multi-panel composition, timing notes, foley notes, or professional storyboard-sheet layout. If the user names another image model, honor that requested model instead.",
|
|
32
|
+
"enum": [
|
|
33
|
+
"gpt-image-2",
|
|
34
|
+
"flux1-schnell-fp8",
|
|
35
|
+
"flux2_dev_fp8",
|
|
36
|
+
"chroma-v.46-flash_fp8",
|
|
37
|
+
"z_image_turbo_bf16"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
"gpt_image_quality": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"description": "Optional GPT Image 2 rendering quality. Use low for fast drafts, medium for balanced quality, high for final/pro quality, or auto to let the renderer choose.",
|
|
43
|
+
"enum": ["low", "medium", "high", "auto"]
|
|
44
|
+
},
|
|
45
|
+
"output_format": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"description": "Optional image output format. Use only when explicitly requested. Hosts should normalize jpeg to jpg for Sogni project parameters.",
|
|
48
|
+
"enum": ["png", "jpg", "jpeg", "webp"]
|
|
49
|
+
},
|
|
50
|
+
"number_of_variations": {
|
|
51
|
+
"type": "number",
|
|
52
|
+
"description": "Number of image variations to generate. Range: 1-16. Default: 1."
|
|
53
|
+
},
|
|
54
|
+
"steps": {
|
|
55
|
+
"type": "number",
|
|
56
|
+
"description": "Number of inference steps. Higher = better quality but slower. Default depends on model (4-50)."
|
|
57
|
+
},
|
|
58
|
+
"seed": {
|
|
59
|
+
"type": "number",
|
|
60
|
+
"description": "Random seed for reproducible generation. Use -1 for random."
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"required": ["prompt"]
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"type": "function",
|
|
69
|
+
"function": {
|
|
70
|
+
"name": "sogni_edit_image",
|
|
71
|
+
"description": "Generate an edited or reference-guided image using 1-16 input images on the Sogni Supernet. Returns URLs to the generated images. Use this tool when the user wants to edit an existing image, preserve a person's likeness, combine multiple references, or transform a source image while keeping key visual traits.",
|
|
72
|
+
"parameters": {
|
|
73
|
+
"type": "object",
|
|
74
|
+
"properties": {
|
|
75
|
+
"prompt": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"description": "Describe the desired edit or new image while clearly stating what should be preserved from the provided reference images."
|
|
78
|
+
},
|
|
79
|
+
"source_image_url": {
|
|
80
|
+
"type": "string",
|
|
81
|
+
"description": "Primary image to edit or use as the main identity/composition reference. Supports inline base64-encoded PNG or JPEG data URIs only; remote http(s) URLs are not allowed."
|
|
82
|
+
},
|
|
83
|
+
"reference_image_urls": {
|
|
84
|
+
"type": "array",
|
|
85
|
+
"description": "Additional reference images to guide identity, pose, clothing, style, or background. Supports inline base64-encoded PNG or JPEG data URIs only; remote http(s) URLs are not allowed. Combined with source_image_url, up to 16 images total are used.",
|
|
86
|
+
"items": {
|
|
87
|
+
"type": "string"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"negative_prompt": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"description": "Things to avoid in the edited image (e.g., \"blurry, low quality, distorted\")."
|
|
93
|
+
},
|
|
94
|
+
"width": {
|
|
95
|
+
"type": "number",
|
|
96
|
+
"description": "Output image width in pixels. Default depends on the model. For gpt-image-2, dimensions are flexible up to 3840px on either edge with max 3:1 aspect ratio and a total pixel budget from 655,360 to 8,294,400; the renderer snaps to the nearest valid multiple-of-16 size."
|
|
97
|
+
},
|
|
98
|
+
"height": {
|
|
99
|
+
"type": "number",
|
|
100
|
+
"description": "Output image height in pixels. Default depends on the model. For gpt-image-2, dimensions are flexible up to 3840px on either edge with max 3:1 aspect ratio and a total pixel budget from 655,360 to 8,294,400; the renderer snaps to the nearest valid multiple-of-16 size."
|
|
101
|
+
},
|
|
102
|
+
"model": {
|
|
103
|
+
"type": "string",
|
|
104
|
+
"description": "Image editing model to use. Use gpt-image-2 when the user asks for a ChatGPT, OpenAI, GPT, GPT-2, GPT Image, or gpt-image-2 reference-guided image/edit/model, or by default for complex reference-guided single-image renders that need dense labels, crisp typography, multi-panel composition, timing notes, foley notes, or professional storyboard-sheet layout. If the user names another edit/image model, honor that requested model instead. GPT Image 2 always processes input images at high fidelity; do not set input_fidelity.",
|
|
105
|
+
"enum": [
|
|
106
|
+
"gpt-image-2",
|
|
107
|
+
"qwen_image_edit_2511_fp8_lightning",
|
|
108
|
+
"qwen_image_edit_2511_fp8",
|
|
109
|
+
"flux2_dev_fp8",
|
|
110
|
+
"flux1-dev-kontext_fp8_scaled"
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
"gpt_image_quality": {
|
|
114
|
+
"type": "string",
|
|
115
|
+
"description": "Optional GPT Image 2 rendering quality. Use low for fast drafts, medium for balanced quality, high for final/pro quality, or auto to let the renderer choose.",
|
|
116
|
+
"enum": ["low", "medium", "high", "auto"]
|
|
117
|
+
},
|
|
118
|
+
"output_format": {
|
|
119
|
+
"type": "string",
|
|
120
|
+
"description": "Optional image output format. Use only when explicitly requested. Hosts should normalize jpeg to jpg for Sogni project parameters.",
|
|
121
|
+
"enum": ["png", "jpg", "jpeg", "webp"]
|
|
122
|
+
},
|
|
123
|
+
"number_of_variations": {
|
|
124
|
+
"type": "number",
|
|
125
|
+
"description": "Number of edited image variations to generate. Range: 1-16. Default: 1."
|
|
126
|
+
},
|
|
127
|
+
"seed": {
|
|
128
|
+
"type": "number",
|
|
129
|
+
"description": "Random seed for reproducible generation. Use -1 for random."
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"required": ["prompt"]
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"type": "function",
|
|
138
|
+
"function": {
|
|
139
|
+
"name": "sogni_generate_video",
|
|
140
|
+
"description": "Generate a short video using AI video generation on the Sogni Supernet. Returns URLs to the generated videos. Use this tool EVERY TIME the user asks to create, generate, or make a video, clip, or animation. Do NOT generate URLs yourself — you MUST call this tool. Write the prompt as a cohesive mini-scene in present tense, describing motion, camera movement, lighting, and atmosphere in flowing prose.",
|
|
141
|
+
"parameters": {
|
|
142
|
+
"type": "object",
|
|
143
|
+
"properties": {
|
|
144
|
+
"prompt": {
|
|
145
|
+
"type": "string",
|
|
146
|
+
"description": "Detailed text description of the video to generate. Write it as a flowing present-tense scene: describe the subject, action, camera movement, lighting, and atmosphere. Clear camera-to-subject relationship improves motion consistency. Be specific and vivid."
|
|
147
|
+
},
|
|
148
|
+
"expand_prompt": {
|
|
149
|
+
"type": "boolean",
|
|
150
|
+
"description": "Seedance only. Whether Sogni API should expand this compact prompt with the shared Seedance LLM prompt shaper before dispatch. Defaults to true."
|
|
151
|
+
},
|
|
152
|
+
"negative_prompt": {
|
|
153
|
+
"type": "string",
|
|
154
|
+
"description": "Non-Seedance only. Optional negative prompt for video models that expose a separate negative-prompt field. Do not set for Seedance 2.0 or Seedance Fast; rewrite user-provided Seedance avoid/ban/no-X requests as positive visual instructions in prompt."
|
|
155
|
+
},
|
|
156
|
+
"reference_image_url": {
|
|
157
|
+
"type": "string",
|
|
158
|
+
"description": "Optional starting image for image-to-video generation. Supports inline base64-encoded PNG or JPEG data URIs only; remote http(s) URLs are not allowed."
|
|
159
|
+
},
|
|
160
|
+
"reference_image_end_url": {
|
|
161
|
+
"type": "string",
|
|
162
|
+
"description": "Optional ending image for keyframe interpolation. Supports inline base64-encoded PNG or JPEG data URIs only; remote http(s) URLs are not allowed."
|
|
163
|
+
},
|
|
164
|
+
"reference_image_urls": {
|
|
165
|
+
"type": "array",
|
|
166
|
+
"description": "Seedance-only additional image context references. Use publicly accessible HTTPS URLs in hosted workflows. Seedance accepts up to 9 image assets total including reference_image_url and reference_image_end_url.",
|
|
167
|
+
"maxItems": 9,
|
|
168
|
+
"items": {
|
|
169
|
+
"type": "string"
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"reference_video_urls": {
|
|
173
|
+
"type": "array",
|
|
174
|
+
"description": "Seedance-only video context references. Use publicly accessible HTTPS URLs in hosted workflows. Seedance accepts up to 3 video assets total.",
|
|
175
|
+
"maxItems": 3,
|
|
176
|
+
"items": {
|
|
177
|
+
"type": "string"
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
"reference_audio_urls": {
|
|
181
|
+
"type": "array",
|
|
182
|
+
"description": "Seedance-only audio context references. Use publicly accessible HTTPS URLs in hosted workflows. Seedance accepts up to 3 audio assets total. Text+audio-only is unsupported; include at least one image or video reference.",
|
|
183
|
+
"maxItems": 3,
|
|
184
|
+
"items": {
|
|
185
|
+
"type": "string"
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"reference_audio_identity_url": {
|
|
189
|
+
"type": "string",
|
|
190
|
+
"description": "Optional voice identity clip for LTX-2.3 text-to-video or image-to-video workflows. Supports inline base64-encoded MP3, M4A, or WAV data URIs only; remote http(s) URLs are not allowed."
|
|
191
|
+
},
|
|
192
|
+
"audio_identity_strength": {
|
|
193
|
+
"type": "number",
|
|
194
|
+
"description": "How strongly to apply the reference_audio_identity_url voice identity. Range: 0-10. Default depends on the model."
|
|
195
|
+
},
|
|
196
|
+
"first_frame_strength": {
|
|
197
|
+
"type": "number",
|
|
198
|
+
"description": "How strictly to match the starting frame when using reference_image_end_url. Range: 0-1."
|
|
199
|
+
},
|
|
200
|
+
"last_frame_strength": {
|
|
201
|
+
"type": "number",
|
|
202
|
+
"description": "How strictly to match the ending frame when using reference_image_end_url. Range: 0-1."
|
|
203
|
+
},
|
|
204
|
+
"width": {
|
|
205
|
+
"type": "number",
|
|
206
|
+
"description": "Video width in pixels. Default depends on the selected workflow. Standard resolutions include 1920x1088, 1088x1920, and 1280x720."
|
|
207
|
+
},
|
|
208
|
+
"height": {
|
|
209
|
+
"type": "number",
|
|
210
|
+
"description": "Video height in pixels. Default depends on the selected workflow. Must be a multiple of 16."
|
|
211
|
+
},
|
|
212
|
+
"duration": {
|
|
213
|
+
"type": "number",
|
|
214
|
+
"description": "Video duration in seconds. Range: 1-20 generally; Seedance supports 4-15. Default: 5."
|
|
215
|
+
},
|
|
216
|
+
"fps": {
|
|
217
|
+
"type": "number",
|
|
218
|
+
"description": "Frames per second. Default depends on the model. Range: 1-60."
|
|
219
|
+
},
|
|
220
|
+
"generate_audio": {
|
|
221
|
+
"type": "boolean",
|
|
222
|
+
"description": "Whether external API video models such as Seedance should generate native audio. Set false for silent output."
|
|
223
|
+
},
|
|
224
|
+
"model": {
|
|
225
|
+
"type": "string",
|
|
226
|
+
"description": "Video generation model to use. Supported selectors include ltx23, wan22, seedance2 and seedance2-fast. Seedance supports multimodal image, video, and audio references up to 12 total asset files; seedance2-fast caps at 720p."
|
|
227
|
+
},
|
|
228
|
+
"number_of_variations": {
|
|
229
|
+
"type": "number",
|
|
230
|
+
"description": "Number of video variations to generate. Range: 1-16. Default: 1."
|
|
231
|
+
},
|
|
232
|
+
"seed": {
|
|
233
|
+
"type": "number",
|
|
234
|
+
"description": "Random seed for reproducible generation. Use -1 for random."
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
"required": ["prompt"]
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"type": "function",
|
|
243
|
+
"function": {
|
|
244
|
+
"name": "sogni_sound_to_video",
|
|
245
|
+
"description": "Generate a short video synchronized to an input audio clip on the Sogni Supernet. Returns URLs to the generated videos. Use this when the user wants a music video, lip-sync style clip, or audio-reactive visuals driven by a specific audio file.",
|
|
246
|
+
"parameters": {
|
|
247
|
+
"type": "object",
|
|
248
|
+
"properties": {
|
|
249
|
+
"prompt": {
|
|
250
|
+
"type": "string",
|
|
251
|
+
"description": "Describe the visuals to generate in present tense while letting the supplied audio drive the timing and rhythm."
|
|
252
|
+
},
|
|
253
|
+
"expand_prompt": {
|
|
254
|
+
"type": "boolean",
|
|
255
|
+
"description": "Seedance only. Whether Sogni API should expand this compact prompt with the shared Seedance LLM prompt shaper before dispatch. Defaults to true."
|
|
256
|
+
},
|
|
257
|
+
"reference_audio_url": {
|
|
258
|
+
"type": "string",
|
|
259
|
+
"description": "Audio file to drive the video. Supports inline base64-encoded MP3, M4A, or WAV data URIs only; remote http(s) URLs are not allowed."
|
|
260
|
+
},
|
|
261
|
+
"reference_image_url": {
|
|
262
|
+
"type": "string",
|
|
263
|
+
"description": "Optional image to use as the subject or first frame. Supports inline base64-encoded PNG or JPEG data URIs only; remote http(s) URLs are not allowed."
|
|
264
|
+
},
|
|
265
|
+
"reference_image_urls": {
|
|
266
|
+
"type": "array",
|
|
267
|
+
"description": "Seedance-only additional image context references. Use publicly accessible HTTPS URLs in hosted workflows. Seedance accepts up to 9 image assets total including reference_image_url.",
|
|
268
|
+
"maxItems": 9,
|
|
269
|
+
"items": {
|
|
270
|
+
"type": "string"
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
"reference_audio_urls": {
|
|
274
|
+
"type": "array",
|
|
275
|
+
"description": "Seedance-only additional audio context references. Use publicly accessible HTTPS URLs in hosted workflows. Seedance accepts up to 3 audio assets total including reference_audio_url.",
|
|
276
|
+
"maxItems": 2,
|
|
277
|
+
"items": {
|
|
278
|
+
"type": "string"
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
"reference_video_urls": {
|
|
282
|
+
"type": "array",
|
|
283
|
+
"description": "Seedance-only video context references. Use publicly accessible HTTPS URLs in hosted workflows. Seedance accepts up to 3 video assets total.",
|
|
284
|
+
"maxItems": 3,
|
|
285
|
+
"items": {
|
|
286
|
+
"type": "string"
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
"audio_start": {
|
|
290
|
+
"type": "number",
|
|
291
|
+
"description": "Start offset in seconds into the reference audio. Default: 0."
|
|
292
|
+
},
|
|
293
|
+
"duration": {
|
|
294
|
+
"type": "number",
|
|
295
|
+
"description": "Output video duration in seconds. Range: 1-20 generally; Seedance supports 4-15. Default: 5."
|
|
296
|
+
},
|
|
297
|
+
"generate_audio": {
|
|
298
|
+
"type": "boolean",
|
|
299
|
+
"description": "Whether external API video models such as Seedance should generate native audio. Set false for silent output."
|
|
300
|
+
},
|
|
301
|
+
"width": {
|
|
302
|
+
"type": "number",
|
|
303
|
+
"description": "Video width in pixels. Default depends on the selected workflow."
|
|
304
|
+
},
|
|
305
|
+
"height": {
|
|
306
|
+
"type": "number",
|
|
307
|
+
"description": "Video height in pixels. Default depends on the selected workflow."
|
|
308
|
+
},
|
|
309
|
+
"model": {
|
|
310
|
+
"type": "string",
|
|
311
|
+
"description": "Audio-driven video model to use. seedance2 uses the Seedance audio-reference path and this hosted tool requires reference_image_url because Seedance text+audio without image/video is unsupported.",
|
|
312
|
+
"enum": [
|
|
313
|
+
"seedance2",
|
|
314
|
+
"seedance-2-0",
|
|
315
|
+
"ltx23-22b-fp8_ia2v_distilled",
|
|
316
|
+
"ltx23-22b-fp8_a2v_distilled",
|
|
317
|
+
"wan_v2.2-14b-fp8_s2v_lightx2v"
|
|
318
|
+
]
|
|
319
|
+
},
|
|
320
|
+
"number_of_variations": {
|
|
321
|
+
"type": "number",
|
|
322
|
+
"description": "Number of video variations to generate. Range: 1-16. Default: 1."
|
|
323
|
+
},
|
|
324
|
+
"seed": {
|
|
325
|
+
"type": "number",
|
|
326
|
+
"description": "Random seed for reproducible generation. Use -1 for random."
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
"required": ["prompt", "reference_audio_url"]
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
"type": "function",
|
|
335
|
+
"function": {
|
|
336
|
+
"name": "sogni_video_to_video",
|
|
337
|
+
"description": "Transform an existing video using AI video-to-video workflows on the Sogni Supernet. Returns URLs to the generated videos. Use this when the user wants to restyle a video, preserve motion while changing the look, or animate/replace a subject using a reference image.",
|
|
338
|
+
"parameters": {
|
|
339
|
+
"type": "object",
|
|
340
|
+
"properties": {
|
|
341
|
+
"prompt": {
|
|
342
|
+
"type": "string",
|
|
343
|
+
"description": "Describe the target appearance or transformation in present tense. For detail enhancement, describe the existing scene and the desired quality improvement rather than inventing new content."
|
|
344
|
+
},
|
|
345
|
+
"expand_prompt": {
|
|
346
|
+
"type": "boolean",
|
|
347
|
+
"description": "Seedance only. Whether Sogni API should expand this compact prompt with the shared Seedance LLM prompt shaper before dispatch. Defaults to true."
|
|
348
|
+
},
|
|
349
|
+
"reference_video_url": {
|
|
350
|
+
"type": "string",
|
|
351
|
+
"description": "Source video to transform. Supports inline base64-encoded MP4 or MOV/QuickTime data URIs only; remote http(s) URLs are not allowed."
|
|
352
|
+
},
|
|
353
|
+
"negative_prompt": {
|
|
354
|
+
"type": "string",
|
|
355
|
+
"description": "Non-Seedance only. Optional negative prompt for LTX/Wan video-to-video models. Do not set for Seedance V2V; rewrite user-provided Seedance avoid/ban/no-X requests as positive prompt instructions."
|
|
356
|
+
},
|
|
357
|
+
"control_mode": {
|
|
358
|
+
"type": "string",
|
|
359
|
+
"description": "How to use the source video. seedance-v2v uses Seedance 2.0 holistic V2V. animate-move and animate-replace use WAN animate workflows. canny, pose, depth, and detailer use LTX-2.3 v2v ControlNet.",
|
|
360
|
+
"enum": [
|
|
361
|
+
"animate-move",
|
|
362
|
+
"animate-replace",
|
|
363
|
+
"seedance-v2v",
|
|
364
|
+
"canny",
|
|
365
|
+
"pose",
|
|
366
|
+
"depth",
|
|
367
|
+
"detailer"
|
|
368
|
+
]
|
|
369
|
+
},
|
|
370
|
+
"reference_image_url": {
|
|
371
|
+
"type": "string",
|
|
372
|
+
"description": "Optional reference image for animate workflows or pose-guided appearance control. Supports inline base64-encoded PNG or JPEG data URIs only; remote http(s) URLs are not allowed."
|
|
373
|
+
},
|
|
374
|
+
"reference_image_urls": {
|
|
375
|
+
"type": "array",
|
|
376
|
+
"description": "Seedance-only additional image context references. Use publicly accessible HTTPS URLs in hosted workflows. Seedance accepts up to 9 image assets total including reference_image_url.",
|
|
377
|
+
"maxItems": 9,
|
|
378
|
+
"items": {
|
|
379
|
+
"type": "string"
|
|
380
|
+
}
|
|
381
|
+
},
|
|
382
|
+
"reference_video_urls": {
|
|
383
|
+
"type": "array",
|
|
384
|
+
"description": "Seedance-only additional video context references. Use publicly accessible HTTPS URLs in hosted workflows. Seedance accepts up to 3 video assets total including reference_video_url.",
|
|
385
|
+
"maxItems": 2,
|
|
386
|
+
"items": {
|
|
387
|
+
"type": "string"
|
|
388
|
+
}
|
|
389
|
+
},
|
|
390
|
+
"reference_audio_urls": {
|
|
391
|
+
"type": "array",
|
|
392
|
+
"description": "Seedance-only audio context references. Use publicly accessible HTTPS URLs in hosted workflows. Seedance accepts up to 3 audio assets total. Text+audio-only is unsupported; include at least one image or video reference.",
|
|
393
|
+
"maxItems": 3,
|
|
394
|
+
"items": {
|
|
395
|
+
"type": "string"
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
"reference_audio_identity_url": {
|
|
399
|
+
"type": "string",
|
|
400
|
+
"description": "Optional voice identity clip for LTX-2.3 v2v workflows. Supports inline base64-encoded MP3, M4A, or WAV data URIs only; remote http(s) URLs are not allowed."
|
|
401
|
+
},
|
|
402
|
+
"audio_identity_strength": {
|
|
403
|
+
"type": "number",
|
|
404
|
+
"description": "How strongly to apply the reference_audio_identity_url voice identity. Range: 0-10. Default depends on the model."
|
|
405
|
+
},
|
|
406
|
+
"video_start": {
|
|
407
|
+
"type": "number",
|
|
408
|
+
"description": "Start offset in seconds into the source video."
|
|
409
|
+
},
|
|
410
|
+
"duration": {
|
|
411
|
+
"type": "number",
|
|
412
|
+
"description": "Output video duration in seconds. Range: 1-20 generally; Seedance supports 4-15. Default: 5."
|
|
413
|
+
},
|
|
414
|
+
"generate_audio": {
|
|
415
|
+
"type": "boolean",
|
|
416
|
+
"description": "Whether external API video models such as Seedance should generate native audio. Set false for silent output."
|
|
417
|
+
},
|
|
418
|
+
"width": {
|
|
419
|
+
"type": "number",
|
|
420
|
+
"description": "Output video width in pixels. Default depends on the selected workflow."
|
|
421
|
+
},
|
|
422
|
+
"height": {
|
|
423
|
+
"type": "number",
|
|
424
|
+
"description": "Output video height in pixels. Default depends on the selected workflow."
|
|
425
|
+
},
|
|
426
|
+
"detailer_strength": {
|
|
427
|
+
"type": "number",
|
|
428
|
+
"description": "Optional detailer LoRA strength for LTX-2.3 v2v control workflows. Range: 0-1."
|
|
429
|
+
},
|
|
430
|
+
"model": {
|
|
431
|
+
"type": "string",
|
|
432
|
+
"description": "Video-to-video model to use. Supported selectors include ltx23, ltx23-v2v, and seedance2. Use control_mode=seedance-v2v for Seedance 2.0 video-to-video.",
|
|
433
|
+
"enum": [
|
|
434
|
+
"ltx23",
|
|
435
|
+
"ltx23-v2v",
|
|
436
|
+
"seedance2",
|
|
437
|
+
"ltx23-22b-fp8_v2v_distilled",
|
|
438
|
+
"seedance-2-0",
|
|
439
|
+
"wan_v2.2-14b-fp8_animate-move_lightx2v",
|
|
440
|
+
"wan_v2.2-14b-fp8_animate-replace_lightx2v"
|
|
441
|
+
]
|
|
442
|
+
},
|
|
443
|
+
"number_of_variations": {
|
|
444
|
+
"type": "number",
|
|
445
|
+
"description": "Number of video variations to generate. Range: 1-16. Default: 1."
|
|
446
|
+
},
|
|
447
|
+
"seed": {
|
|
448
|
+
"type": "number",
|
|
449
|
+
"description": "Random seed for reproducible generation. Use -1 for random."
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
"required": ["prompt", "reference_video_url"]
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
"type": "function",
|
|
458
|
+
"function": {
|
|
459
|
+
"name": "sogni_generate_music",
|
|
460
|
+
"description": "Generate a music track using AI music generation on the Sogni Supernet. Returns URLs to the generated audio files. Use this tool EVERY TIME the user asks to create, generate, compose, or make music, a song, a beat, or audio. Do NOT generate URLs yourself — you MUST call this tool.",
|
|
461
|
+
"parameters": {
|
|
462
|
+
"type": "object",
|
|
463
|
+
"properties": {
|
|
464
|
+
"prompt": {
|
|
465
|
+
"type": "string",
|
|
466
|
+
"description": "Description of the music to generate. Include genre, mood, tempo, instruments, and style."
|
|
467
|
+
},
|
|
468
|
+
"lyrics": {
|
|
469
|
+
"type": "string",
|
|
470
|
+
"description": "Song lyrics to sing. Omit for instrumental music."
|
|
471
|
+
},
|
|
472
|
+
"language": {
|
|
473
|
+
"type": "string",
|
|
474
|
+
"description": "Lyrics language code, such as \"en\" or \"es\"."
|
|
475
|
+
},
|
|
476
|
+
"duration": {
|
|
477
|
+
"type": "number",
|
|
478
|
+
"description": "Duration of the generated music in seconds. Range: 10-600. Default: 30."
|
|
479
|
+
},
|
|
480
|
+
"bpm": {
|
|
481
|
+
"type": "number",
|
|
482
|
+
"description": "Beats per minute. Range: 30-300. Default: 120."
|
|
483
|
+
},
|
|
484
|
+
"keyscale": {
|
|
485
|
+
"type": "string",
|
|
486
|
+
"description": "Musical key and scale (e.g., \"C major\", \"A minor\", \"F# minor\", \"Bb major\"). Default: \"C major\"."
|
|
487
|
+
},
|
|
488
|
+
"timesignature": {
|
|
489
|
+
"type": "string",
|
|
490
|
+
"description": "Time signature. Common values: \"4\", \"3\", \"2\", or \"6\". Default: \"4\".",
|
|
491
|
+
"enum": ["4", "3", "2", "6"]
|
|
492
|
+
},
|
|
493
|
+
"composer_mode": {
|
|
494
|
+
"type": "boolean",
|
|
495
|
+
"description": "Enable AI composer mode for richer arrangements. Default depends on the model."
|
|
496
|
+
},
|
|
497
|
+
"prompt_strength": {
|
|
498
|
+
"type": "number",
|
|
499
|
+
"description": "How closely the model should follow the prompt. Higher values increase prompt adherence."
|
|
500
|
+
},
|
|
501
|
+
"creativity": {
|
|
502
|
+
"type": "number",
|
|
503
|
+
"description": "Composition variation / temperature. Higher values are more creative."
|
|
504
|
+
},
|
|
505
|
+
"model": {
|
|
506
|
+
"type": "string",
|
|
507
|
+
"description": "Music generation model. \"ace_step_1.5_turbo\" is the default and preferred model — highest quality output. \"ace_step_1.5_sft\" is an experimental model with lower fidelity but best lyric handling support.",
|
|
508
|
+
"enum": ["ace_step_1.5_turbo", "ace_step_1.5_sft"]
|
|
509
|
+
},
|
|
510
|
+
"output_format": {
|
|
511
|
+
"type": "string",
|
|
512
|
+
"description": "Audio output format. Default: \"mp3\".",
|
|
513
|
+
"enum": ["mp3", "flac", "wav"]
|
|
514
|
+
},
|
|
515
|
+
"number_of_variations": {
|
|
516
|
+
"type": "number",
|
|
517
|
+
"description": "Number of audio variations to generate. Range: 1-16. Default: 1."
|
|
518
|
+
},
|
|
519
|
+
"seed": {
|
|
520
|
+
"type": "number",
|
|
521
|
+
"description": "Random seed for reproducible generation. Use -1 for random."
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
"required": ["prompt"]
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
]
|
|
529
|
+
}
|
package/dist/Chat/tools.d.ts
CHANGED
|
@@ -2,74 +2,28 @@ import { ToolDefinition, ToolCall } from './types';
|
|
|
2
2
|
/**
|
|
3
3
|
* Built-in Sogni platform tool definitions for use with LLM tool calling.
|
|
4
4
|
*
|
|
5
|
-
* These
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* import { SogniTools } from '@sogni-ai/sogni-client';
|
|
12
|
-
*
|
|
13
|
-
* const stream = await sogni.chat.completions.create({
|
|
14
|
-
* model: 'qwen3.6-35b-a3b-gguf-iq4xs',
|
|
15
|
-
* messages: [{ role: 'user', content: 'Generate an image of a sunset' }],
|
|
16
|
-
* tools: SogniTools.all,
|
|
17
|
-
* tool_choice: 'auto',
|
|
18
|
-
* stream: true,
|
|
19
|
-
* });
|
|
20
|
-
* ```
|
|
5
|
+
* These definitions are generated from the shared
|
|
6
|
+
* `@sogni/creative-agent` hosted tool backbone. The public SDK keeps a local
|
|
7
|
+
* generated copy so consumers do not need access to the private package.
|
|
21
8
|
*/
|
|
22
|
-
/** Tool definition: Generate an image using the Sogni Supernet */
|
|
23
9
|
export declare const generateImageTool: ToolDefinition;
|
|
24
|
-
|
|
10
|
+
export declare const editImageTool: ToolDefinition;
|
|
25
11
|
export declare const generateVideoTool: ToolDefinition;
|
|
26
|
-
|
|
12
|
+
export declare const soundToVideoTool: ToolDefinition;
|
|
13
|
+
export declare const videoToVideoTool: ToolDefinition;
|
|
27
14
|
export declare const generateMusicTool: ToolDefinition;
|
|
28
|
-
/**
|
|
29
|
-
* Collection of all Sogni platform tool definitions.
|
|
30
|
-
*/
|
|
31
15
|
export declare const SogniTools: {
|
|
32
|
-
/** Generate an image */
|
|
33
16
|
generateImage: ToolDefinition;
|
|
34
|
-
|
|
17
|
+
editImage: ToolDefinition;
|
|
35
18
|
generateVideo: ToolDefinition;
|
|
36
|
-
|
|
19
|
+
soundToVideo: ToolDefinition;
|
|
20
|
+
videoToVideo: ToolDefinition;
|
|
37
21
|
generateMusic: ToolDefinition;
|
|
38
|
-
/** All Sogni tools combined — convenience array for `tools` param */
|
|
39
22
|
readonly all: ToolDefinition[];
|
|
40
23
|
};
|
|
41
|
-
/**
|
|
42
|
-
* Build Sogni tool definitions with dynamically populated model enums
|
|
43
|
-
* based on currently available models on the network.
|
|
44
|
-
*
|
|
45
|
-
* @param availableModels - Result of `sogni.projects.waitForModels()`. If omitted, returns
|
|
46
|
-
* the default tool definitions with static model lists.
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
* ```typescript
|
|
50
|
-
* import { buildSogniTools } from '@sogni-ai/sogni-client';
|
|
51
|
-
*
|
|
52
|
-
* const models = await sogni.projects.waitForModels();
|
|
53
|
-
* const tools = buildSogniTools(models);
|
|
54
|
-
*
|
|
55
|
-
* const stream = await sogni.chat.completions.create({
|
|
56
|
-
* model: 'qwen3.6-35b-a3b-gguf-iq4xs',
|
|
57
|
-
* messages,
|
|
58
|
-
* tools,
|
|
59
|
-
* stream: true,
|
|
60
|
-
* });
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
24
|
export declare function buildSogniTools(availableModels?: Array<{
|
|
64
25
|
id: string;
|
|
65
26
|
media?: string;
|
|
66
27
|
}>): ToolDefinition[];
|
|
67
|
-
/**
|
|
68
|
-
* Check if a tool call is a Sogni platform tool.
|
|
69
|
-
*/
|
|
70
28
|
export declare function isSogniToolCall(toolCall: ToolCall): boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Parse arguments from a tool call's JSON string.
|
|
73
|
-
* Returns the parsed object or an empty object if parsing fails.
|
|
74
|
-
*/
|
|
75
29
|
export declare function parseToolCallArguments(toolCall: ToolCall): Record<string, unknown>;
|