@juspay/neurolink 8.26.0 → 8.26.1
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 +6 -0
- package/README.md +47 -25
- package/dist/adapters/providerImageAdapter.js +11 -0
- package/dist/cli/commands/config.js +16 -23
- package/dist/cli/commands/setup-anthropic.js +3 -26
- package/dist/cli/commands/setup-azure.js +3 -22
- package/dist/cli/commands/setup-bedrock.js +3 -26
- package/dist/cli/commands/setup-google-ai.js +3 -22
- package/dist/cli/commands/setup-mistral.js +3 -31
- package/dist/cli/commands/setup-openai.js +3 -22
- package/dist/cli/factories/commandFactory.js +32 -0
- package/dist/cli/factories/ollamaCommandFactory.js +5 -17
- package/dist/cli/loop/optionsSchema.d.ts +1 -1
- package/dist/cli/loop/optionsSchema.js +13 -0
- package/dist/config/modelSpecificPrompts.d.ts +9 -0
- package/dist/config/modelSpecificPrompts.js +38 -0
- package/dist/constants/enums.d.ts +8 -0
- package/dist/constants/enums.js +8 -0
- package/dist/constants/tokens.d.ts +25 -0
- package/dist/constants/tokens.js +18 -0
- package/dist/core/analytics.js +7 -28
- package/dist/core/baseProvider.js +1 -0
- package/dist/core/constants.d.ts +1 -0
- package/dist/core/constants.js +1 -0
- package/dist/core/modules/GenerationHandler.js +43 -5
- package/dist/core/streamAnalytics.d.ts +1 -0
- package/dist/core/streamAnalytics.js +8 -16
- package/dist/lib/adapters/providerImageAdapter.js +11 -0
- package/dist/lib/config/modelSpecificPrompts.d.ts +9 -0
- package/dist/lib/config/modelSpecificPrompts.js +39 -0
- package/dist/lib/constants/enums.d.ts +8 -0
- package/dist/lib/constants/enums.js +8 -0
- package/dist/lib/constants/tokens.d.ts +25 -0
- package/dist/lib/constants/tokens.js +18 -0
- package/dist/lib/core/analytics.js +7 -28
- package/dist/lib/core/baseProvider.js +1 -0
- package/dist/lib/core/constants.d.ts +1 -0
- package/dist/lib/core/constants.js +1 -0
- package/dist/lib/core/modules/GenerationHandler.js +43 -5
- package/dist/lib/core/streamAnalytics.d.ts +1 -0
- package/dist/lib/core/streamAnalytics.js +8 -16
- package/dist/lib/providers/googleAiStudio.d.ts +15 -0
- package/dist/lib/providers/googleAiStudio.js +659 -3
- package/dist/lib/providers/googleVertex.d.ts +25 -0
- package/dist/lib/providers/googleVertex.js +978 -3
- package/dist/lib/types/analytics.d.ts +4 -0
- package/dist/lib/types/cli.d.ts +16 -0
- package/dist/lib/types/conversation.d.ts +72 -4
- package/dist/lib/types/conversation.js +30 -0
- package/dist/lib/types/generateTypes.d.ts +135 -0
- package/dist/lib/types/groundingTypes.d.ts +231 -0
- package/dist/lib/types/groundingTypes.js +12 -0
- package/dist/lib/types/providers.d.ts +29 -0
- package/dist/lib/types/streamTypes.d.ts +54 -0
- package/dist/lib/utils/analyticsUtils.js +22 -2
- package/dist/lib/utils/modelChoices.d.ts +82 -0
- package/dist/lib/utils/modelChoices.js +402 -0
- package/dist/lib/utils/modelDetection.d.ts +9 -0
- package/dist/lib/utils/modelDetection.js +81 -0
- package/dist/lib/utils/schemaConversion.d.ts +12 -0
- package/dist/lib/utils/schemaConversion.js +90 -0
- package/dist/lib/utils/thinkingConfig.d.ts +108 -0
- package/dist/lib/utils/thinkingConfig.js +105 -0
- package/dist/lib/utils/tokenUtils.d.ts +124 -0
- package/dist/lib/utils/tokenUtils.js +240 -0
- package/dist/lib/utils/transformationUtils.js +15 -26
- package/dist/providers/googleAiStudio.d.ts +15 -0
- package/dist/providers/googleAiStudio.js +659 -3
- package/dist/providers/googleVertex.d.ts +25 -0
- package/dist/providers/googleVertex.js +978 -3
- package/dist/types/analytics.d.ts +4 -0
- package/dist/types/cli.d.ts +16 -0
- package/dist/types/conversation.d.ts +72 -4
- package/dist/types/conversation.js +30 -0
- package/dist/types/generateTypes.d.ts +135 -0
- package/dist/types/groundingTypes.d.ts +231 -0
- package/dist/types/groundingTypes.js +11 -0
- package/dist/types/providers.d.ts +29 -0
- package/dist/types/streamTypes.d.ts +54 -0
- package/dist/utils/analyticsUtils.js +22 -2
- package/dist/utils/modelChoices.d.ts +82 -0
- package/dist/utils/modelChoices.js +401 -0
- package/dist/utils/modelDetection.d.ts +9 -0
- package/dist/utils/modelDetection.js +80 -0
- package/dist/utils/schemaConversion.d.ts +12 -0
- package/dist/utils/schemaConversion.js +90 -0
- package/dist/utils/thinkingConfig.d.ts +108 -0
- package/dist/utils/thinkingConfig.js +104 -0
- package/dist/utils/tokenUtils.d.ts +124 -0
- package/dist/utils/tokenUtils.js +239 -0
- package/dist/utils/transformationUtils.js +15 -26
- package/package.json +4 -3
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Centralizes repeated object transformation patterns to improve code reuse and maintainability
|
|
4
4
|
*/
|
|
5
5
|
import { logger } from "./logger.js";
|
|
6
|
+
import { inlineJsonSchema } from "./schemaConversion.js";
|
|
6
7
|
// ============================================================================
|
|
7
8
|
// TOOL EXECUTION TRANSFORMATIONS
|
|
8
9
|
// ============================================================================
|
|
@@ -262,42 +263,30 @@ export function transformAvailableTools(availableTools) {
|
|
|
262
263
|
const directParameters = toolRecord.parameters;
|
|
263
264
|
const fallbackSchema = toolRecord.schema;
|
|
264
265
|
if (inputSchema && typeof inputSchema === "object") {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
if (typeof refValue === "string") {
|
|
269
|
-
const refKey = refValue.replace("#/definitions/", "");
|
|
270
|
-
if (definitions[refKey] && typeof definitions[refKey] === "object") {
|
|
271
|
-
const resolvedSchema = definitions[refKey];
|
|
272
|
-
extractedParameters = {
|
|
273
|
-
type: resolvedSchema.type || "object",
|
|
274
|
-
properties: resolvedSchema.properties || {},
|
|
275
|
-
required: resolvedSchema.required || [],
|
|
276
|
-
...resolvedSchema, // Include all schema metadata
|
|
277
|
-
};
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
else if (inputSchema.properties) {
|
|
266
|
+
// Use shared inlineJsonSchema for recursive $ref resolution
|
|
267
|
+
const inlinedSchema = inlineJsonSchema(inputSchema);
|
|
268
|
+
if (inlinedSchema.properties) {
|
|
282
269
|
extractedParameters = {
|
|
283
|
-
type:
|
|
284
|
-
properties:
|
|
285
|
-
required:
|
|
286
|
-
...
|
|
270
|
+
type: inlinedSchema.type || "object",
|
|
271
|
+
properties: inlinedSchema.properties,
|
|
272
|
+
required: inlinedSchema.required || [],
|
|
273
|
+
...inlinedSchema,
|
|
287
274
|
};
|
|
288
275
|
}
|
|
289
|
-
else if (
|
|
290
|
-
extractedParameters =
|
|
276
|
+
else if (inlinedSchema.type === "object") {
|
|
277
|
+
extractedParameters = inlinedSchema;
|
|
291
278
|
}
|
|
292
279
|
else {
|
|
293
|
-
extractedParameters =
|
|
280
|
+
extractedParameters = inlinedSchema;
|
|
294
281
|
}
|
|
295
282
|
}
|
|
296
283
|
else if (directParameters && typeof directParameters === "object") {
|
|
297
|
-
|
|
284
|
+
// Also inline $ref for direct parameters if present
|
|
285
|
+
extractedParameters = inlineJsonSchema(directParameters);
|
|
298
286
|
}
|
|
299
287
|
else if (fallbackSchema && typeof fallbackSchema === "object") {
|
|
300
|
-
|
|
288
|
+
// Also inline $ref for fallback schema if present
|
|
289
|
+
extractedParameters = inlineJsonSchema(fallbackSchema);
|
|
301
290
|
}
|
|
302
291
|
if (!extractedParameters || typeof extractedParameters !== "object") {
|
|
303
292
|
extractedParameters = {};
|
|
@@ -2,6 +2,7 @@ import { type Schema, type LanguageModelV1 } from "ai";
|
|
|
2
2
|
import type { ZodUnknownSchema } from "../types/typeAliases.js";
|
|
3
3
|
import { AIProviderName } from "../constants/enums.js";
|
|
4
4
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
|
+
import type { TextGenerationOptions, EnhancedGenerateResult } from "../types/generateTypes.js";
|
|
5
6
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
7
|
/**
|
|
7
8
|
* Google AI Studio provider implementation using BaseProvider
|
|
@@ -44,6 +45,20 @@ export declare class GoogleAIStudioProvider extends BaseProvider {
|
|
|
44
45
|
getAISDKModel(): LanguageModelV1;
|
|
45
46
|
handleProviderError(error: unknown): Error;
|
|
46
47
|
protected executeStream(options: StreamOptions, _analysisSchema?: ZodUnknownSchema | Schema<unknown>): Promise<StreamResult>;
|
|
48
|
+
/**
|
|
49
|
+
* Execute stream using native @google/genai SDK for Gemini 3 models
|
|
50
|
+
* This bypasses @ai-sdk/google to properly handle thought_signature
|
|
51
|
+
*/
|
|
52
|
+
private executeNativeGemini3Stream;
|
|
53
|
+
/**
|
|
54
|
+
* Execute generate using native @google/genai SDK for Gemini 3 models
|
|
55
|
+
* This bypasses @ai-sdk/google to properly handle thought_signature
|
|
56
|
+
*/
|
|
57
|
+
private executeNativeGemini3Generate;
|
|
58
|
+
/**
|
|
59
|
+
* Override generate to route Gemini 3 models with tools to native SDK
|
|
60
|
+
*/
|
|
61
|
+
generate(optionsOrPrompt: TextGenerationOptions | string): Promise<EnhancedGenerateResult | null>;
|
|
47
62
|
private executeAudioStreamViaGeminiLive;
|
|
48
63
|
private getApiKey;
|
|
49
64
|
}
|