@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.
Files changed (109) hide show
  1. package/CHANGELOG.md +148 -0
  2. package/CLAUDE.md +25 -3
  3. package/README.md +411 -136
  4. package/dist/Account/index.d.ts +4 -2
  5. package/dist/Account/index.js +27 -23
  6. package/dist/Account/index.js.map +1 -1
  7. package/dist/Account/types.d.ts +7 -0
  8. package/dist/ApiClient/WebSocketClient/BrowserWebSocketClient/index.d.ts +3 -1
  9. package/dist/ApiClient/WebSocketClient/BrowserWebSocketClient/index.js +26 -2
  10. package/dist/ApiClient/WebSocketClient/BrowserWebSocketClient/index.js.map +1 -1
  11. package/dist/ApiClient/WebSocketClient/eventSubscriptions.d.ts +33 -0
  12. package/dist/ApiClient/WebSocketClient/eventSubscriptions.js +39 -0
  13. package/dist/ApiClient/WebSocketClient/eventSubscriptions.js.map +1 -0
  14. package/dist/ApiClient/WebSocketClient/events.d.ts +24 -7
  15. package/dist/ApiClient/WebSocketClient/index.d.ts +5 -1
  16. package/dist/ApiClient/WebSocketClient/index.js +24 -1
  17. package/dist/ApiClient/WebSocketClient/index.js.map +1 -1
  18. package/dist/ApiClient/WebSocketClient/messages.d.ts +2 -0
  19. package/dist/ApiClient/WebSocketClient/types.d.ts +2 -0
  20. package/dist/ApiClient/index.d.ts +6 -1
  21. package/dist/ApiClient/index.js +7 -3
  22. package/dist/ApiClient/index.js.map +1 -1
  23. package/dist/Chat/ChatTools.d.ts +5 -49
  24. package/dist/Chat/ChatTools.js +311 -88
  25. package/dist/Chat/ChatTools.js.map +1 -1
  26. package/dist/Chat/index.d.ts +11 -2
  27. package/dist/Chat/index.js +78 -4
  28. package/dist/Chat/index.js.map +1 -1
  29. package/dist/Chat/modelRouting.d.ts +100 -0
  30. package/dist/Chat/modelRouting.js +441 -0
  31. package/dist/Chat/modelRouting.js.map +1 -0
  32. package/dist/Chat/sogniHostedTools.generated.json +529 -0
  33. package/dist/Chat/tools.d.ts +9 -55
  34. package/dist/Chat/tools.js +72 -228
  35. package/dist/Chat/tools.js.map +1 -1
  36. package/dist/Chat/types.d.ts +91 -2
  37. package/dist/CreativeWorkflows/index.d.ts +23 -0
  38. package/dist/CreativeWorkflows/index.js +274 -0
  39. package/dist/CreativeWorkflows/index.js.map +1 -0
  40. package/dist/CreativeWorkflows/types.d.ts +106 -0
  41. package/dist/CreativeWorkflows/types.js +3 -0
  42. package/dist/CreativeWorkflows/types.js.map +1 -0
  43. package/dist/Projects/Job.d.ts +6 -0
  44. package/dist/Projects/Job.js +60 -5
  45. package/dist/Projects/Job.js.map +1 -1
  46. package/dist/Projects/Project.js +15 -3
  47. package/dist/Projects/Project.js.map +1 -1
  48. package/dist/Projects/createJobRequestMessage.js +140 -6
  49. package/dist/Projects/createJobRequestMessage.js.map +1 -1
  50. package/dist/Projects/index.d.ts +10 -1
  51. package/dist/Projects/index.js +197 -58
  52. package/dist/Projects/index.js.map +1 -1
  53. package/dist/Projects/types/ModelOptions.d.ts +3 -3
  54. package/dist/Projects/types/ModelOptions.js +12 -5
  55. package/dist/Projects/types/ModelOptions.js.map +1 -1
  56. package/dist/Projects/types/ModelTiersRaw.d.ts +7 -7
  57. package/dist/Projects/types/RawProject.d.ts +2 -0
  58. package/dist/Projects/types/events.d.ts +5 -4
  59. package/dist/Projects/types/index.d.ts +77 -7
  60. package/dist/Projects/types/index.js.map +1 -1
  61. package/dist/Projects/utils/index.d.ts +8 -1
  62. package/dist/Projects/utils/index.js +22 -8
  63. package/dist/Projects/utils/index.js.map +1 -1
  64. package/dist/index.d.ts +28 -3
  65. package/dist/index.js +19 -1
  66. package/dist/index.js.map +1 -1
  67. package/dist/lib/RestClient.d.ts +4 -1
  68. package/dist/lib/RestClient.js +17 -9
  69. package/dist/lib/RestClient.js.map +1 -1
  70. package/dist/lib/mediaValidation.d.ts +16 -0
  71. package/dist/lib/mediaValidation.js +280 -0
  72. package/dist/lib/mediaValidation.js.map +1 -0
  73. package/dist/lib/validation.d.ts +6 -1
  74. package/dist/lib/validation.js +28 -2
  75. package/dist/lib/validation.js.map +1 -1
  76. package/llms-full.txt +372 -133
  77. package/llms.txt +197 -86
  78. package/package.json +13 -4
  79. package/src/Account/index.ts +22 -2
  80. package/src/Account/types.ts +7 -0
  81. package/src/ApiClient/WebSocketClient/BrowserWebSocketClient/index.ts +47 -3
  82. package/src/ApiClient/WebSocketClient/eventSubscriptions.ts +92 -0
  83. package/src/ApiClient/WebSocketClient/events.ts +25 -7
  84. package/src/ApiClient/WebSocketClient/index.ts +33 -1
  85. package/src/ApiClient/WebSocketClient/messages.ts +2 -0
  86. package/src/ApiClient/WebSocketClient/types.ts +2 -0
  87. package/src/ApiClient/index.ts +32 -2
  88. package/src/Chat/ChatTools.ts +395 -95
  89. package/src/Chat/index.ts +149 -5
  90. package/src/Chat/modelRouting.ts +602 -0
  91. package/src/Chat/sogniHostedTools.generated.json +529 -0
  92. package/src/Chat/tools.ts +98 -245
  93. package/src/Chat/types.ts +100 -2
  94. package/src/CreativeWorkflows/index.ts +290 -0
  95. package/src/CreativeWorkflows/types.ts +134 -0
  96. package/src/Projects/Job.ts +76 -5
  97. package/src/Projects/Project.ts +13 -3
  98. package/src/Projects/createJobRequestMessage.ts +152 -13
  99. package/src/Projects/index.ts +230 -52
  100. package/src/Projects/types/ModelOptions.ts +15 -8
  101. package/src/Projects/types/ModelTiersRaw.ts +7 -7
  102. package/src/Projects/types/RawProject.ts +2 -0
  103. package/src/Projects/types/events.ts +5 -4
  104. package/src/Projects/types/index.ts +86 -6
  105. package/src/Projects/utils/index.ts +24 -8
  106. package/src/index.ts +93 -0
  107. package/src/lib/RestClient.ts +15 -5
  108. package/src/lib/mediaValidation.ts +367 -0
  109. package/src/lib/validation.ts +38 -2
