@juspay/neurolink 8.4.1 → 8.5.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 +12 -0
- package/dist/adapters/providerImageAdapter.js +56 -9
- package/dist/config/conversationMemory.d.ts +6 -0
- package/dist/config/conversationMemory.js +14 -0
- package/dist/constants/enums.d.ts +23 -3
- package/dist/constants/enums.js +30 -4
- package/dist/constants/tokens.d.ts +27 -12
- package/dist/constants/tokens.js +46 -12
- package/dist/core/modules/GenerationHandler.js +20 -5
- package/dist/core/modules/MessageBuilder.js +4 -0
- package/dist/lib/adapters/providerImageAdapter.js +56 -9
- package/dist/lib/config/conversationMemory.d.ts +6 -0
- package/dist/lib/config/conversationMemory.js +14 -0
- package/dist/lib/constants/enums.d.ts +23 -3
- package/dist/lib/constants/enums.js +30 -4
- package/dist/lib/constants/tokens.d.ts +27 -12
- package/dist/lib/constants/tokens.js +46 -12
- package/dist/lib/core/modules/GenerationHandler.js +20 -5
- package/dist/lib/core/modules/MessageBuilder.js +4 -0
- package/dist/lib/models/modelRegistry.js +93 -0
- package/dist/lib/providers/googleAiStudio.d.ts +27 -0
- package/dist/lib/providers/googleAiStudio.js +27 -0
- package/dist/lib/providers/googleVertex.d.ts +35 -0
- package/dist/lib/providers/googleVertex.js +38 -0
- package/dist/lib/types/fileTypes.d.ts +18 -1
- package/dist/lib/types/generateTypes.d.ts +49 -0
- package/dist/lib/utils/messageBuilder.js +18 -1
- package/dist/models/modelRegistry.js +93 -0
- package/dist/providers/googleAiStudio.d.ts +27 -0
- package/dist/providers/googleAiStudio.js +27 -0
- package/dist/providers/googleVertex.d.ts +35 -0
- package/dist/providers/googleVertex.js +38 -0
- package/dist/types/fileTypes.d.ts +18 -1
- package/dist/types/generateTypes.d.ts +49 -0
- package/dist/utils/messageBuilder.js +18 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Centralized logic for building message arrays from TextGenerationOptions
|
|
4
4
|
* Enhanced with multimodal support for images
|
|
5
5
|
*/
|
|
6
|
-
import { CONVERSATION_INSTRUCTIONS } from "../config/conversationMemory.js";
|
|
6
|
+
import { CONVERSATION_INSTRUCTIONS, STRUCTURED_OUTPUT_INSTRUCTIONS, } from "../config/conversationMemory.js";
|
|
7
7
|
import { ProviderImageAdapter, MultimodalLogger, } from "../adapters/providerImageAdapter.js";
|
|
8
8
|
import { logger } from "./logger.js";
|
|
9
9
|
import { FileDetector } from "./fileDetector.js";
|
|
@@ -199,6 +199,15 @@ function formatCSVMetadata(metadata) {
|
|
|
199
199
|
}
|
|
200
200
|
return parts.length > 0 ? `**Metadata**: ${parts.join(" | ")}` : "";
|
|
201
201
|
}
|
|
202
|
+
/**
|
|
203
|
+
* Check if structured output mode should be enabled
|
|
204
|
+
* Structured output is used when a schema is provided with json/structured format
|
|
205
|
+
*/
|
|
206
|
+
function shouldUseStructuredOutput(options) {
|
|
207
|
+
return (!!options.schema &&
|
|
208
|
+
(options.output?.format === "json" ||
|
|
209
|
+
options.output?.format === "structured"));
|
|
210
|
+
}
|
|
202
211
|
/**
|
|
203
212
|
* Build a properly formatted message array for AI providers
|
|
204
213
|
* Combines system prompt, conversation history, and current user prompt
|
|
@@ -215,6 +224,10 @@ export async function buildMessagesArray(options) {
|
|
|
215
224
|
if (hasConversationHistory) {
|
|
216
225
|
systemPrompt = `${systemPrompt.trim()}${CONVERSATION_INSTRUCTIONS}`;
|
|
217
226
|
}
|
|
227
|
+
// Add structured output instructions when schema is provided with json/structured format
|
|
228
|
+
if (shouldUseStructuredOutput(options)) {
|
|
229
|
+
systemPrompt = `${systemPrompt.trim()}${STRUCTURED_OUTPUT_INSTRUCTIONS}`;
|
|
230
|
+
}
|
|
218
231
|
// Add system message if we have one
|
|
219
232
|
if (systemPrompt.trim()) {
|
|
220
233
|
messages.push({
|
|
@@ -473,6 +486,10 @@ export async function buildMultimodalMessagesArray(options, provider, model) {
|
|
|
473
486
|
if (hasConversationHistory) {
|
|
474
487
|
systemPrompt = `${systemPrompt.trim()}${CONVERSATION_INSTRUCTIONS}`;
|
|
475
488
|
}
|
|
489
|
+
// Add structured output instructions when schema is provided with json/structured format
|
|
490
|
+
if (shouldUseStructuredOutput(options)) {
|
|
491
|
+
systemPrompt = `${systemPrompt.trim()}${STRUCTURED_OUTPUT_INSTRUCTIONS}`;
|
|
492
|
+
}
|
|
476
493
|
// Add file handling guidance when multimodal files are present
|
|
477
494
|
const hasCSVFiles = (options.input.csvFiles && options.input.csvFiles.length > 0) ||
|
|
478
495
|
(options.input.files &&
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.5.1",
|
|
4
4
|
"description": "Universal AI Development Platform with working MCP integration, multi-provider support, and professional CLI. Built-in tools operational, 58+ external MCP servers discoverable. Connect to filesystem, GitHub, database operations, and more. Build, test, and deploy AI applications with 9 major providers: OpenAI, Anthropic, Google AI, AWS Bedrock, Azure, Hugging Face, Ollama, and Mistral AI.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Juspay Technologies",
|