@byte_fluffy/nexra-sdk 0.1.0-alpha.52 → 0.1.0-alpha.53

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/README.md CHANGED
@@ -4,6 +4,21 @@ TypeScript SDK for the Nexra Task API. It includes task execution, model discove
4
4
  asset upload/download, webhook verification, authoritative catalog quotes, and the
5
5
  browser-safe public model catalog.
6
6
 
7
+ ## Speech recognition
8
+
9
+ Standard file recognition uses `run("bytedance/doubao-asr-standard-v2", input)`.
10
+ Live recognition uses `transcription.stream({ model: "bytedance/doubao-asr-stream-v2",
11
+ audio, configuration, signal })`, where `audio` is an `AsyncIterable<Uint8Array>`.
12
+ The SDK owns WebSocket framing and decoding; applications own audio capture.
13
+ Each event contains `{ final, response }`; `response.result.text` is a cumulative
14
+ snapshot, not an append-only delta. End the audio iterator to finish normally;
15
+ abort the signal to cancel. Node/Bun and browser builds use separate transports.
16
+
17
+ See the [ASR integration guide](https://github.com/starrank-soft/nexra-monorepo/blob/refactor/typescript-restate-scaffold/docs/asr-sdk-integration.md)
18
+ for VibePaper/StarCut deployment, authentication and stopping semantics. This ASR
19
+ addition must be built/packaged or published before use; the previously published
20
+ `0.1.0-alpha.50` does not include the streaming client.
21
+
7
22
  ```bash
8
23
  npm install @byte_fluffy/nexra-sdk@next
9
24
  ```
@@ -120,30 +135,6 @@ const result = await nexra.tasks.wait(task.id);
120
135
  Seedance 2.0 supports 4–15 seconds and Seedance 2.5 supports 4–30 seconds.
121
136
  The existing ByteDance model IDs retain their own supplies and prices.
122
137
 
123
- ## MiniMax H3 Max
124
-
125
- `0.1.0-alpha.49` adds the official `minimax/MiniMax-H3-Max` model. It supports
126
- 480P/768P output, 5–15 seconds, and image, video and audio references.
127
-
128
- ```ts
129
- const model = "minimax/MiniMax-H3-Max";
130
- const state = await nexra.catalog.model(model, "video.generate");
131
- // The selected environment owns availability and current sale prices.
132
- console.log(state.available, state.prices);
133
-
134
- const task = await nexra.tasks.create(model, {
135
- content: [{ type: "text", role: "prompt", text: "A paper boat drifts across a rain puddle." }],
136
- duration: 5,
137
- resolution: "480P",
138
- aspect_ratio: "16:9",
139
- });
140
- const result = await nexra.tasks.wait(task.id);
141
- ```
142
-
143
- Use the selected environment's published prices for estimates. The SDK's bundled
144
- catalog describes the model contract; channel costs and sale prices remain in
145
- the live catalog.
146
-
147
138
  ## Banana 2.1
148
139
 
149
140
  Use `google/gemini-nano-banana-2.1` for Banana 2.1. The model supports
@@ -463,92 +454,6 @@ const gpt6Prices = prices.filter(({ modelId }) =>
463
454
  );
464
455
  ```
465
456
 
466
- ## Ark web search (Responses)
467
-
468
- Available since SDK `0.1.0-alpha.47` (`npm install @byte_fluffy/nexra-sdk@next`).
469
-
470
- DeepSeek V4.1 Flash (`deepseek/deepseek-v4-1-flash`), GLM 5.3 Flash
471
- (`z-ai/glm-5-3-flash`), Doubao Seed 2.1 Lite
472
- (`bytedance/doubao-seed-2-1-lite-260915`), and Kimi K3.1 Pro
473
- (`moonshot-ai/kimi-k3-1-pro`) support the Ark online content plugin through
474
- `/v1/responses`. The default SDK binding selects this endpoint. All four retain
475
- explicit Chat Completions bindings; DeepSeek also retains Messages.
476
- Search is a provider-executed tool, rather than a Chat `web_search_options` flag.
477
-
478
- ```ts
479
- import { generateText } from "ai";
480
- import { openai } from "@ai-sdk/openai";
481
- import { createNexraLanguageModel } from "@byte_fluffy/nexra-sdk/language";
482
-
483
- const result = await generateText({
484
- model: createNexraLanguageModel("deepseek/deepseek-v4-1-flash", {
485
- apiKey: process.env.NEXRA_API_KEY!,
486
- baseUrl: "https://vip-api.nexra-ai.com/v1",
487
- }),
488
- prompt: "Search for the official DeepSeek website and cite its URL.",
489
- tools: { web_search: openai.tools.webSearch() },
490
- providerOptions: {
491
- openai: { maxToolCalls: 1 },
492
- nexra: { web_search: { sources: ["search_engine"], max_keyword: 1, limit: 3 } },
493
- },
494
- maxOutputTokens: 512,
495
- maxRetries: 0,
496
- });
497
- console.log(result.text, result.sources);
498
- ```
499
-
500
- `providerOptions.nexra.web_search` preserves native tool fields such as `sources`,
501
- `max_keyword`, `limit`, and `user_location`; it requires the `web_search` tool.
502
- The same options work with `streamText`. Unpositioned native citations become
503
- URL sources; original Native bodies, raw stream events, and
504
- `finalStep.usage.raw.tool_usage_details.web_search` remain available.
505
-
506
- VIP configured search prices (CNY, checked 2026-11-01):
507
-
508
- | Content source | Channel cost / 1,000 uses | Nexra sale / 1,000 uses |
509
- | --- | ---: | ---: |
510
- | `search_engine` (default) | ¥4 | **¥4.4** |
511
- | `toutiao`, `douyin`, `moji` (each additional source) | ¥6 | ¥6.6 |
512
-
513
- A use is an actual upstream content-source search, **not an HTTP request or a
514
- returned result**. Multiple rounds, keywords, or content sources can incur
515
- multiple uses. Token charges are additional, including retrieved context.
516
- Declaring a tool does not itself incur a search fee if the model does not use
517
- it. Preauthorization reserves the configured search ceiling and settles the
518
- actual evidenced usage; set `maxToolCalls` and `max_keyword` to control that
519
- ceiling. Missing search evidence is not treated as free search.
520
-
521
- Current VIP token sale prices per million tokens:
522
-
523
- | Model | Input | Cached input | Output |
524
- | --- | ---: | ---: | ---: |
525
- | DeepSeek V4.1 Flash | ¥2.2 | ¥0.044 | ¥8.8 |
526
- | GLM 5.3 Flash | ¥0.88 | ¥0.253 | ¥3.08 |
527
- | Kimi K3.1 Pro | ¥14.3 | ¥1.43 | ¥74.8 |
528
- | Doubao Seed 2.1 Lite (non-audio input) | ¥0.88 | ¥0.176 | ¥2.97 |
529
-
530
- Seed audio input is ¥13.2/million tokens; cached audio input is ¥2.64/million.
531
- For Ark audio/video prompts in the AI SDK adapter, select
532
- `protocol: "openai-chat-completions"`; its native media parts retain their order. Kimi media requires bytes or Base64
533
- data URLs; the Chat binding derives URL support from the Native schema.
534
- The Responses search example above uses text. Native Responses media fields
535
- remain documented by each model's selected endpoint schema.
536
-
537
- GLM and Kimi K3.1 Pro thinking is always on. Use `reasoning: "low"` for minimum effort;
538
- `reasoning: "none"` fails locally. Native `none`/`minimal` effort aliases do not
539
- mean that these models can turn thinking off. Kimi does not use a `thinking`
540
- parameter. Its Responses endpoint permits `toolChoice: "auto"` (default) or
541
- `"none"`; forcing a particular tool or requiring a tool is rejected before
542
- fetch. With auto selection, search is billed only when actually used.
543
-
544
- These are the configured channel prices;
545
- the SDK does not dynamically apply upstream off-peak discounts. Provider account
546
- free quotas do not automatically make Nexra requests free. The selected plugin
547
- is separate from Doubao Search Custom; no Custom search service is used here.
548
- Always read the selected environment's live catalog prices before estimating
549
- charges. Official references: [online content plugin pricing](https://ark.volcengine.com/region:cn-beijing/docs/online-content-plugin-pricing)
550
- and [model pricing](https://console.volcengine.com/ark/region:cn-beijing/docs/model-pricing).
551
-
552
457
  ## Directory layout
553
458
 
554
459
  ```
package/dist/catalog.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { a as JsonObject } from './json-Cz0MkWQn.js';
2
- import { H as HttpTransport, N as NexraCatalogChangeParams, a as NexraCatalogChangePage, b as NexraCatalogModelState, c as NexraSalePriceList, C as CreateNexraQuoteRequest, d as NexraQuote, e as CreateNexraDisplayQuoteBatchRequest, f as NexraDisplayQuoteBatch, g as NexraCatalogRevision, h as NexraModelSpec, i as NexraModelEndpointSpec, j as NexraModelSpecFilter } from './media-geometry-COln1N_2.js';
3
- export { M as MediaGeometryField, k as MediaGeometryProjection, l as NexraBillingCurrency, m as NexraCatalogModelIdentity, n as NexraModelOperation, o as NexraSalePrice, p as NexraSettlement, U as UnifiedMediaGeometry, q as applyMediaGeometry, r as decodeMediaGeometry, s as encodeMediaGeometry, t as projectMediaGeometry } from './media-geometry-COln1N_2.js';
1
+ import { J as JsonObject } from './json-dnsDzk-s.js';
2
+ import { H as HttpTransport, A as NexraCatalogChangeParams, B as NexraCatalogChangePage, D as NexraCatalogModelState, t as NexraSalePriceList, a as CreateNexraQuoteRequest, r as NexraQuote, C as CreateNexraDisplayQuoteBatchRequest, m as NexraDisplayQuoteBatch, l as NexraCatalogRevision, p as NexraModelSpec, E as NexraModelEndpointSpec, q as NexraModelSpecFilter } from './media-geometry-B92BvuQL.js';
3
+ export { M as MediaGeometryField, b as MediaGeometryProjection, k as NexraBillingCurrency, G as NexraCatalogModelIdentity, o as NexraModelOperation, s as NexraSalePrice, u as NexraSettlement, U as UnifiedMediaGeometry, w as applyMediaGeometry, x as decodeMediaGeometry, y as encodeMediaGeometry, z as projectMediaGeometry } from './media-geometry-B92BvuQL.js';
4
4
 
5
5
  declare function formatModelDisplayName(displayName: string, identity?: {
6
6
  modelId: string;
package/dist/catalog.js CHANGED
@@ -9,8 +9,8 @@ import {
9
9
  listModelSpecs,
10
10
  projectMediaGeometry,
11
11
  resolveNexraLanguageReasoning
12
- } from "./chunk-V3KBU3J5.js";
13
- import "./chunk-LEZWVFQH.js";
12
+ } from "./chunk-LWJWWD7Z.js";
13
+ import "./chunk-V3F6VPMP.js";
14
14
  export {
15
15
  CatalogClient,
16
16
  applyMediaGeometry,