Skip to content

Commit 13892c5

Browse files
committed
chore(release): dashscope-sdk-official v1.25.4
1 parent 8108db2 commit 13892c5

5 files changed

Lines changed: 147 additions & 4 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ coverage/
1313
.env.*
1414
!.env.example
1515
.cursor/
16+
.qoder/

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,20 @@
33
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
44
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55

6-
## [Unreleased](https://github.com/dashscope/dashscope-sdk-nodejs/compare/v1.25.3...HEAD)
6+
## [Unreleased](https://github.com/dashscope/dashscope-sdk-nodejs/compare/v1.25.4...HEAD)
7+
8+
## [1.25.4](https://github.com/dashscope/dashscope-sdk-nodejs/releases/tag/v1.25.4) - 2026-06-09
9+
10+
### Added
11+
12+
- **GenerateOptions**: Added explicit `presence_penalty`, `tools`, `tool_choice`, `enable_thinking`, `n` parameters for function calling and reasoning mode support.
13+
- **MultiModalConversationOptions**: Added explicit `temperature`, `top_p`, `top_k`, `max_tokens`, `seed`, `stop`, `repetition_penalty`, `presence_penalty`, `result_format`, `incremental_output`, `enable_search`, `tools`, `tool_choice`, `enable_thinking`, `n` parameters.
14+
- **VideoSynthesisOptions**: Added explicit `seed`, `prompt_extend`, `watermark`, `resolution`, `ratio` parameters.
15+
- **TextEmbeddingOptions**: Added `dimension`, `output_type`, `instruct` parameters for v3/v4 models.
16+
- **MultiModalEmbeddingOptions**: Added `dimension`, `output_type`, `fps`, `instruct`, `enable_fusion`, `res_level`, `max_video_frames` parameters for qwen3-vl-embedding and snapshot models.
17+
- **TextReRankOptions**: Added `instruct` parameter for custom ranking instructions.
18+
19+
Synced from [dashscope-sdk-python](https://github.com/dashscope/dashscope-sdk-python) **v1.25.21** (tag `v1.25.21`).
720

821
## [1.25.3](https://github.com/dashscope/dashscope-sdk-nodejs/releases/tag/v1.25.3) - 2026-04-24
922

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dashscope-sdk-official",
3-
"version": "1.25.3",
3+
"version": "1.25.4",
44
"description": "Official Node.js SDK for Alibaba Cloud Model Studio (DashScope) APIs",
55
"keywords": [
66
"dashscope-sdk-official",

src/types.d.ts

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,31 @@ export interface GenerateOptions {
122122
*/
123123
incremental_output?: boolean;
124124

125+
/**
126+
* Presence penalty for controlling content repetition. Range [-2.0, 2.0].
127+
*/
128+
presence_penalty?: number;
129+
130+
/**
131+
* Tool definitions for function calling.
132+
*/
133+
tools?: Record<string, unknown>[];
134+
135+
/**
136+
* Tool selection strategy. `"auto"`, `"none"`, `"required"`, or an object specifying a particular tool.
137+
*/
138+
tool_choice?: string | Record<string, unknown>;
139+
140+
/**
141+
* Enable thinking/reasoning mode (model-dependent).
142+
*/
143+
enable_thinking?: boolean;
144+
145+
/**
146+
* Number of responses to generate (1-4).
147+
*/
148+
n?: number;
149+
125150
/**
126151
* Plugin configuration (e.g. extended search options).
127152
*/
@@ -205,6 +230,18 @@ export interface TextEmbeddingOptions {
205230

206231
/** `query` or `document` for dual-tower models. */
207232
text_type?: 'query' | 'document';
233+
234+
/** Output vector dimension. Options: 2048, 1536 (v4), 1024 (default), 768, 512, 256, 128, 64. Only for v3/v4. */
235+
dimension?: number;
236+
237+
/** Output format: `"dense"` (default), `"sparse"`, or `"dense&sparse"`. Only for v3/v4. */
238+
output_type?: 'dense' | 'sparse' | 'dense&sparse';
239+
240+
/** Custom task instruction to guide model understanding of query intent. */
241+
instruct?: string;
242+
243+
/** Additional parameters. */
244+
[key: string]: unknown;
208245
}
209246

210247
/** OpenAI-compatible chat completion request shape. */
@@ -280,6 +317,22 @@ export interface VideoSynthesisOptions {
280317
media?: VideoSynthesisMediaItem[];
281318
duration?: number;
282319
size?: string;
320+
321+
/** Random seed for video generation. */
322+
seed?: number;
323+
324+
/** Whether to extend prompt. */
325+
prompt_extend?: boolean;
326+
327+
/** Whether to add watermark. */
328+
watermark?: boolean;
329+
330+
/** Output resolution. */
331+
resolution?: string;
332+
333+
/** Aspect ratio, e.g. "16:9". */
334+
ratio?: string;
335+
283336
[key: string]: unknown;
284337
}
285338

@@ -303,6 +356,52 @@ export interface MultiModalConversationOptions {
303356
text?: string;
304357
voice?: string;
305358
language_type?: string;
359+
360+
/** Sampling temperature in [0, 2). Higher = more diverse. */
361+
temperature?: number;
362+
363+
/** Nucleus sampling threshold in (0, 1]. */
364+
top_p?: number;
365+
366+
/** Top-k sampling: only the top-k tokens by score are candidates. */
367+
top_k?: number;
368+
369+
/** Maximum output token count. */
370+
max_tokens?: number;
371+
372+
/** Random seed for reproducibility. */
373+
seed?: number;
374+
375+
/** Stop sequences. */
376+
stop?: string | string[];
377+
378+
/** Repetition penalty; 1.0 disables. */
379+
repetition_penalty?: number;
380+
381+
/** Presence penalty for controlling content repetition. Range [-2.0, 2.0]. */
382+
presence_penalty?: number;
383+
384+
/** `"message"` or `"text"` result format. */
385+
result_format?: string;
386+
387+
/** In streaming mode, output only new tokens (true) vs. cumulative output (false). */
388+
incremental_output?: boolean;
389+
390+
/** Enable web search. */
391+
enable_search?: boolean;
392+
393+
/** Tool definitions for function calling. */
394+
tools?: Record<string, unknown>[];
395+
396+
/** Tool selection strategy. */
397+
tool_choice?: string | Record<string, unknown>;
398+
399+
/** Enable thinking/reasoning mode (model-dependent). */
400+
enable_thinking?: boolean;
401+
402+
/** Number of responses to generate (1-4). */
403+
n?: number;
404+
306405
[key: string]: unknown;
307406
}
308407

@@ -327,6 +426,30 @@ export interface BatchTextEmbeddingOptions {
327426
export interface MultiModalEmbeddingOptions {
328427
model: string;
329428
input: MultiModalContentItem[];
429+
430+
/** Output vector dimensions. Model-specific supported values. */
431+
dimension?: number;
432+
433+
/** Output vector format, currently only `"dense"` is supported. */
434+
output_type?: string;
435+
436+
/** Video frame extraction ratio in range [0,1]. Default: 1.0. */
437+
fps?: number;
438+
439+
/** Custom task instruction to guide model understanding of query intent. */
440+
instruct?: string;
441+
442+
/** Only for qwen3-vl-embedding. When true, fuses all contents into 1 vector. */
443+
enable_fusion?: boolean;
444+
445+
/** Resolution tier: 0/1/2/3. Only for snapshot models. */
446+
res_level?: number;
447+
448+
/** Max video sampling frames, up to 64. Only for snapshot models. */
449+
max_video_frames?: number;
450+
451+
/** Additional parameters. */
452+
[key: string]: unknown;
330453
}
331454

332455
/** NLU / understanding parameters. */
@@ -344,6 +467,12 @@ export interface TextReRankOptions {
344467
documents: string[];
345468
top_n?: number;
346469
return_documents?: boolean;
470+
471+
/** Custom task instruction to guide ranking strategy. English recommended. */
472+
instruct?: string;
473+
474+
/** Additional parameters. */
475+
[key: string]: unknown;
347476
}
348477

349478
/** Model deployment create parameters. */

0 commit comments

Comments
 (0)