@juspay/neurolink 12.25.2 → 12.25.3
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
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
## [12.25.
|
|
1
|
+
## [12.25.3](https://github.com/juspay/neurolink/compare/v12.25.2...v12.25.3) (2026-09-26)
|
|
2
2
|
|
|
3
3
|
### Bug Fixes
|
|
4
4
|
|
|
5
|
-
- **(
|
|
5
|
+
- **(audio):** make supportsNativeAudio model-aware for Claude-on-Vertex ([527a7f7](https://github.com/juspay/neurolink/commit/527a7f739b74adc077a5d47306a76ca9a4f1da1f))
|
|
6
6
|
|
|
7
7
|
## [11.2.3](https://github.com/juspay/neurolink/compare/v11.2.2...v11.2.3) (2026-08-19)
|
|
8
8
|
|
|
@@ -32,8 +32,19 @@
|
|
|
32
32
|
* @module adapters/audioFormatSupport
|
|
33
33
|
*/
|
|
34
34
|
import type { AudioConversionResult } from "../types/index.js";
|
|
35
|
-
/**
|
|
36
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Whether `provider` can be handed raw audio bytes.
|
|
37
|
+
*
|
|
38
|
+
* `model` is optional and only consulted for the Vertex aliases, which serve
|
|
39
|
+
* both Gemini (native audio) and Claude (no native audio — routed to
|
|
40
|
+
* `@anthropic-ai/vertex-sdk`, whose message builder never reads an audio
|
|
41
|
+
* part). The Claude test is the one `GoogleVertexProvider` routes by
|
|
42
|
+
* (`isAnthropicModel` in providers/googleVertex/client.ts: case-insensitive,
|
|
43
|
+
* anywhere in the id). A stricter test here would call a model Gemini that
|
|
44
|
+
* Vertex actually sends to Claude. A caller that omits `model` on Vertex keeps
|
|
45
|
+
* today's behaviour. AI Studio / bare "gemini" aliases never serve Claude.
|
|
46
|
+
*/
|
|
47
|
+
export declare function supportsNativeAudio(provider: string, model?: string): boolean;
|
|
37
48
|
/** Whether `mimeType` must be re-encoded before a native provider will read it. */
|
|
38
49
|
export declare function needsAudioTranscode(mimeType: string): boolean;
|
|
39
50
|
/**
|
|
@@ -61,6 +61,20 @@ const NATIVE_AUDIO_PROVIDERS = new Set([
|
|
|
61
61
|
"googleai",
|
|
62
62
|
"gemini",
|
|
63
63
|
]);
|
|
64
|
+
/**
|
|
65
|
+
* The Vertex-family aliases within {@link NATIVE_AUDIO_PROVIDERS}.
|
|
66
|
+
*
|
|
67
|
+
* Vertex is a front end for two unrelated model families: Gemini, which
|
|
68
|
+
* accepts inline audio, and Claude (routed to `@anthropic-ai/vertex-sdk`),
|
|
69
|
+
* which does not. The provider name alone cannot tell them apart, so these
|
|
70
|
+
* aliases get an extra model check in {@link supportsNativeAudio}; the
|
|
71
|
+
* AI-Studio/Gemini aliases never serve Claude and skip it.
|
|
72
|
+
*/
|
|
73
|
+
const VERTEX_PROVIDER_NAMES = new Set([
|
|
74
|
+
"vertex",
|
|
75
|
+
"google-vertex",
|
|
76
|
+
"googlevertex",
|
|
77
|
+
]);
|
|
64
78
|
/**
|
|
65
79
|
* Audio MIME types the native providers accept as-is.
|
|
66
80
|
*
|
|
@@ -83,9 +97,27 @@ const NATIVE_AUDIO_MIME_TYPES = new Set([
|
|
|
83
97
|
]);
|
|
84
98
|
/** MIME type every transcode targets. Universally accepted and compact. */
|
|
85
99
|
const TRANSCODE_TARGET_MIME = "audio/mpeg";
|
|
86
|
-
/**
|
|
87
|
-
|
|
88
|
-
|
|
100
|
+
/**
|
|
101
|
+
* Whether `provider` can be handed raw audio bytes.
|
|
102
|
+
*
|
|
103
|
+
* `model` is optional and only consulted for the Vertex aliases, which serve
|
|
104
|
+
* both Gemini (native audio) and Claude (no native audio — routed to
|
|
105
|
+
* `@anthropic-ai/vertex-sdk`, whose message builder never reads an audio
|
|
106
|
+
* part). The Claude test is the one `GoogleVertexProvider` routes by
|
|
107
|
+
* (`isAnthropicModel` in providers/googleVertex/client.ts: case-insensitive,
|
|
108
|
+
* anywhere in the id). A stricter test here would call a model Gemini that
|
|
109
|
+
* Vertex actually sends to Claude. A caller that omits `model` on Vertex keeps
|
|
110
|
+
* today's behaviour. AI Studio / bare "gemini" aliases never serve Claude.
|
|
111
|
+
*/
|
|
112
|
+
export function supportsNativeAudio(provider, model) {
|
|
113
|
+
const normalizedProvider = provider.toLowerCase().trim();
|
|
114
|
+
if (!NATIVE_AUDIO_PROVIDERS.has(normalizedProvider)) {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
if (VERTEX_PROVIDER_NAMES.has(normalizedProvider)) {
|
|
118
|
+
return !(model ?? "").toLowerCase().includes("claude");
|
|
119
|
+
}
|
|
120
|
+
return true;
|
|
89
121
|
}
|
|
90
122
|
/** Whether `mimeType` must be re-encoded before a native provider will read it. */
|
|
91
123
|
export function needsAudioTranscode(mimeType) {
|