@@ -1,255 +1,99 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SogniTools = exports.generateMusicTool = exports.generateVideoTool = exports.generateImageTool = void 0;
6
+ exports.SogniTools = exports.generateMusicTool = exports.videoToVideoTool = exports.soundToVideoTool = exports.generateVideoTool = exports.editImageTool = exports.generateImageTool = void 0;
4
7
  exports.buildSogniTools = buildSogniTools;
5
8
  exports.isSogniToolCall = isSogniToolCall;
6
9
  exports.parseToolCallArguments = parseToolCallArguments;
7
- /**
8
- * Built-in Sogni platform tool definitions for use with LLM tool calling.
9
- *
10
- * These tools allow the LLM to generate images, videos, and music
11
- * through the Sogni Supernet. Include them in your `tools` array when
12
- * calling `sogni.chat.completions.create()`.
13
- *
14
- * @example
15
- * ```typescript
16
- * import { SogniTools } from '@sogni-ai/sogni-client';
17
- *
18
- * const stream = await sogni.chat.completions.create({
19
- * model: 'qwen3.6-35b-a3b-gguf-iq4xs',
20
- * messages: [{ role: 'user', content: 'Generate an image of a sunset' }],
21
- * tools: SogniTools.all,
22
- * tool_choice: 'auto',
23
- * stream: true,
24
- * });
25
- * ```
26
- */
27
- /** Tool definition: Generate an image using the Sogni Supernet */
28
- exports.generateImageTool = {
29
- type: 'function',
30
- function: {
31
- name: 'sogni_generate_image',
32
- 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.',
33
- parameters: {
34
- type: 'object',
35
- properties: {
36
- prompt: {
37
- type: 'string',
38
- description: 'Detailed text description of the image to generate. Be specific about style, composition, lighting, colors, and subject matter.'
39
- },
40
- negative_prompt: {
41
- type: 'string',
42
- description: 'Things to avoid in the generated image (e.g., "blurry, low quality, distorted").'
43
- },
44
- width: {
45
- type: 'number',
46
- description: 'Image width in pixels. Must be a multiple of 16. Default: 1024. Max: 2048.'
47
- },
48
- height: {
49
- type: 'number',
50
- description: 'Image height in pixels. Must be a multiple of 16. Default: 1024. Max: 2048.'
51
- },
52
- model: {
53
- type: 'string',
54
- description: 'Image generation model to use.',
55
- enum: [
56
- 'flux1-schnell-fp8',
57
- 'flux2-dev_fp8',
58
- 'chroma-v.46-flash_fp8',
59
- 'z_image_turbo_bf16'
60
- ]
61
- },
62
- steps: {
63
- type: 'number',
64
- description: 'Number of inference steps. Higher = better quality but slower. Default depends on model (4-50).'
65
- },
66
- seed: {
67
- type: 'number',
68
- description: 'Random seed for reproducible generation. Use -1 for random.'
69
- }
70
- },
71
- required: ['prompt']
72
- }
10
+ const sogniHostedTools_generated_json_1 = __importDefault(require("./sogniHostedTools.generated.json"));
11
+ const modelRouting_1 = require("./modelRouting");
12
+ const hostedTools = sogniHostedTools_generated_json_1.default.tools;
13
+ function getHostedTool(name) {
14
+ const tool = hostedTools.find((candidate) => candidate.function.name === name);
15
+ if (!tool) {
16
+ throw new Error(`Missing hosted Sogni tool definition: ${name}`);
73
17
  }
74
- };
75
- /** Tool definition: Generate a video using the Sogni Supernet */
76
- exports.generateVideoTool = {
77
- type: 'function',
78
- function: {
79
- name: 'sogni_generate_video',
80
- description: 'Generate a short video using AI video generation on the Sogni Supernet. Returns a URL to the generated video. 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.',
81
- parameters: {
82
- type: 'object',
83
- properties: {
84
- prompt: {
85
- type: 'string',
86
- 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.'
87
- },
88
- negative_prompt: {
89
- type: 'string',
90
- description: 'Things to avoid in the generated video (e.g., "blurry, low quality, distorted, watermark").'
91
- },
92
- width: {
93
- type: 'number',
94
- description: 'Video width in pixels. Default: 1920. Standard resolutions: 1920x1088 (landscape), 1088x1920 (portrait), 1280x720.'
95
- },
96
- height: {
97
- type: 'number',
98
- description: 'Video height in pixels. Default: 1088. Must be a multiple of 16.'
99
- },
100
- duration: {
101
- type: 'number',
102
- description: 'Video duration in seconds. Range: 1-20. Default: 5.'
103
- },
104
- fps: {
105
- type: 'number',
106
- description: 'Frames per second. Default: 24. Range: 1-60.'
107
- },
108
- model: {
109
- type: 'string',
110
- description: 'Video generation model to use. Prefer LTX-2.3 text-to-video (t2v) models for best quality.'
111
- },
112
- seed: {
113
- type: 'number',
114
- description: 'Random seed for reproducible generation. Use -1 for random.'
115
- }
116
- },
117
- required: ['prompt']
118
- }
119
- }
120
- };
121
- /** Tool definition: Generate music using the Sogni Supernet */
122
- exports.generateMusicTool = {
123
- type: 'function',
124
- function: {
125
- name: 'sogni_generate_music',
126
- description: 'Generate a music track using AI music generation on the Sogni Supernet. Returns a URL to the generated audio file. 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.',
127
- parameters: {
128
- type: 'object',
129
- properties: {
130
- prompt: {
131
- type: 'string',
132
- description: 'Description of the music to generate. Include genre, mood, tempo, instruments, and style. Can also include lyrics wrapped in [verse], [chorus], etc. tags.'
133
- },
134
- duration: {
135
- type: 'number',
136
- description: 'Duration of the generated music in seconds. Range: 10-600. Default: 30.'
137
- },
138
- bpm: {
139
- type: 'number',
140
- description: 'Beats per minute. Range: 30-300. Default: 120.'
141
- },
142
- keyscale: {
143
- type: 'string',
144
- description: 'Musical key and scale (e.g., "C major", "A minor", "F# minor", "Bb major"). Default: "C major".'
145
- },
146
- timesignature: {
147
- type: 'string',
148
- description: 'Time signature. "4" for 4/4, "3" for 3/4, "2" for 2/4. Default: "4".',
149
- enum: ['4', '3', '2']
150
- },
151
- model: {
152
- type: 'string',
153
- description: 'Music generation model. "ace_step_1.5_turbo" for fast/catchy, "ace_step_1.5_sft" for more control over lyrics.',
154
- enum: ['ace_step_1.5_turbo', 'ace_step_1.5_sft']
155
- },
156
- output_format: {
157
- type: 'string',
158
- description: 'Audio output format. Default: "mp3".',
159
- enum: ['mp3', 'flac', 'wav']
160
- },
161
- seed: {
162
- type: 'number',
163
- description: 'Random seed for reproducible generation. Use -1 for random.'
164
- }
165
- },
166
- required: ['prompt']
167
- }
18
+ return tool;
19
+ }
20
+ function cloneTool(tool) {
21
+ return structuredClone(tool);
22
+ }
23
+ function setModelEnum(tool, modelIds, description) {
24
+ if (modelIds.length === 0) {
25
+ return tool;
168
26
  }
169
- };
27
+ tool.function.parameters.properties.model = {
28
+ type: 'string',
29
+ description,
30
+ enum: modelIds
31
+ };
32
+ return tool;
33
+ }
170
34
  /**
171
- * Collection of all Sogni platform tool definitions.
35
+ * Built-in Sogni platform tool definitions for use with LLM tool calling.
36
+ *
37
+ * These definitions are generated from the shared
38
+ * `@sogni/creative-agent` hosted tool backbone. The public SDK keeps a local
39
+ * generated copy so consumers do not need access to the private package.
172
40
  */
41
+ exports.generateImageTool = getHostedTool('sogni_generate_image');
42
+ exports.editImageTool = getHostedTool('sogni_edit_image');
43
+ exports.generateVideoTool = getHostedTool('sogni_generate_video');
44
+ exports.soundToVideoTool = getHostedTool('sogni_sound_to_video');
45
+ exports.videoToVideoTool = getHostedTool('sogni_video_to_video');
46
+ exports.generateMusicTool = getHostedTool('sogni_generate_music');
173
47
  exports.SogniTools = {
174
- /** Generate an image */
175
48
  generateImage: exports.generateImageTool,
176
- /** Generate a video */
49
+ editImage: exports.editImageTool,
177
50
  generateVideo: exports.generateVideoTool,
178
- /** Generate music */
51
+ soundToVideo: exports.soundToVideoTool,
52
+ videoToVideo: exports.videoToVideoTool,
179
53
  generateMusic: exports.generateMusicTool,
180
- /** All Sogni tools combined — convenience array for `tools` param */
181
54
  get all() {
182
- return [exports.generateImageTool, exports.generateVideoTool, exports.generateMusicTool];
55
+ return [
56
+ exports.generateImageTool,
57
+ exports.editImageTool,
58
+ exports.generateVideoTool,
59
+ exports.soundToVideoTool,
60
+ exports.videoToVideoTool,
61
+ exports.generateMusicTool
62
+ ];
183
63
  }
184
64
  };
185
- /**
186
- * Build Sogni tool definitions with dynamically populated model enums
187
- * based on currently available models on the network.
188
- *
189
- * @param availableModels - Result of `sogni.projects.waitForModels()`. If omitted, returns
190
- * the default tool definitions with static model lists.
191
- *
192
- * @example
193
- * ```typescript
194
- * import { buildSogniTools } from '@sogni-ai/sogni-client';
195
- *
196
- * const models = await sogni.projects.waitForModels();
197
- * const tools = buildSogniTools(models);
198
- *
199
- * const stream = await sogni.chat.completions.create({
200
- * model: 'qwen3.6-35b-a3b-gguf-iq4xs',
201
- * messages,
202
- * tools,
203
- * stream: true,
204
- * });
205
- * ```
206
- */
207
65
  function buildSogniTools(availableModels) {
208
66
  if (!availableModels || availableModels.length === 0) {
209
67
  return exports.SogniTools.all;
210
68
  }
211
- const imageModels = availableModels.filter((m) => m.media === 'image').map((m) => m.id);
212
- const videoModels = availableModels.filter((m) => m.media === 'video').map((m) => m.id);
213
- const audioModels = availableModels.filter((m) => m.media === 'audio').map((m) => m.id);
214
- const tools = [];
215
- // Image tool — override model enum if image models are available
216
- const imageTool = structuredClone(exports.generateImageTool);
217
- if (imageModels.length > 0) {
218
- imageTool.function.parameters.properties.model.enum = imageModels;
219
- }
220
- tools.push(imageTool);
221
- // Video tool — override model enum if video models are available
222
- const videoTool = structuredClone(exports.generateVideoTool);
223
- if (videoModels.length > 0) {
224
- videoTool.function.parameters.properties.model = {
225
- type: 'string',
226
- description: 'Video generation model to use. Choose a text-to-video (t2v) model.',
227
- enum: videoModels
228
- };
229
- }
230
- tools.push(videoTool);
231
- // Music tool override model enum if audio models are available
232
- const musicTool = structuredClone(exports.generateMusicTool);
233
- if (audioModels.length > 0) {
234
- musicTool.function.parameters.properties.model = {
235
- type: 'string',
236
- description: 'Music generation model. "ace_step_1.5_turbo" for fast/catchy, "ace_step_1.5_sft" for more control over lyrics.',
237
- enum: audioModels
238
- };
239
- }
240
- tools.push(musicTool);
241
- return tools;
69
+ const imageModels = availableModels
70
+ .filter((model) => model.media === 'image')
71
+ .map((model) => model.id);
72
+ const editImageModels = availableModels
73
+ .filter((model) => model.media === 'image' && (0, modelRouting_1.isEditImageModel)(model.id))
74
+ .map((model) => model.id);
75
+ const videoModels = (0, modelRouting_1.filterVideoModelsByWorkflow)(availableModels, ['t2v', 'i2v']);
76
+ const soundToVideoModels = (0, modelRouting_1.filterVideoModelsByWorkflow)(availableModels, ['s2v', 'ia2v', 'a2v']);
77
+ const videoToVideoModels = (0, modelRouting_1.filterVideoModelsByWorkflow)(availableModels, [
78
+ 'animate-move',
79
+ 'animate-replace',
80
+ 'v2v'
81
+ ]);
82
+ const audioModels = availableModels
83
+ .filter((model) => model.media === 'audio')
84
+ .map((model) => model.id);
85
+ return [
86
+ setModelEnum(cloneTool(exports.generateImageTool), imageModels, 'Image generation model to use.'),
87
+ setModelEnum(cloneTool(exports.editImageTool), editImageModels, 'Image editing model to use. These models support reference-guided editing.'),
88
+ setModelEnum(cloneTool(exports.generateVideoTool), videoModels, 'Video generation model to use. Prefer t2v models for text-only generation and i2v models when reference images are supplied.'),
89
+ setModelEnum(cloneTool(exports.soundToVideoTool), soundToVideoModels, 'Audio-driven video model to use.'),
90
+ setModelEnum(cloneTool(exports.videoToVideoTool), videoToVideoModels, 'Video-to-video model to use.'),
91
+ setModelEnum(cloneTool(exports.generateMusicTool), audioModels, 'Music generation model to use.')
92
+ ];
242
93
  }
243
- /**
244
- * Check if a tool call is a Sogni platform tool.
245
- */
246
94
  function isSogniToolCall(toolCall) {
247
95
  return toolCall.function.name.startsWith('sogni_');
248
96
  }
249
- /**
250
- * Parse arguments from a tool call's JSON string.
251
- * Returns the parsed object or an empty object if parsing fails.
252
- */
253
97
  function parseToolCallArguments(toolCall) {
254
98
  try {
255
99
  return JSON.parse(toolCall.function.arguments);
@@ -1 +1 @@
1
- {"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/Chat/tools.ts"],"names":[],"mappings":";;;AA4NA,0CA4CC;AAKD,0CAEC;AAMD,wDAMC;AAzRD;;;;;;;;;;;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,QAAQ,CAAC,CAAC;AACrD,CAAC;AAED,SAAgB,sBAAsB,CAAC,QAAkB;IACvD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IACjD,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -31,6 +31,30 @@ export type ToolChoice = 'auto' | 'none' | 'required' | {
31
31
  name: string;
32
32
  };
33
33
  };
34
+ export type SogniToolsMode = boolean | 'creative-agent' | 'creative-tools' | 'rich';
35
+ /**
36
+ * OpenAI-compatible structured-output controls. Forwarded to the worker
37
+ * unchanged; honored natively by llama-server (compiles JSON Schema → GBNF
38
+ * internally) and vLLM (`xgrammar` / `outlines`). Per-request opt-in — when
39
+ * omitted, the model generates without constraint.
40
+ */
41
+ export type ChatResponseFormat = {
42
+ type: 'text';
43
+ } | {
44
+ type: 'json_object';
45
+ } | {
46
+ type: 'json_schema';
47
+ json_schema: {
48
+ /** Identifier for cached grammar reuse. */
49
+ name: string;
50
+ /** JSON Schema describing the required output shape. */
51
+ schema: Record<string, unknown>;
52
+ /** When true, only fields named in `schema` may appear. Default: false. */
53
+ strict?: boolean;
54
+ /** Optional description shown to the model. */
55
+ description?: string;
56
+ };
57
+ };
34
58
  /** Text content part for multimodal messages. */
35
59
  export interface TextContentPart {
36
60
  type: 'text';
@@ -40,7 +64,7 @@ export interface TextContentPart {
40
64
  export interface ImageUrlContentPart {
41
65
  type: 'image_url';
42
66
  image_url: {
43
- /** Supports http(s) URLs and data URIs (e.g., `data:image/jpeg;base64,...`). */
67
+ /** Supports inline base64-encoded JPEG or PNG data URIs only (e.g., `data:image/jpeg;base64,...`) for vision-model inputs. Max 20 images per request, 10MB each, longest side 1024px. */
44
68
  url: string;
45
69
  /** Controls how the model processes the image: 'auto' (default), 'low' (faster), 'high' (more detail). */
46
70
  detail?: 'auto' | 'low' | 'high';
@@ -58,6 +82,8 @@ export interface ChatMessage {
58
82
  export interface ChatCompletionParams {
59
83
  model: string;
60
84
  messages: ChatMessage[];
85
+ /** Optional source label for this request. Defaults to the client appSource when configured. */
86
+ appSource?: string;
61
87
  max_tokens?: number;
62
88
  temperature?: number;
63
89
  top_p?: number;
@@ -74,6 +100,19 @@ export interface ChatCompletionParams {
74
100
  tools?: ToolDefinition[];
75
101
  /** Controls which (if any) tool is called by the model. */
76
102
  tool_choice?: ToolChoice;
103
+ /**
104
+ * Ask the Sogni API to inject server-side media-generation tool families.
105
+ * `true` or `'creative-tools'` injects the hosted creative media/planning tool family.
106
+ * `'rich'` is accepted as a legacy alias for `'creative-tools'`.
107
+ * `'creative-agent'` adds hosted workflow-control and asset-manifest tools.
108
+ */
109
+ sogni_tools?: SogniToolsMode;
110
+ /**
111
+ * When `sogni_tools` is enabled, ask the Sogni API to execute requested Sogni
112
+ * tools server-side before returning the chat response. This is separate from
113
+ * the SDK-local `autoExecuteTools` loop.
114
+ */
115
+ sogni_tool_execution?: boolean;
77
116
  /**
78
117
  * Control thinking/reasoning mode for supported models (e.g. Qwen3/3.5).
79
118
  * When `false`, sends `chat_template_kwargs: { enable_thinking: false }` so
@@ -83,6 +122,12 @@ export interface ChatCompletionParams {
83
122
  think?: boolean;
84
123
  /** Hint for server-side preset selection. */
85
124
  taskProfile?: 'general' | 'coding' | 'reasoning';
125
+ /**
126
+ * Constrain output structure (OpenAI-compatible). Most useful on tool-call
127
+ * rounds where the model must emit a specific argument shape — eliminates
128
+ * JSON drift on quantized models. Forwarded to the worker unchanged.
129
+ */
130
+ response_format?: ChatResponseFormat;
86
131
  /**
87
132
  * Automatically execute Sogni tool calls (image/video/music generation) when the
88
133
  * model requests them. The SDK handles the full multi-round tool calling loop:
@@ -114,6 +159,7 @@ export interface ChatRequestMessage {
114
159
  type: 'llm';
115
160
  model: string;
116
161
  messages: ChatMessage[];
162
+ appSource?: string;
117
163
  max_tokens?: number;
118
164
  temperature?: number;
119
165
  top_p?: number;
@@ -127,9 +173,13 @@ export interface ChatRequestMessage {
127
173
  tokenType?: 'sogni' | 'spark';
128
174
  tools?: ToolDefinition[];
129
175
  tool_choice?: ToolChoice;
176
+ sogni_tools?: SogniToolsMode;
177
+ sogni_tool_execution?: boolean;
130
178
  taskProfile?: 'general' | 'coding' | 'reasoning';
131
179
  /** Per-request chat template arguments (e.g. `{ enable_thinking: false }` for llama.cpp). */
132
180
  chat_template_kwargs?: Record<string, unknown>;
181
+ /** Per-request structured-output constraint (OpenAI-compatible). */
182
+ response_format?: ChatResponseFormat;
133
183
  }
134
184
  export interface ChatCompletionChunk {
135
185
  jobID: string;
@@ -161,6 +211,44 @@ export interface ChatCompletionResult {
161
211
  /** History of tool calling rounds when `autoExecuteTools` was used. */
162
212
  toolHistory?: ToolHistoryEntry[];
163
213
  }
214
+ export interface HostedChatCompletionMessage {
215
+ role: 'system' | 'user' | 'assistant' | 'tool';
216
+ content: string | null;
217
+ tool_calls?: ToolCall[];
218
+ tool_call_id?: string;
219
+ }
220
+ export interface HostedChatCompletionChoice {
221
+ index: number;
222
+ message: HostedChatCompletionMessage;
223
+ finish_reason: string | null;
224
+ }
225
+ export interface HostedCreativeWorkflowReference {
226
+ workflowId: string;
227
+ status: string;
228
+ url: string;
229
+ eventsUrl: string;
230
+ streamUrl: string;
231
+ }
232
+ export interface HostedChatCompletionResult {
233
+ id: string;
234
+ object: 'chat.completion';
235
+ created: number;
236
+ model: string;
237
+ choices: HostedChatCompletionChoice[];
238
+ usage?: TokenUsage;
239
+ creative_workflows?: HostedCreativeWorkflowReference[];
240
+ sogni_tool_results?: Record<string, unknown>[];
241
+ }
242
+ export type HostedChatCompletionParams = Omit<ChatCompletionParams, 'stream' | 'autoExecuteTools' | 'onToolCall' | 'onToolProgress' | 'maxToolRounds'> & {
243
+ stream?: false;
244
+ token_type?: 'sogni' | 'spark' | 'auto';
245
+ app_source?: string;
246
+ chat_template_kwargs?: Record<string, unknown>;
247
+ media_references?: unknown[];
248
+ mediaReferences?: unknown[];
249
+ api_media_references?: unknown[];
250
+ apiMediaReferences?: unknown[];
251
+ };
164
252
  export interface ChatJobStateEvent {
165
253
  jobID: string;
166
254
  type: string;
@@ -176,6 +264,7 @@ export interface LLMParamConstraint {
176
264
  max: number;
177
265
  decimals?: number;
178
266
  default: number;
267
+ thinkingComplexDefault?: number;
179
268
  }
180
269
  /** Recommended sampling defaults for a specific thinking mode. */
181
270
  export interface LLMSamplingDefaults {
@@ -301,7 +390,7 @@ export interface ToolExecutionOptions {
301
390
  * complete within this time, the tool call will fail with a timeout error
302
391
  * and the project will be canceled.
303
392
  *
304
- * Default: 600000 (10 minutes).
393
+ * Default: 1800000 (30 minutes).
305
394
  */
306
395
  timeout?: number;
307
396
  }
@@ -0,0 +1,23 @@
1
+ import ApiGroup, { ApiConfig } from '../ApiGroup';
2
+ import { CreativeWorkflowRecord, CreativeWorkflowEvent, CreativeWorkflowSseEvent, ListCreativeWorkflowOptions, StartCreativeWorkflowOptions, StartCreativeWorkflowParams, StartHostedToolSequenceWorkflowInput, StartImageToVideoWorkflowInput, StreamCreativeWorkflowEventsOptions } from './types';
3
+ export declare function parseCreativeWorkflowSseChunk(chunk: string): CreativeWorkflowSseEvent[];
4
+ declare class CreativeWorkflowsApi extends ApiGroup {
5
+ constructor(config: ApiConfig);
6
+ start(params: StartCreativeWorkflowParams, options?: StartCreativeWorkflowOptions): Promise<CreativeWorkflowRecord>;
7
+ startImageToVideo(input: StartImageToVideoWorkflowInput, options?: StartCreativeWorkflowOptions & {
8
+ tokenType?: StartCreativeWorkflowParams['tokenType'];
9
+ }): Promise<CreativeWorkflowRecord>;
10
+ startHostedToolSequence(input: StartHostedToolSequenceWorkflowInput, options?: StartCreativeWorkflowOptions & {
11
+ tokenType?: StartCreativeWorkflowParams['tokenType'];
12
+ }): Promise<CreativeWorkflowRecord>;
13
+ list(options?: ListCreativeWorkflowOptions): Promise<CreativeWorkflowRecord[]>;
14
+ get(workflowId: string): Promise<CreativeWorkflowRecord>;
15
+ events(workflowId: string): Promise<CreativeWorkflowEvent[]>;
16
+ cancel(workflowId: string): Promise<CreativeWorkflowRecord>;
17
+ streamEvents(workflowId: string, options?: StreamCreativeWorkflowEventsOptions): AsyncIterableIterator<CreativeWorkflowSseEvent>;
18
+ private request;
19
+ private fetch;
20
+ private toApiError;
21
+ }
22
+ export default CreativeWorkflowsApi;
23
+ export * from './types';