@sogni-ai/sogni-client 4.2.0-alpha.20 → 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 +12 -0
- package/README.md +22 -14
- package/dist/Chat/index.d.ts +6 -1
- package/dist/Chat/index.js +20 -1
- package/dist/Chat/index.js.map +1 -1
- package/dist/Chat/sogniHostedTools.generated.json +2 -2
- package/dist/Chat/types.d.ts +43 -4
- package/dist/index.d.ts +2 -2
- 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/llms-full.txt +17 -10
- package/llms.txt +9 -4
- package/package.json +4 -1
- package/src/Chat/index.ts +58 -1
- package/src/Chat/sogniHostedTools.generated.json +2 -2
- package/src/Chat/types.ts +51 -4
- package/src/index.ts +10 -0
- package/src/lib/RestClient.ts +15 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# [4.2.0-alpha.21](https://github.com/Sogni-AI/sogni-client/compare/v4.2.0-alpha.20...v4.2.0-alpha.21) (2026-05-14)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **chat:** align hosted creative tool surfaces ([6e9e094](https://github.com/Sogni-AI/sogni-client/commit/6e9e094803bad7fdda994103f12bd40f726ae08e))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **chat:** expose hosted completions wrapper ([da3799d](https://github.com/Sogni-AI/sogni-client/commit/da3799d2e99877d4bdd1990741611bac6243cdad))
|
|
12
|
+
|
|
1
13
|
# [4.2.0-alpha.20](https://github.com/Sogni-AI/sogni-client/compare/v4.2.0-alpha.19...v4.2.0-alpha.20) (2026-05-12)
|
|
2
14
|
|
|
3
15
|
|
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ Behind the scenes this SDK uses a WebSocket connection for communication between
|
|
|
21
21
|
- 🤖 **LLM Text Generation** - Chat completions with streaming, multi-turn conversations, and thinking/reasoning mode via OpenAI-compatible API
|
|
22
22
|
- 🔧 **LLM Tool Calling** - Define custom tools (functions) that the LLM can invoke during conversations for real-time data and actions
|
|
23
23
|
- 🎨🎬🎵 **Sogni Platform Tools** - Generate images, reference-guided image edits, videos, audio-driven videos, video transforms, and music through natural language chat
|
|
24
|
-
- 🤖 **
|
|
24
|
+
- 🤖 **Hosted Creative Tools** - Use the default `creative-tools` surface for media generation, editing, analysis, metadata, prompt enhancement, script writing, lyrics, and instrumental structures; set `sogni_tools: "creative-agent"` to add workflow control and asset-manifest tools
|
|
25
25
|
- ⏱️ **Durable Creative Workflows** - Persistent server-side multi-step workflows with SSE event streaming, `Last-Event-ID` resume, and cooperative cancellation via `/v1/creative-agent/workflows`
|
|
26
26
|
- 👁️ **Vision Chat** - Multimodal image understanding with scene description, OCR, object detection, visual analysis, and multi-image comparison via Qwen3.6 VLM
|
|
27
27
|
|
|
@@ -851,7 +851,7 @@ const response = await sogni.chat.completions.create({
|
|
|
851
851
|
|
|
852
852
|
### Sogni Platform Tools — Generate Media via Chat
|
|
853
853
|
|
|
854
|
-
Combine LLM intelligence with Sogni's media generation capabilities. The SDK exposes
|
|
854
|
+
Combine LLM intelligence with Sogni's media generation capabilities. The SDK exposes built-in public platform tool definitions for client-managed chat completions:
|
|
855
855
|
|
|
856
856
|
- **`sogni_generate_image`** — text-to-image generation
|
|
857
857
|
- **`sogni_edit_image`** — reference-guided image editing using `source_image_url` and `reference_image_urls`
|
|
@@ -862,27 +862,33 @@ Combine LLM intelligence with Sogni's media generation capabilities. The SDK exp
|
|
|
862
862
|
|
|
863
863
|
Use `SogniTools.all` to expose the full tool surface, then execute tool calls with `sogni.chat.tools.execute()` / `executeAll()` or `autoExecuteTools: true` for non-streaming flows.
|
|
864
864
|
|
|
865
|
-
For direct `/v1/chat/completions` hosted-tool execution, media-bearing tool arguments are intentionally constrained to inline `data:` URIs so the chat API remains OpenAI-compatible and does not implicitly fetch arbitrary user URLs. For user-uploaded image/audio/video inputs, use the SDK video project examples or `/v1/creative-agent/workflows` hosted tool sequences, which run outside the chat tool-selection loop and can consume HTTPS artifact URLs produced by Sogni's upload endpoints.
|
|
865
|
+
For direct `/v1/chat/completions` hosted-tool execution, media-bearing tool arguments are intentionally constrained to inline `data:` URIs so the chat API remains OpenAI-compatible and does not implicitly fetch arbitrary user URLs. For user-uploaded image/audio/video inputs, use the SDK video project examples or `/v1/creative-agent/workflows` hosted tool sequences, which run outside the chat tool-selection loop and can consume HTTPS artifact URLs produced by Sogni's upload endpoints. Durable hosted sequences validate step arguments before the workflow starts and can bind request-level `mediaReferences` into tool arguments with `sourceStepId: "$input_media"`.
|
|
866
866
|
|
|
867
867
|
The `workflow_text_chat_sogni_tools.mjs` example demonstrates the core text-to-image, text-to-video, and text-to-music composition flows. Dedicated workflow examples like `workflow_image_edit.mjs`, `workflow_sound_to_video.mjs`, and `workflow_video_to_video.mjs` cover the asset-backed workflows directly.
|
|
868
868
|
|
|
869
|
-
###
|
|
869
|
+
### Hosted Creative Tool Families (server-side)
|
|
870
870
|
|
|
871
|
-
|
|
871
|
+
The Sogni API can inject hosted creative tool surfaces through `sogni.chat.hosted.create()`, the SDK wrapper for `/v1/chat/completions`. The default `creative-tools` surface includes media generation, editing, post-production, analysis, metadata extraction, and synchronous composition tools; `sogni_tools: "creative-agent"` includes that base surface and adds workflow control and asset-manifest tools. Generated artifacts are threaded through a per-request media context so later rounds can reference them by index.
|
|
872
872
|
|
|
873
|
-
|
|
873
|
+
Use default `sogni_tools: true` or `sogni_tools: "creative-tools"` when you want the full creative media tool surface plus synchronous composition tools: `enhance_prompt`, `compose_script`, `compose_lyrics`, and `compose_instrumental`. The legacy `"rich"` alias is still accepted and maps to `"creative-tools"`.
|
|
874
|
+
|
|
875
|
+
Notable creative-tools include:
|
|
874
876
|
|
|
875
877
|
| Tool | Behavior |
|
|
876
878
|
| --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
877
|
-
| `restore_photo`, `apply_style`, `refine_result`, `change_angle` | Image-edit adapters
|
|
879
|
+
| `restore_photo`, `apply_style`, `refine_result`, `change_angle` | Image-edit adapters backed by the shared image-edit workflow |
|
|
878
880
|
| `animate_photo` | Image-to-video, with multi-source fan-out via `sourceImageIndices` (composed into one MP4 by default; opt out with `stitched: false`) |
|
|
879
881
|
| `stitch_video` | Compose selected video clips into one MP4 (with optional audio overlay) |
|
|
880
882
|
| `orbit_video` | Generate orbit clips around a subject and stitch them |
|
|
881
883
|
| `dance_montage` | Generate dance clips and stitch when multi-clip |
|
|
882
|
-
| `extend_video`, `replace_video_segment` | Extend or replace a bounded segment of an existing video
|
|
884
|
+
| `extend_video`, `replace_video_segment` | Extend or replace a bounded segment of an existing video; replacements may trim source windows with `replacementStartSeconds` / `replacementEndSeconds` |
|
|
883
885
|
| `overlay_video`, `add_subtitles` | Burn in text/logo overlays or subtitle cues onto existing videos via ffmpeg |
|
|
886
|
+
| `enhance_prompt` | Expand or adapt rough prompts into model-ready image, video, music, or edit prompts |
|
|
887
|
+
| `compose_script` | Draft scripts, storyboards, trailers, social shorts, campaign beats, or video prompts |
|
|
888
|
+
| `compose_lyrics` | Write vocal song lyrics and suggested musical parameters |
|
|
889
|
+
| `compose_instrumental` | Write instrumental structure and suggested musical parameters |
|
|
884
890
|
|
|
885
|
-
Composition and post-production tools (`stitch_video`, `orbit_video`, `dance_montage`, `animate_photo` fan-out, `extend_video`, `replace_video_segment`, `overlay_video`, and `add_subtitles`) return or update MP4 artifacts. See the
|
|
891
|
+
Composition and post-production tools (`stitch_video`, `orbit_video`, `dance_montage`, `animate_photo` fan-out, `extend_video`, `replace_video_segment`, `overlay_video`, and `add_subtitles`) return or update MP4 artifacts. `stitch_video` concatenates whole clips end-to-end; alternating or interleaved time slices should be represented as repeated `replace_video_segment` steps with bounded replacement source windows. See the LLM API reference for the full schema list.
|
|
886
892
|
|
|
887
893
|
```javascript
|
|
888
894
|
import { SogniClient } from '@sogni-ai/sogni-client';
|
|
@@ -893,16 +899,16 @@ const sogni = await SogniClient.createInstance({
|
|
|
893
899
|
network: 'fast'
|
|
894
900
|
});
|
|
895
901
|
|
|
896
|
-
const result = await sogni.chat.
|
|
902
|
+
const result = await sogni.chat.hosted.create({
|
|
897
903
|
model: 'qwen3.6-35b-a3b-gguf-iq4xs',
|
|
898
|
-
messages: [{ role: 'user', content: 'Create
|
|
899
|
-
sogni_tools: 'creative-
|
|
904
|
+
messages: [{ role: 'user', content: 'Create a 15s trailer-style launch video for this product concept' }],
|
|
905
|
+
sogni_tools: 'creative-tools',
|
|
900
906
|
sogni_tool_execution: true,
|
|
901
907
|
tokenType: 'spark'
|
|
902
908
|
});
|
|
903
909
|
```
|
|
904
910
|
|
|
905
|
-
See `examples/workflow_creative_agent_tools.mjs` for a runnable REST API-key example that can toggle
|
|
911
|
+
See `examples/workflow_creative_agent_tools.mjs` for a runnable REST API-key example that can toggle tool surface and server-side execution.
|
|
906
912
|
|
|
907
913
|
For focused partner Seedance video tests, `examples/workflow_partner_seedance_video.mjs` starts with a guided workflow picker when run with no arguments. The guided path covers T2V, I2V, IA2V, V2V, the full and fast Seedance tiers where available, hosted workflow execution, native audio, keyframe interpolation, multimodal context, and cost estimation. The command-line path still supports direct scripted calls:
|
|
908
914
|
|
|
@@ -930,6 +936,8 @@ Long-running multi-step creative workflows can be persisted on the server and ob
|
|
|
930
936
|
- `sogni.creativeWorkflows.streamEvents(workflowId, { after, lastEventId })` — SSE event stream with resume support
|
|
931
937
|
- `sogni.creativeWorkflows.cancel(workflowId)` — cooperative cancellation
|
|
932
938
|
|
|
939
|
+
`startHostedToolSequence()` accepts exact hosted-tool steps plus optional request-level `mediaReferences` / `media_references`. A dependency with `sourceStepId: "$input_media"` can inject the matching uploaded image, video, or audio URL or index into a later step. The API validates the compiled step arguments before accepting the workflow and again before each execution step, so shape errors fail before billing later media work.
|
|
940
|
+
|
|
933
941
|
```javascript
|
|
934
942
|
const sogni = await SogniClient.createInstance({
|
|
935
943
|
appId: 'creative-workflow-demo',
|
|
@@ -979,7 +987,7 @@ The [examples](https://github.com/Sogni-AI/sogni-client/tree/main/examples) dire
|
|
|
979
987
|
- **`workflow_text_chat_vision.mjs`** - Vision chat with multimodal image understanding (scene description, OCR, object detection, visual analysis, multi-image comparison)
|
|
980
988
|
- **`workflow_text_chat_tool_calling.mjs`** - LLM tool calling with built-in tools (weather, time, unit conversion, math)
|
|
981
989
|
- **`workflow_text_chat_sogni_tools.mjs`** - Core image/video/music generation through natural language via LLM tool calling
|
|
982
|
-
- **`workflow_creative_agent_tools.mjs`** -
|
|
990
|
+
- **`workflow_creative_agent_tools.mjs`** - Server-side hosted Sogni tool injection for `/v1/chat/completions`
|
|
983
991
|
- **`workflow_creative_agent_workflows.mjs`** - Durable `/v1/creative-agent/workflows` start/list/get/events/stream/cancel through the SDK
|
|
984
992
|
- **`workflow_partner_seedance_video.mjs`** - Focused partner Seedance coverage: chat-completions T2V plus hosted-workflow T2V, I2V, IA2V, V2V, and multimodal context with uploaded media
|
|
985
993
|
|
package/dist/Chat/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ApiGroup, { ApiConfig } from '../ApiGroup';
|
|
2
2
|
import ChatStream from './ChatStream';
|
|
3
3
|
import ChatToolsApi from './ChatTools';
|
|
4
|
-
import { ChatCompletionParams, ChatCompletionChunk, ChatCompletionResult, ChatJobStateEvent, ChatMessage, LLMCostEstimation, LLMModelInfo } from './types';
|
|
4
|
+
import { ChatCompletionParams, ChatCompletionChunk, ChatCompletionResult, ChatJobStateEvent, ChatMessage, HostedChatCompletionParams, HostedChatCompletionResult, LLMCostEstimation, LLMModelInfo } from './types';
|
|
5
5
|
import type ProjectsApi from '../Projects';
|
|
6
6
|
export interface ChatApiEvents {
|
|
7
7
|
/** Emitted for each token chunk received during streaming */
|
|
@@ -71,6 +71,9 @@ declare class ChatApi extends ApiGroup<ChatApiEvents> {
|
|
|
71
71
|
stream?: false;
|
|
72
72
|
}) => Promise<ChatCompletionResult>) & ((params: ChatCompletionParams) => Promise<ChatStream | ChatCompletionResult>);
|
|
73
73
|
};
|
|
74
|
+
hosted: {
|
|
75
|
+
create: (params: HostedChatCompletionParams) => Promise<HostedChatCompletionResult>;
|
|
76
|
+
};
|
|
74
77
|
constructor(config: ApiConfig, projects?: ProjectsApi);
|
|
75
78
|
/** Available LLM models and their worker counts */
|
|
76
79
|
get models(): Record<string, LLMModelInfo>;
|
|
@@ -117,7 +120,9 @@ declare class ChatApi extends ApiGroup<ChatApiEvents> {
|
|
|
117
120
|
* Returns `undefined` when `think` is omitted (server defaults apply).
|
|
118
121
|
*/
|
|
119
122
|
private buildChatTemplateKwargs;
|
|
123
|
+
private normalizeSogniToolsMode;
|
|
120
124
|
private createCompletion;
|
|
125
|
+
private createHostedCompletion;
|
|
121
126
|
/**
|
|
122
127
|
* Send a single chat completion request (no auto tool execution).
|
|
123
128
|
*/
|
package/dist/Chat/index.js
CHANGED
|
@@ -89,6 +89,9 @@ class ChatApi extends ApiGroup_1.default {
|
|
|
89
89
|
this.completions = {
|
|
90
90
|
create: this.createCompletion.bind(this)
|
|
91
91
|
};
|
|
92
|
+
this.hosted = {
|
|
93
|
+
create: this.createHostedCompletion.bind(this)
|
|
94
|
+
};
|
|
92
95
|
// Set up the tools API (requires ProjectsApi for media generation).
|
|
93
96
|
// When ProjectsApi is not provided, tool execution methods will throw at runtime.
|
|
94
97
|
this.tools = new ChatTools_1.default(projects);
|
|
@@ -224,6 +227,11 @@ class ChatApi extends ApiGroup_1.default {
|
|
|
224
227
|
return undefined;
|
|
225
228
|
return { enable_thinking: think };
|
|
226
229
|
}
|
|
230
|
+
normalizeSogniToolsMode(value) {
|
|
231
|
+
return typeof value === 'string' && value.trim().toLowerCase() === 'rich'
|
|
232
|
+
? 'creative-tools'
|
|
233
|
+
: value;
|
|
234
|
+
}
|
|
227
235
|
createCompletion(params) {
|
|
228
236
|
return __awaiter(this, void 0, void 0, function* () {
|
|
229
237
|
// Handle autoExecuteTools (non-streaming only)
|
|
@@ -237,6 +245,17 @@ class ChatApi extends ApiGroup_1.default {
|
|
|
237
245
|
return this.createSingleCompletion(params);
|
|
238
246
|
});
|
|
239
247
|
}
|
|
248
|
+
createHostedCompletion(params) {
|
|
249
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
250
|
+
var _a, _b, _c;
|
|
251
|
+
if (params.stream) {
|
|
252
|
+
throw new Error('chat.hosted.create currently supports non-streaming requests only.');
|
|
253
|
+
}
|
|
254
|
+
const normalizedMessages = normalizeVisionMessages(params.messages);
|
|
255
|
+
const chatTemplateKwargs = (_a = params.chat_template_kwargs) !== null && _a !== void 0 ? _a : this.buildChatTemplateKwargs(params.think);
|
|
256
|
+
return this.client.rest.post('/v1/chat/completions', Object.assign(Object.assign({ model: params.model, messages: normalizedMessages, app_source: params.app_source || params.appSource || this.client.appSource, max_tokens: params.max_tokens, temperature: params.temperature, top_p: params.top_p, top_k: params.top_k, min_p: params.min_p, repetition_penalty: params.repetition_penalty, frequency_penalty: params.frequency_penalty, presence_penalty: params.presence_penalty, stop: params.stop, token_type: params.token_type || params.tokenType, tools: params.tools, tool_choice: params.tool_choice, sogni_tools: this.normalizeSogniToolsMode(params.sogni_tools), sogni_tool_execution: params.sogni_tool_execution, task_profile: params.taskProfile, media_references: (_b = params.media_references) !== null && _b !== void 0 ? _b : params.mediaReferences, api_media_references: (_c = params.api_media_references) !== null && _c !== void 0 ? _c : params.apiMediaReferences }, (chatTemplateKwargs && { chat_template_kwargs: chatTemplateKwargs })), (params.response_format && { response_format: params.response_format })), { timeoutMs: 300000 });
|
|
257
|
+
});
|
|
258
|
+
}
|
|
240
259
|
/**
|
|
241
260
|
* Send a single chat completion request (no auto tool execution).
|
|
242
261
|
*/
|
|
@@ -246,7 +265,7 @@ class ChatApi extends ApiGroup_1.default {
|
|
|
246
265
|
const normalizedMessages = normalizeVisionMessages(params.messages);
|
|
247
266
|
// Build chat_template_kwargs from think parameter
|
|
248
267
|
const chatTemplateKwargs = this.buildChatTemplateKwargs(params.think);
|
|
249
|
-
const request = Object.assign(Object.assign({ jobID, type: 'llm', model: params.model, messages: normalizedMessages, appSource: params.appSource || this.client.appSource, max_tokens: params.max_tokens, temperature: params.temperature, top_p: params.top_p, top_k: params.top_k, min_p: params.min_p, stream: params.stream, repetition_penalty: params.repetition_penalty, frequency_penalty: params.frequency_penalty, presence_penalty: params.presence_penalty, stop: params.stop, tokenType: params.tokenType, tools: params.tools, tool_choice: params.tool_choice, sogni_tools: params.sogni_tools, sogni_tool_execution: params.sogni_tool_execution, taskProfile: params.taskProfile }, (chatTemplateKwargs && { chat_template_kwargs: chatTemplateKwargs })), (params.response_format && { response_format: params.response_format }));
|
|
268
|
+
const request = Object.assign(Object.assign({ jobID, type: 'llm', model: params.model, messages: normalizedMessages, appSource: params.appSource || this.client.appSource, max_tokens: params.max_tokens, temperature: params.temperature, top_p: params.top_p, top_k: params.top_k, min_p: params.min_p, stream: params.stream, repetition_penalty: params.repetition_penalty, frequency_penalty: params.frequency_penalty, presence_penalty: params.presence_penalty, stop: params.stop, tokenType: params.tokenType, tools: params.tools, tool_choice: params.tool_choice, sogni_tools: this.normalizeSogniToolsMode(params.sogni_tools), sogni_tool_execution: params.sogni_tool_execution, taskProfile: params.taskProfile }, (chatTemplateKwargs && { chat_template_kwargs: chatTemplateKwargs })), (params.response_format && { response_format: params.response_format }));
|
|
250
269
|
const stream = new ChatStream_1.default(jobID);
|
|
251
270
|
this.activeStreams.set(jobID, stream);
|
|
252
271
|
// Send the job request via socket
|
package/dist/Chat/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Chat/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,2DAAkD;AAMlD,8DAAsC;AACtC,4DAAuC;AAevC,6DAAqC;AAErC,4DA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qB,CAAC,CAAC;QACxE,CAAC;aAAM,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;YACtC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC,KAAK,oBAAoB,CAAC,CAAC;QACvE,CAAC;IACH,CAAC;IAEO,cAAc,CAAC,IAAqB;QAC1C,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClD,IAAI,CAAC,MAAM;YAAE,OAAO;QAEpB,gFAAgF;QAChF,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACzC,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1D,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;QAClC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAEtC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;YACzB,OAAO,EAAE,QAAQ;YACjB,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC,CAAC;IACL,CAAC;CACF;AAED,kBAAe,OAAO,CAAC"}
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
},
|
|
152
152
|
"negative_prompt": {
|
|
153
153
|
"type": "string",
|
|
154
|
-
"description": "
|
|
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
155
|
},
|
|
156
156
|
"reference_image_url": {
|
|
157
157
|
"type": "string",
|
|
@@ -352,7 +352,7 @@
|
|
|
352
352
|
},
|
|
353
353
|
"negative_prompt": {
|
|
354
354
|
"type": "string",
|
|
355
|
-
"description": "
|
|
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
356
|
},
|
|
357
357
|
"control_mode": {
|
|
358
358
|
"type": "string",
|
package/dist/Chat/types.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export type ToolChoice = 'auto' | 'none' | 'required' | {
|
|
|
31
31
|
name: string;
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
-
export type SogniToolsMode = boolean | 'creative-agent' | 'rich';
|
|
34
|
+
export type SogniToolsMode = boolean | 'creative-agent' | 'creative-tools' | 'rich';
|
|
35
35
|
/**
|
|
36
36
|
* OpenAI-compatible structured-output controls. Forwarded to the worker
|
|
37
37
|
* unchanged; honored natively by llama-server (compiles JSON Schema → GBNF
|
|
@@ -101,9 +101,10 @@ export interface ChatCompletionParams {
|
|
|
101
101
|
/** Controls which (if any) tool is called by the model. */
|
|
102
102
|
tool_choice?: ToolChoice;
|
|
103
103
|
/**
|
|
104
|
-
* Ask the Sogni API to inject
|
|
105
|
-
* `true` injects the hosted
|
|
106
|
-
* `'rich'`
|
|
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.
|
|
107
108
|
*/
|
|
108
109
|
sogni_tools?: SogniToolsMode;
|
|
109
110
|
/**
|
|
@@ -210,6 +211,44 @@ export interface ChatCompletionResult {
|
|
|
210
211
|
/** History of tool calling rounds when `autoExecuteTools` was used. */
|
|
211
212
|
toolHistory?: ToolHistoryEntry[];
|
|
212
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
|
+
};
|
|
213
252
|
export interface ChatJobStateEvent {
|
|
214
253
|
jobID: string;
|
|
215
254
|
type: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { ControlNetName, ControlNetParams, ControlNetMode, VideoControlNetName,
|
|
|
13
13
|
import ChatApi from './Chat';
|
|
14
14
|
import ChatStream from './Chat/ChatStream';
|
|
15
15
|
import ChatToolsApi from './Chat/ChatTools';
|
|
16
|
-
import { ChatMessage, ChatCompletionParams, ChatCompletionChunk, ChatCompletionResult, ChatJobStateEvent, ChatResponseFormat, ContentPart, TextContentPart, ImageUrlContentPart, TokenUsage as ChatTokenUsage, LLMCostEstimation, LLMJobCost, LLMModelInfo, LLMParamConstraint, LLMSamplingDefaults, ToolDefinition, ToolCall, ToolCallDelta, ToolCallFunction, ToolChoice, ToolFunction, SogniToolsMode, ToolExecutionProgress, ToolExecutionResult, ToolHistoryEntry, ToolExecutionOptions } from './Chat/types';
|
|
16
|
+
import { ChatMessage, ChatCompletionParams, ChatCompletionChunk, ChatCompletionResult, ChatJobStateEvent, ChatResponseFormat, ContentPart, HostedChatCompletionParams, HostedChatCompletionResult, HostedChatCompletionChoice, HostedChatCompletionMessage, HostedCreativeWorkflowReference, TextContentPart, ImageUrlContentPart, TokenUsage as ChatTokenUsage, LLMCostEstimation, LLMJobCost, LLMModelInfo, LLMParamConstraint, LLMSamplingDefaults, ToolDefinition, ToolCall, ToolCallDelta, ToolCallFunction, ToolChoice, ToolFunction, SogniToolsMode, ToolExecutionProgress, ToolExecutionResult, ToolHistoryEntry, ToolExecutionOptions } from './Chat/types';
|
|
17
17
|
import { SogniTools, buildSogniTools, isSogniToolCall, parseToolCallArguments } from './Chat/tools';
|
|
18
18
|
import CreativeWorkflowsApi, { parseCreativeWorkflowSseChunk } from './CreativeWorkflows';
|
|
19
19
|
import { CreativeWorkflowArtifact, CreativeWorkflowEvent, CreativeWorkflowKind, CreativeWorkflowRecord, CreativeWorkflowSseEvent, CreativeWorkflowStatus, CreativeWorkflowHostedToolName, ListCreativeWorkflowOptions, StartCreativeWorkflowOptions, StartCreativeWorkflowParams, StartHostedToolSequenceWorkflowDependency, StartHostedToolSequenceWorkflowInput, StartHostedToolSequenceWorkflowStep, StartImageToVideoWorkflowInput, StreamCreativeWorkflowEventsOptions } from './CreativeWorkflows/types';
|
|
@@ -21,7 +21,7 @@ import StatsApi from './Stats';
|
|
|
21
21
|
import ErrorData from './types/ErrorData';
|
|
22
22
|
import { TokenType } from './types/token';
|
|
23
23
|
import { ApiKeyAuthManager, TokenAuthData } from './lib/AuthManager';
|
|
24
|
-
export type { AudioFormat, AudioOutputFormat, AudioProjectParams, AvailableModel, ChatCompletionChunk, ChatCompletionParams, ChatCompletionResult, ChatJobStateEvent, ChatMessage, ChatResponseFormat, ChatTokenUsage, ContentPart, CreativeWorkflowArtifact, CreativeWorkflowEvent, CreativeWorkflowKind, CreativeWorkflowRecord, CreativeWorkflowSseEvent, CreativeWorkflowStatus, ImageUrlContentPart, ListCreativeWorkflowOptions, LLMCostEstimation, LLMJobCost, LLMModelInfo, LLMParamConstraint, LLMSamplingDefaults, ControlNetMode, ControlNetName, ControlNetParams, TextContentPart, ErrorData, ImageProjectParams, ImageOutputFormat, JobStatus, Logger, LogLevel, ProjectParams, ProjectStatus, CreativeWorkflowHostedToolName, StartCreativeWorkflowOptions, StartCreativeWorkflowParams, StartHostedToolSequenceWorkflowDependency, StartHostedToolSequenceWorkflowInput, StartHostedToolSequenceWorkflowStep, StartImageToVideoWorkflowInput, StreamCreativeWorkflowEventsOptions, SupernetType, TokenType, ToolCall, ToolCallDelta, ToolCallFunction, ToolChoice, ToolDefinition, ToolExecutionOptions, ToolExecutionProgress, ToolExecutionResult, ToolFunction, ToolHistoryEntry, SogniToolsMode, SocketEventName, SocketEventSubscriptionInput, SocketEventSubscriptionName, SocketEventSubscriptions, SocketEventSubscriptionsUpdatedData, SocketEventSubscriptionUpdate, VideoControlNetName, VideoControlNetParams, VideoFormat, VideoOutputFormat, VideoProjectParams, VideoWorkflowType };
|
|
24
|
+
export type { AudioFormat, AudioOutputFormat, AudioProjectParams, AvailableModel, ChatCompletionChunk, ChatCompletionParams, ChatCompletionResult, ChatJobStateEvent, ChatMessage, ChatResponseFormat, ChatTokenUsage, ContentPart, HostedChatCompletionChoice, HostedChatCompletionMessage, HostedChatCompletionParams, HostedChatCompletionResult, HostedCreativeWorkflowReference, CreativeWorkflowArtifact, CreativeWorkflowEvent, CreativeWorkflowKind, CreativeWorkflowRecord, CreativeWorkflowSseEvent, CreativeWorkflowStatus, ImageUrlContentPart, ListCreativeWorkflowOptions, LLMCostEstimation, LLMJobCost, LLMModelInfo, LLMParamConstraint, LLMSamplingDefaults, ControlNetMode, ControlNetName, ControlNetParams, TextContentPart, ErrorData, ImageProjectParams, ImageOutputFormat, JobStatus, Logger, LogLevel, ProjectParams, ProjectStatus, CreativeWorkflowHostedToolName, StartCreativeWorkflowOptions, StartCreativeWorkflowParams, StartHostedToolSequenceWorkflowDependency, StartHostedToolSequenceWorkflowInput, StartHostedToolSequenceWorkflowStep, StartImageToVideoWorkflowInput, StreamCreativeWorkflowEventsOptions, SupernetType, TokenType, ToolCall, ToolCallDelta, ToolCallFunction, ToolChoice, ToolDefinition, ToolExecutionOptions, ToolExecutionProgress, ToolExecutionResult, ToolFunction, ToolHistoryEntry, SogniToolsMode, SocketEventName, SocketEventSubscriptionInput, SocketEventSubscriptionName, SocketEventSubscriptions, SocketEventSubscriptionsUpdatedData, SocketEventSubscriptionUpdate, VideoControlNetName, VideoControlNetParams, VideoFormat, VideoOutputFormat, VideoProjectParams, VideoWorkflowType };
|
|
25
25
|
export { ApiError, ApiKeyAuthManager, ChatStream, ChatToolsApi, CreativeWorkflowsApi, CurrentAccount, Job, Project, SogniTools, buildSogniTools, isSogniToolCall, parseCreativeWorkflowSseChunk, parseToolCallArguments };
|
|
26
26
|
export interface SogniClientConfig {
|
|
27
27
|
/**
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,cAAc;AACd,wDAAmC;AACnC,8EAAsD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AM,MAAM,GAAG,IAAI,sBAAY,CAAC;gBAC9B,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,UAAU;gBAC9C,OAAO,EAAE,GAAG;gBACZ,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;aACtC,CAAC,CAAC;YACH,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;YAExD,6CAA6C;YAC7C,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;gBAClB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAyB,CAAC;gBAC9C,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACzC,CAAC;YAED,OAAO,WAAW,CAAC;QACrB,CAAC;KAAA;CACF;AAvHD,kCAuHC"}
|
package/dist/lib/RestClient.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ import TypedEventEmitter, { EventMap } from './TypedEventEmitter';
|
|
|
2
2
|
import { JSONValue } from '../types/json';
|
|
3
3
|
import { Logger } from './DefaultLogger';
|
|
4
4
|
import { AuthManager } from './AuthManager';
|
|
5
|
+
interface RestRequestInit extends RequestInit {
|
|
6
|
+
timeoutMs?: number;
|
|
7
|
+
}
|
|
5
8
|
declare class RestClient<E extends EventMap = never> extends TypedEventEmitter<E> {
|
|
6
9
|
readonly baseUrl: string;
|
|
7
10
|
protected _auth: AuthManager;
|
|
@@ -12,6 +15,6 @@ declare class RestClient<E extends EventMap = never> extends TypedEventEmitter<E
|
|
|
12
15
|
private request;
|
|
13
16
|
private processResponse;
|
|
14
17
|
get<T = JSONValue>(path: string, query?: Record<string, any>): Promise<T>;
|
|
15
|
-
post<T = JSONValue>(path: string, body?: Record<string, unknown>): Promise<T>;
|
|
18
|
+
post<T = JSONValue>(path: string, body?: Record<string, unknown>, options?: Pick<RestRequestInit, 'timeoutMs'>): Promise<T>;
|
|
16
19
|
}
|
|
17
20
|
export default RestClient;
|
package/dist/lib/RestClient.js
CHANGED
|
@@ -8,6 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
11
22
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
23
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
24
|
};
|
|
@@ -33,12 +44,13 @@ class RestClient extends TypedEventEmitter_1.default {
|
|
|
33
44
|
}
|
|
34
45
|
request(url_1) {
|
|
35
46
|
return __awaiter(this, arguments, void 0, function* (url, options = {}) {
|
|
36
|
-
const
|
|
47
|
+
const { timeoutMs = 30000 } = options, requestOptions = __rest(options, ["timeoutMs"]);
|
|
48
|
+
const init = yield this.auth.authenticateRequest(requestOptions);
|
|
37
49
|
// Add a timeout to detect hanging requests
|
|
38
50
|
const controller = new AbortController();
|
|
39
51
|
const timeoutId = setTimeout(() => {
|
|
40
52
|
controller.abort();
|
|
41
|
-
},
|
|
53
|
+
}, timeoutMs);
|
|
42
54
|
try {
|
|
43
55
|
const response = yield fetch(url, Object.assign(Object.assign({}, init), { signal: controller.signal }));
|
|
44
56
|
clearTimeout(timeoutId);
|
|
@@ -73,14 +85,10 @@ class RestClient extends TypedEventEmitter_1.default {
|
|
|
73
85
|
get(path, query = {}) {
|
|
74
86
|
return this.request(this.formatUrl(path, query));
|
|
75
87
|
}
|
|
76
|
-
post(path, body = {}) {
|
|
77
|
-
return this.request(this.formatUrl(path), {
|
|
78
|
-
method: 'POST',
|
|
79
|
-
headers: {
|
|
88
|
+
post(path, body = {}, options = {}) {
|
|
89
|
+
return this.request(this.formatUrl(path), Object.assign({ method: 'POST', headers: {
|
|
80
90
|
'Content-Type': 'application/json'
|
|
81
|
-
},
|
|
82
|
-
body: JSON.stringify(body)
|
|
83
|
-
});
|
|
91
|
+
}, body: JSON.stringify(body) }, options));
|
|
84
92
|
}
|
|
85
93
|
}
|
|
86
94
|
exports.default = RestClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RestClient.js","sourceRoot":"","sources":["../../src/lib/RestClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RestClient.js","sourceRoot":"","sources":["../../src/lib/RestClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA0D;AAC1D,4EAAkE;AASlE,MAAM,UAAuC,SAAQ,2BAAoB;IAKvE,YAAY,OAAe,EAAE,IAAiB,EAAE,MAAc;QAC5D,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAEO,SAAS,CAAC,WAAmB,EAAE,QAAgC,EAAE;QACvE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/C,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACjC,GAAG,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AC9C,CAAC;YACD,0FAA0F;YAC1F,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;gBACzD,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YACpB,CAAC;YACD,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;gBACjB,MAAM,IAAI,oBAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,YAAgC,CAAC,CAAC;YACxE,CAAC;YACD,OAAO,YAAyB,CAAC;QACnC,CAAC;KAAA;IAED,GAAG,CAAgB,IAAY,EAAE,QAA6B,EAAE;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAI,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,IAAI,CACF,IAAY,EACZ,OAAgC,EAAE,EAClC,UAA8C,EAAE;QAEhD,OAAO,IAAI,CAAC,OAAO,CAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,kBACzC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC,EACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IACvB,OAAO,EACV,CAAC;IACL,CAAC;CACF;AAED,kBAAe,UAAU,CAAC"}
|
package/llms-full.txt
CHANGED
|
@@ -934,7 +934,7 @@ Sogni's generation APIs automatically:
|
|
|
934
934
|
- Video-to-Video: "Restyle this video as anime"
|
|
935
935
|
- Music Generation: "Compose a jazz song about the rain"
|
|
936
936
|
|
|
937
|
-
|
|
937
|
+
SDK-LOCAL PUBLIC TOOL NAMES (`SogniTools.all`, client-managed execution):
|
|
938
938
|
|
|
939
939
|
- `sogni_generate_image`
|
|
940
940
|
- `sogni_edit_image`
|
|
@@ -943,18 +943,25 @@ BUILT-IN PUBLIC TOOL NAMES (default `sogni_tools: true`):
|
|
|
943
943
|
- `sogni_video_to_video`
|
|
944
944
|
- `sogni_generate_music`
|
|
945
945
|
|
|
946
|
-
|
|
947
|
-
The Sogni API can also inject
|
|
946
|
+
HOSTED CREATIVE TOOL FAMILIES:
|
|
947
|
+
The Sogni API can also inject hosted Sogni tool families into the same chat completions endpoint. The default `creative-tools` surface provides media, post-production, analysis, metadata, and synchronous composition tools; `sogni_tools: "creative-agent"` adds workflow control and asset-manifest tools:
|
|
948
948
|
|
|
949
|
-
- `generate_image`, `edit_image`, `generate_video`, `generate_music`, `sound_to_video`, `video_to_video` —
|
|
950
|
-
- `restore_photo`, `apply_style`, `refine_result`, `change_angle` — image-edit adapters
|
|
949
|
+
- `generate_image`, `edit_image`, `generate_video`, `generate_music`, `sound_to_video`, `video_to_video` — core media-generation tools with creative-agent naming.
|
|
950
|
+
- `restore_photo`, `apply_style`, `refine_result`, `change_angle` — image-edit adapters backed by the shared image-edit workflow.
|
|
951
951
|
- `animate_photo` — image-to-video, with multi-source fan-out via `sourceImageIndices`. Fan-out (>1 source image) is composed into one MP4 by default; opt out with `stitched: false` for a flat clip list.
|
|
952
952
|
- `stitch_video` — concatenate selected video clips (with optional audio overlay via `audioIndex`) into one MP4.
|
|
953
953
|
- `orbit_video` — generate orbit clips around a subject and stitch them into one MP4.
|
|
954
954
|
- `dance_montage` — generate dance clips and stitch when multi-clip.
|
|
955
|
+
- `extend_video` — append new content to an existing video while preserving the original portion.
|
|
956
|
+
- `replace_video_segment` — replace a bounded window inside an existing video. Replacement sources can use `replacementStartSeconds` / `replacementEndSeconds` to splice a trimmed source slice.
|
|
957
|
+
- `overlay_video` — burn static text or image overlays onto an existing video.
|
|
958
|
+
- `add_subtitles` — burn subtitle cues onto an existing video.
|
|
959
|
+
- `enhance_prompt` — model-ready image/video/music/edit prompt expansion.
|
|
960
|
+
- `compose_script` — scripts, storyboards, trailers, social shorts, campaign beats, and video prompts.
|
|
961
|
+
- `compose_lyrics`, `compose_instrumental` — vocal lyrics or instrumental music structures.
|
|
955
962
|
|
|
956
|
-
PER-REQUEST MEDIA CONTEXT
|
|
957
|
-
Generated images, videos, and audio are addressable by stable indices across tool rounds. Every
|
|
963
|
+
PER-REQUEST MEDIA CONTEXT:
|
|
964
|
+
Generated images, videos, and audio are addressable by stable indices across tool rounds. Every hosted Sogni tool result returns `startIndex` and `indices` in its envelope so a later tool can target the result with `sourceImageIndex`, `videoIndices`, `audioIndex`, etc., without the model having to copy URLs back into prompt text.
|
|
958
965
|
|
|
959
966
|
COMPOSITION TOOLS:
|
|
960
967
|
`stitch_video`, `orbit_video`, `dance_montage`, and `animate_photo` fan-out return a single composed MP4 URL. Per-clip source URLs are preserved on the result envelope for inspection.
|
|
@@ -967,7 +974,7 @@ MEDIA-CONDITIONED TOOL INPUTS:
|
|
|
967
974
|
- `reference_video_url`
|
|
968
975
|
All media-conditioned tool inputs must be inline base64-encoded `data:` URIs. Remote `http(s)` URLs are not allowed. Tool image inputs accept PNG/JPEG only, tool audio inputs accept MP3/M4A/WAV only, and tool video inputs accept MP4 or MOV/QuickTime only.
|
|
969
976
|
|
|
970
|
-
DEFAULT GENERATION MODELS (used by platform tools):
|
|
977
|
+
DEFAULT GENERATION MODELS (used by SDK-local platform tools):
|
|
971
978
|
| Tool | Model ID | Description |
|
|
972
979
|
|------|----------|-------------|
|
|
973
980
|
| `sogni_generate_image` | z_image_turbo_bf16 | Z-Image Turbo, ultra-fast 8-step generation |
|
|
@@ -988,7 +995,7 @@ PLATFORM TOOL WORKFLOW:
|
|
|
988
995
|
|
|
989
996
|
See `workflow_text_chat_sogni_tools.mjs` for a composition-pipeline example
|
|
990
997
|
covering the core image/video/music flows. See `workflow_creative_agent_tools.mjs`
|
|
991
|
-
for server-side
|
|
998
|
+
for server-side hosted Sogni tool injection with `sogni_tools`.
|
|
992
999
|
For the full built-in SDK tool surface, use `SogniTools.all` with
|
|
993
1000
|
`sogni.chat.tools.executeAll()` or `autoExecuteTools`.
|
|
994
1001
|
|
|
@@ -1012,7 +1019,7 @@ node workflow_text_chat_sogni_tools.mjs "Compose a jazz song about the rain"
|
|
|
1012
1019
|
# Generate multiple items
|
|
1013
1020
|
node workflow_text_chat_sogni_tools.mjs -n 4 "Create images of fantasy landscapes"
|
|
1014
1021
|
|
|
1015
|
-
#
|
|
1022
|
+
# Server-side hosted creative tools
|
|
1016
1023
|
node workflow_creative_agent_tools.mjs "Create an orbit video plan for a crystal perfume bottle"
|
|
1017
1024
|
|
|
1018
1025
|
# Durable creative-agent workflow
|
package/llms.txt
CHANGED
|
@@ -456,7 +456,7 @@ Combine LLM tool calling with Sogni's generation APIs to create media from natur
|
|
|
456
456
|
- **Video-to-Video** — "Restyle this video as anime"
|
|
457
457
|
- **Music Generation** — "Compose a jazz song about the rain"
|
|
458
458
|
|
|
459
|
-
|
|
459
|
+
SDK-local public tool names (`SogniTools.all`, client-managed execution):
|
|
460
460
|
|
|
461
461
|
- `sogni_generate_image`
|
|
462
462
|
- `sogni_edit_image`
|
|
@@ -465,18 +465,23 @@ Built-in public tool names (default `sogni_tools: true`):
|
|
|
465
465
|
- `sogni_video_to_video`
|
|
466
466
|
- `sogni_generate_music`
|
|
467
467
|
|
|
468
|
-
|
|
468
|
+
Hosted creative tool families:
|
|
469
469
|
|
|
470
470
|
- `generate_image`, `edit_image`, `generate_video`, `generate_music`, `sound_to_video`, `video_to_video`
|
|
471
471
|
- `restore_photo`, `apply_style`, `refine_result`, `change_angle` (image-edit adapters)
|
|
472
472
|
- `animate_photo` (image-to-video with multi-source fan-out via `sourceImageIndices`; composed into one MP4 by default — opt out with `stitched: false`)
|
|
473
473
|
- `stitch_video`, `orbit_video`, `dance_montage` (server-side composition into a single MP4)
|
|
474
|
+
- `extend_video`, `replace_video_segment` (append or replace bounded windows; replacements can trim source windows with `replacementStartSeconds` / `replacementEndSeconds`)
|
|
475
|
+
- `overlay_video`, `add_subtitles` (ffmpeg post-production on existing videos)
|
|
476
|
+
- `enhance_prompt` (model-ready image/video/music/edit prompt expansion)
|
|
477
|
+
- `compose_script` (scripts, storyboards, trailers, social shorts, campaign beats, and video prompts)
|
|
478
|
+
- `compose_lyrics`, `compose_instrumental` (vocal lyrics or instrumental music structures)
|
|
474
479
|
|
|
475
|
-
|
|
480
|
+
The default `creative-tools` surface includes the tools above. `sogni_tools: "creative-agent"` adds workflow control and asset-manifest tools. Per-request media context lets generated images / videos / audio be addressed by stable indices across tool rounds (each tool result envelope returns `startIndex` and `indices`).
|
|
476
481
|
|
|
477
482
|
Media-conditioned tools accept explicit inline base64 `data:` URIs such as `source_image_url`, `reference_image_url`, `reference_audio_url`, and `reference_video_url`. Remote `http(s)` URLs are not allowed for these tool inputs. Tool image inputs accept PNG/JPEG only, tool audio inputs accept MP3/M4A/WAV only, and tool video inputs accept MP4 or MOV/QuickTime only.
|
|
478
483
|
|
|
479
|
-
The `workflow_text_chat_sogni_tools.mjs` example demonstrates the core image/video/music composition flows. `workflow_creative_agent_tools.mjs` demonstrates server-side
|
|
484
|
+
The `workflow_text_chat_sogni_tools.mjs` example demonstrates the core image/video/music composition flows. `workflow_creative_agent_tools.mjs` demonstrates server-side hosted Sogni tool injection through `/v1/chat/completions`. For the full built-in SDK tool surface, use `SogniTools.all` with `sogni.chat.tools.executeAll()` or `autoExecuteTools`.
|
|
480
485
|
|
|
481
486
|
Durable creative workflows: the SDK exposes persistent multi-step workflows through `sogni.creativeWorkflows` (`startImageToVideo`, `list`, `get`, `events`, `streamEvents`, `cancel`) backed by `/v1/creative-agent/workflows`. They require API-key auth. See `workflow_creative_agent_workflows.mjs` for start/list/get/events/stream/cancel coverage.
|
|
482
487
|
|
package/package.json
CHANGED
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "4.2.0-alpha.
|
|
6
|
+
"version": "4.2.0-alpha.21",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=22"
|
|
9
|
+
},
|
|
7
10
|
"description": "Sogni SDK - AI image, video & audio generation plus LLM chat with vision via the Sogni Supernet (Stable Diffusion, Flux, WAN 2.2, LTX-2, Seedance, Qwen VLM)",
|
|
8
11
|
"keywords": [
|
|
9
12
|
"ai",
|
package/src/Chat/index.ts
CHANGED
|
@@ -14,6 +14,8 @@ import {
|
|
|
14
14
|
ChatJobStateEvent,
|
|
15
15
|
ChatRequestMessage,
|
|
16
16
|
ChatMessage,
|
|
17
|
+
HostedChatCompletionParams,
|
|
18
|
+
HostedChatCompletionResult,
|
|
17
19
|
LLMCostEstimation,
|
|
18
20
|
LLMEstimateResponse,
|
|
19
21
|
LLMModelInfo,
|
|
@@ -134,6 +136,10 @@ class ChatApi extends ApiGroup<ChatApiEvents> {
|
|
|
134
136
|
((params: ChatCompletionParams) => Promise<ChatStream | ChatCompletionResult>);
|
|
135
137
|
};
|
|
136
138
|
|
|
139
|
+
hosted: {
|
|
140
|
+
create: (params: HostedChatCompletionParams) => Promise<HostedChatCompletionResult>;
|
|
141
|
+
};
|
|
142
|
+
|
|
137
143
|
constructor(config: ApiConfig, projects?: ProjectsApi) {
|
|
138
144
|
super(config);
|
|
139
145
|
|
|
@@ -148,6 +154,9 @@ class ChatApi extends ApiGroup<ChatApiEvents> {
|
|
|
148
154
|
this.completions = {
|
|
149
155
|
create: this.createCompletion.bind(this) as any
|
|
150
156
|
};
|
|
157
|
+
this.hosted = {
|
|
158
|
+
create: this.createHostedCompletion.bind(this)
|
|
159
|
+
};
|
|
151
160
|
|
|
152
161
|
// Set up the tools API (requires ProjectsApi for media generation).
|
|
153
162
|
// When ProjectsApi is not provided, tool execution methods will throw at runtime.
|
|
@@ -315,6 +324,14 @@ class ChatApi extends ApiGroup<ChatApiEvents> {
|
|
|
315
324
|
return { enable_thinking: think };
|
|
316
325
|
}
|
|
317
326
|
|
|
327
|
+
private normalizeSogniToolsMode(
|
|
328
|
+
value: ChatCompletionParams['sogni_tools'] | string | undefined
|
|
329
|
+
): ChatRequestMessage['sogni_tools'] | undefined {
|
|
330
|
+
return typeof value === 'string' && value.trim().toLowerCase() === 'rich'
|
|
331
|
+
? 'creative-tools'
|
|
332
|
+
: (value as ChatRequestMessage['sogni_tools']);
|
|
333
|
+
}
|
|
334
|
+
|
|
318
335
|
private async createCompletion(
|
|
319
336
|
params: ChatCompletionParams
|
|
320
337
|
): Promise<ChatStream | ChatCompletionResult> {
|
|
@@ -332,6 +349,46 @@ class ChatApi extends ApiGroup<ChatApiEvents> {
|
|
|
332
349
|
return this.createSingleCompletion(params);
|
|
333
350
|
}
|
|
334
351
|
|
|
352
|
+
private async createHostedCompletion(
|
|
353
|
+
params: HostedChatCompletionParams
|
|
354
|
+
): Promise<HostedChatCompletionResult> {
|
|
355
|
+
if (params.stream) {
|
|
356
|
+
throw new Error('chat.hosted.create currently supports non-streaming requests only.');
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
const normalizedMessages = normalizeVisionMessages(params.messages);
|
|
360
|
+
const chatTemplateKwargs =
|
|
361
|
+
params.chat_template_kwargs ?? this.buildChatTemplateKwargs(params.think);
|
|
362
|
+
return this.client.rest.post<HostedChatCompletionResult>(
|
|
363
|
+
'/v1/chat/completions',
|
|
364
|
+
{
|
|
365
|
+
model: params.model,
|
|
366
|
+
messages: normalizedMessages,
|
|
367
|
+
app_source: params.app_source || params.appSource || this.client.appSource,
|
|
368
|
+
max_tokens: params.max_tokens,
|
|
369
|
+
temperature: params.temperature,
|
|
370
|
+
top_p: params.top_p,
|
|
371
|
+
top_k: params.top_k,
|
|
372
|
+
min_p: params.min_p,
|
|
373
|
+
repetition_penalty: params.repetition_penalty,
|
|
374
|
+
frequency_penalty: params.frequency_penalty,
|
|
375
|
+
presence_penalty: params.presence_penalty,
|
|
376
|
+
stop: params.stop,
|
|
377
|
+
token_type: params.token_type || params.tokenType,
|
|
378
|
+
tools: params.tools,
|
|
379
|
+
tool_choice: params.tool_choice,
|
|
380
|
+
sogni_tools: this.normalizeSogniToolsMode(params.sogni_tools),
|
|
381
|
+
sogni_tool_execution: params.sogni_tool_execution,
|
|
382
|
+
task_profile: params.taskProfile,
|
|
383
|
+
media_references: params.media_references ?? params.mediaReferences,
|
|
384
|
+
api_media_references: params.api_media_references ?? params.apiMediaReferences,
|
|
385
|
+
...(chatTemplateKwargs && { chat_template_kwargs: chatTemplateKwargs }),
|
|
386
|
+
...(params.response_format && { response_format: params.response_format })
|
|
387
|
+
},
|
|
388
|
+
{ timeoutMs: 300000 }
|
|
389
|
+
);
|
|
390
|
+
}
|
|
391
|
+
|
|
335
392
|
/**
|
|
336
393
|
* Send a single chat completion request (no auto tool execution).
|
|
337
394
|
*/
|
|
@@ -363,7 +420,7 @@ class ChatApi extends ApiGroup<ChatApiEvents> {
|
|
|
363
420
|
tokenType: params.tokenType,
|
|
364
421
|
tools: params.tools,
|
|
365
422
|
tool_choice: params.tool_choice,
|
|
366
|
-
sogni_tools: params.sogni_tools,
|
|
423
|
+
sogni_tools: this.normalizeSogniToolsMode(params.sogni_tools),
|
|
367
424
|
sogni_tool_execution: params.sogni_tool_execution,
|
|
368
425
|
taskProfile: params.taskProfile,
|
|
369
426
|
...(chatTemplateKwargs && { chat_template_kwargs: chatTemplateKwargs }),
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
},
|
|
152
152
|
"negative_prompt": {
|
|
153
153
|
"type": "string",
|
|
154
|
-
"description": "
|
|
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
155
|
},
|
|
156
156
|
"reference_image_url": {
|
|
157
157
|
"type": "string",
|
|
@@ -352,7 +352,7 @@
|
|
|
352
352
|
},
|
|
353
353
|
"negative_prompt": {
|
|
354
354
|
"type": "string",
|
|
355
|
-
"description": "
|
|
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
356
|
},
|
|
357
357
|
"control_mode": {
|
|
358
358
|
"type": "string",
|
package/src/Chat/types.ts
CHANGED
|
@@ -36,7 +36,7 @@ export type ToolChoice =
|
|
|
36
36
|
| 'required'
|
|
37
37
|
| { type: 'function'; function: { name: string } };
|
|
38
38
|
|
|
39
|
-
export type SogniToolsMode = boolean | 'creative-agent' | 'rich';
|
|
39
|
+
export type SogniToolsMode = boolean | 'creative-agent' | 'creative-tools' | 'rich';
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* OpenAI-compatible structured-output controls. Forwarded to the worker
|
|
@@ -111,9 +111,10 @@ export interface ChatCompletionParams {
|
|
|
111
111
|
/** Controls which (if any) tool is called by the model. */
|
|
112
112
|
tool_choice?: ToolChoice;
|
|
113
113
|
/**
|
|
114
|
-
* Ask the Sogni API to inject
|
|
115
|
-
* `true` injects the hosted
|
|
116
|
-
* `'rich'`
|
|
114
|
+
* Ask the Sogni API to inject server-side media-generation tool families.
|
|
115
|
+
* `true` or `'creative-tools'` injects the hosted creative media/planning tool family.
|
|
116
|
+
* `'rich'` is accepted as a legacy alias for `'creative-tools'`.
|
|
117
|
+
* `'creative-agent'` adds hosted workflow-control and asset-manifest tools.
|
|
117
118
|
*/
|
|
118
119
|
sogni_tools?: SogniToolsMode;
|
|
119
120
|
/**
|
|
@@ -225,6 +226,52 @@ export interface ChatCompletionResult {
|
|
|
225
226
|
toolHistory?: ToolHistoryEntry[];
|
|
226
227
|
}
|
|
227
228
|
|
|
229
|
+
export interface HostedChatCompletionMessage {
|
|
230
|
+
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
231
|
+
content: string | null;
|
|
232
|
+
tool_calls?: ToolCall[];
|
|
233
|
+
tool_call_id?: string;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export interface HostedChatCompletionChoice {
|
|
237
|
+
index: number;
|
|
238
|
+
message: HostedChatCompletionMessage;
|
|
239
|
+
finish_reason: string | null;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export interface HostedCreativeWorkflowReference {
|
|
243
|
+
workflowId: string;
|
|
244
|
+
status: string;
|
|
245
|
+
url: string;
|
|
246
|
+
eventsUrl: string;
|
|
247
|
+
streamUrl: string;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export interface HostedChatCompletionResult {
|
|
251
|
+
id: string;
|
|
252
|
+
object: 'chat.completion';
|
|
253
|
+
created: number;
|
|
254
|
+
model: string;
|
|
255
|
+
choices: HostedChatCompletionChoice[];
|
|
256
|
+
usage?: TokenUsage;
|
|
257
|
+
creative_workflows?: HostedCreativeWorkflowReference[];
|
|
258
|
+
sogni_tool_results?: Record<string, unknown>[];
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export type HostedChatCompletionParams = Omit<
|
|
262
|
+
ChatCompletionParams,
|
|
263
|
+
'stream' | 'autoExecuteTools' | 'onToolCall' | 'onToolProgress' | 'maxToolRounds'
|
|
264
|
+
> & {
|
|
265
|
+
stream?: false;
|
|
266
|
+
token_type?: 'sogni' | 'spark' | 'auto';
|
|
267
|
+
app_source?: string;
|
|
268
|
+
chat_template_kwargs?: Record<string, unknown>;
|
|
269
|
+
media_references?: unknown[];
|
|
270
|
+
mediaReferences?: unknown[];
|
|
271
|
+
api_media_references?: unknown[];
|
|
272
|
+
apiMediaReferences?: unknown[];
|
|
273
|
+
};
|
|
274
|
+
|
|
228
275
|
export interface ChatJobStateEvent {
|
|
229
276
|
jobID: string;
|
|
230
277
|
type: string;
|
package/src/index.ts
CHANGED
|
@@ -54,6 +54,11 @@ import {
|
|
|
54
54
|
ChatJobStateEvent,
|
|
55
55
|
ChatResponseFormat,
|
|
56
56
|
ContentPart,
|
|
57
|
+
HostedChatCompletionParams,
|
|
58
|
+
HostedChatCompletionResult,
|
|
59
|
+
HostedChatCompletionChoice,
|
|
60
|
+
HostedChatCompletionMessage,
|
|
61
|
+
HostedCreativeWorkflowReference,
|
|
57
62
|
TextContentPart,
|
|
58
63
|
ImageUrlContentPart,
|
|
59
64
|
TokenUsage as ChatTokenUsage,
|
|
@@ -120,6 +125,11 @@ export type {
|
|
|
120
125
|
ChatResponseFormat,
|
|
121
126
|
ChatTokenUsage,
|
|
122
127
|
ContentPart,
|
|
128
|
+
HostedChatCompletionChoice,
|
|
129
|
+
HostedChatCompletionMessage,
|
|
130
|
+
HostedChatCompletionParams,
|
|
131
|
+
HostedChatCompletionResult,
|
|
132
|
+
HostedCreativeWorkflowReference,
|
|
123
133
|
CreativeWorkflowArtifact,
|
|
124
134
|
CreativeWorkflowEvent,
|
|
125
135
|
CreativeWorkflowKind,
|
package/src/lib/RestClient.ts
CHANGED
|
@@ -4,6 +4,10 @@ import { JSONValue } from '../types/json';
|
|
|
4
4
|
import { Logger } from './DefaultLogger';
|
|
5
5
|
import { AuthManager } from './AuthManager';
|
|
6
6
|
|
|
7
|
+
interface RestRequestInit extends RequestInit {
|
|
8
|
+
timeoutMs?: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
7
11
|
class RestClient<E extends EventMap = never> extends TypedEventEmitter<E> {
|
|
8
12
|
readonly baseUrl: string;
|
|
9
13
|
protected _auth: AuthManager;
|
|
@@ -28,14 +32,15 @@ class RestClient<E extends EventMap = never> extends TypedEventEmitter<E> {
|
|
|
28
32
|
return url.toString();
|
|
29
33
|
}
|
|
30
34
|
|
|
31
|
-
private async request<T = JSONValue>(url: string, options:
|
|
32
|
-
const
|
|
35
|
+
private async request<T = JSONValue>(url: string, options: RestRequestInit = {}): Promise<T> {
|
|
36
|
+
const { timeoutMs = 30000, ...requestOptions } = options;
|
|
37
|
+
const init = await this.auth.authenticateRequest(requestOptions);
|
|
33
38
|
|
|
34
39
|
// Add a timeout to detect hanging requests
|
|
35
40
|
const controller = new AbortController();
|
|
36
41
|
const timeoutId = setTimeout(() => {
|
|
37
42
|
controller.abort();
|
|
38
|
-
},
|
|
43
|
+
}, timeoutMs);
|
|
39
44
|
|
|
40
45
|
try {
|
|
41
46
|
const response = await fetch(url, { ...init, signal: controller.signal });
|
|
@@ -69,13 +74,18 @@ class RestClient<E extends EventMap = never> extends TypedEventEmitter<E> {
|
|
|
69
74
|
return this.request<T>(this.formatUrl(path, query));
|
|
70
75
|
}
|
|
71
76
|
|
|
72
|
-
post<T = JSONValue>(
|
|
77
|
+
post<T = JSONValue>(
|
|
78
|
+
path: string,
|
|
79
|
+
body: Record<string, unknown> = {},
|
|
80
|
+
options: Pick<RestRequestInit, 'timeoutMs'> = {}
|
|
81
|
+
): Promise<T> {
|
|
73
82
|
return this.request<T>(this.formatUrl(path), {
|
|
74
83
|
method: 'POST',
|
|
75
84
|
headers: {
|
|
76
85
|
'Content-Type': 'application/json'
|
|
77
86
|
},
|
|
78
|
-
body: JSON.stringify(body)
|
|
87
|
+
body: JSON.stringify(body),
|
|
88
|
+
...options
|
|
79
89
|
});
|
|
80
90
|
}
|
|
81
91
|
}
|