@juspay/neurolink 7.49.0 → 7.51.0
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 +13 -0
- package/README.md +12 -9
- package/dist/adapters/providerImageAdapter.js +82 -10
- package/dist/agent/directTools.d.ts +10 -10
- package/dist/agent/directTools.js +5 -3
- package/dist/cli/commands/config.js +1 -0
- package/dist/cli/commands/mcp.js +1 -0
- package/dist/cli/commands/models.js +1 -0
- package/dist/cli/commands/ollama.js +1 -0
- package/dist/cli/commands/setup-anthropic.js +1 -0
- package/dist/cli/commands/setup-azure.js +1 -0
- package/dist/cli/commands/setup-bedrock.js +1 -0
- package/dist/cli/commands/setup-gcp.js +1 -0
- package/dist/cli/commands/setup-google-ai.js +1 -0
- package/dist/cli/commands/setup-huggingface.js +1 -0
- package/dist/cli/commands/setup-mistral.js +1 -0
- package/dist/cli/commands/setup-openai.js +1 -0
- package/dist/cli/commands/setup.js +1 -0
- package/dist/cli/errorHandler.js +1 -0
- package/dist/cli/factories/commandFactory.d.ts +5 -0
- package/dist/cli/factories/commandFactory.js +42 -6
- package/dist/cli/factories/ollamaCommandFactory.js +1 -0
- package/dist/cli/factories/sagemakerCommandFactory.js +1 -0
- package/dist/cli/factories/setupCommandFactory.js +1 -0
- package/dist/cli/index.js +14 -2
- package/dist/cli/loop/conversationSelector.js +1 -0
- package/dist/cli/loop/optionsSchema.js +1 -0
- package/dist/cli/loop/session.js +1 -0
- package/dist/cli/parser.js +1 -0
- package/dist/cli/utils/completeSetup.js +1 -0
- package/dist/cli/utils/envManager.js +1 -0
- package/dist/cli/utils/interactiveSetup.js +1 -0
- package/dist/cli/utils/ollamaUtils.js +1 -0
- package/dist/constants/index.js +1 -1
- package/dist/core/baseProvider.d.ts +14 -0
- package/dist/core/baseProvider.js +106 -23
- package/dist/index.d.ts +11 -5
- package/dist/index.js +11 -10
- package/dist/lib/adapters/providerImageAdapter.js +83 -10
- package/dist/lib/agent/directTools.d.ts +10 -10
- package/dist/lib/agent/directTools.js +6 -3
- package/dist/lib/config/configManager.js +1 -0
- package/dist/lib/config/conversationMemory.js +1 -0
- package/dist/lib/config/taskClassificationConfig.js +1 -0
- package/dist/lib/constants/index.js +2 -1
- package/dist/lib/constants/performance.js +1 -0
- package/dist/lib/constants/retry.js +1 -0
- package/dist/lib/constants/timeouts.js +1 -0
- package/dist/lib/constants/tokens.js +1 -0
- package/dist/lib/core/analytics.js +1 -0
- package/dist/lib/core/baseProvider.d.ts +14 -0
- package/dist/lib/core/baseProvider.js +107 -23
- package/dist/lib/core/constants.js +1 -0
- package/dist/lib/core/conversationMemoryFactory.js +1 -0
- package/dist/lib/core/conversationMemoryInitializer.js +1 -0
- package/dist/lib/core/conversationMemoryManager.js +1 -0
- package/dist/lib/core/dynamicModels.js +1 -0
- package/dist/lib/core/evaluation.js +1 -0
- package/dist/lib/core/evaluationProviders.js +1 -0
- package/dist/lib/core/factory.js +1 -0
- package/dist/lib/core/modelConfiguration.js +1 -0
- package/dist/lib/core/redisConversationMemoryManager.js +1 -0
- package/dist/lib/core/serviceRegistry.js +1 -0
- package/dist/lib/core/streamAnalytics.js +1 -0
- package/dist/lib/evaluation/contextBuilder.js +1 -0
- package/dist/lib/evaluation/index.js +1 -0
- package/dist/lib/evaluation/prompts.js +1 -0
- package/dist/lib/evaluation/ragasEvaluator.js +1 -0
- package/dist/lib/evaluation/retryManager.js +1 -0
- package/dist/lib/evaluation/scoring.js +1 -0
- package/dist/lib/factories/providerFactory.js +1 -0
- package/dist/lib/factories/providerRegistry.js +1 -0
- package/dist/lib/hitl/hitlErrors.js +1 -0
- package/dist/lib/hitl/hitlManager.js +1 -0
- package/dist/lib/hitl/index.js +1 -0
- package/dist/lib/hitl/types.js +1 -0
- package/dist/lib/index.d.ts +11 -5
- package/dist/lib/index.js +12 -10
- package/dist/lib/mcp/externalServerManager.js +1 -0
- package/dist/lib/mcp/factory.js +1 -0
- package/dist/lib/mcp/flexibleToolValidator.js +1 -0
- package/dist/lib/mcp/index.js +1 -0
- package/dist/lib/mcp/mcpCircuitBreaker.js +1 -0
- package/dist/lib/mcp/mcpClientFactory.js +2 -1
- package/dist/lib/mcp/registry.js +1 -0
- package/dist/lib/mcp/servers/agent/directToolsServer.js +2 -0
- package/dist/lib/mcp/servers/aiProviders/aiAnalysisTools.js +1 -0
- package/dist/lib/mcp/servers/aiProviders/aiCoreServer.js +1 -0
- package/dist/lib/mcp/servers/aiProviders/aiWorkflowTools.js +1 -0
- package/dist/lib/mcp/servers/utilities/utilityServer.js +1 -0
- package/dist/lib/mcp/toolDiscoveryService.js +1 -0
- package/dist/lib/mcp/toolRegistry.js +1 -0
- package/dist/lib/memory/mem0Initializer.js +1 -0
- package/dist/lib/middleware/builtin/analytics.js +1 -0
- package/dist/lib/middleware/builtin/autoEvaluation.js +1 -0
- package/dist/lib/middleware/builtin/guardrails.js +1 -0
- package/dist/lib/middleware/factory.js +1 -0
- package/dist/lib/middleware/index.js +1 -0
- package/dist/lib/middleware/registry.js +1 -0
- package/dist/lib/middleware/utils/guardrailsUtils.js +1 -0
- package/dist/lib/models/modelRegistry.js +1 -0
- package/dist/lib/models/modelResolver.js +2 -0
- package/dist/lib/neurolink.d.ts +41 -6
- package/dist/lib/neurolink.js +276 -5
- package/dist/lib/providers/amazonBedrock.d.ts +1 -0
- package/dist/lib/providers/amazonBedrock.js +166 -14
- package/dist/lib/providers/amazonSagemaker.js +1 -0
- package/dist/lib/providers/anthropic.js +8 -21
- package/dist/lib/providers/anthropicBaseProvider.js +1 -0
- package/dist/lib/providers/azureOpenai.js +6 -21
- package/dist/lib/providers/googleAiStudio.js +6 -21
- package/dist/lib/providers/googleVertex.js +9 -1
- package/dist/lib/providers/huggingFace.js +34 -3
- package/dist/lib/providers/index.js +1 -0
- package/dist/lib/providers/litellm.js +34 -3
- package/dist/lib/providers/mistral.js +32 -2
- package/dist/lib/providers/ollama.d.ts +37 -1
- package/dist/lib/providers/ollama.js +544 -58
- package/dist/lib/providers/openAI.js +6 -21
- package/dist/lib/providers/openaiCompatible.js +41 -4
- package/dist/lib/providers/sagemaker/adaptive-semaphore.js +1 -0
- package/dist/lib/providers/sagemaker/client.js +1 -0
- package/dist/lib/providers/sagemaker/config.js +1 -0
- package/dist/lib/providers/sagemaker/detection.js +1 -0
- package/dist/lib/providers/sagemaker/diagnostics.js +1 -0
- package/dist/lib/providers/sagemaker/error-constants.js +1 -0
- package/dist/lib/providers/sagemaker/errors.js +1 -0
- package/dist/lib/providers/sagemaker/index.js +1 -0
- package/dist/lib/providers/sagemaker/language-model.js +1 -0
- package/dist/lib/providers/sagemaker/parsers.js +1 -0
- package/dist/lib/providers/sagemaker/streaming.js +1 -0
- package/dist/lib/providers/sagemaker/structured-parser.js +1 -0
- package/dist/lib/proxy/awsProxyIntegration.js +1 -0
- package/dist/lib/proxy/proxyFetch.js +1 -0
- package/dist/lib/proxy/utils/noProxyUtils.js +1 -0
- package/dist/lib/sdk/toolRegistration.js +2 -0
- package/dist/lib/services/server/ai/observability/instrumentation.d.ts +57 -0
- package/dist/lib/services/server/ai/observability/instrumentation.js +171 -0
- package/dist/lib/session/globalSessionState.js +38 -1
- package/dist/lib/telemetry/index.d.ts +1 -0
- package/dist/lib/telemetry/index.js +1 -0
- package/dist/lib/telemetry/telemetryService.d.ts +2 -0
- package/dist/lib/telemetry/telemetryService.js +8 -7
- package/dist/lib/types/analytics.js +1 -0
- package/dist/lib/types/cli.js +1 -0
- package/dist/lib/types/common.js +1 -0
- package/dist/lib/types/configTypes.js +1 -0
- package/dist/lib/types/content.d.ts +14 -1
- package/dist/lib/types/content.js +1 -0
- package/dist/lib/types/contextTypes.js +1 -0
- package/dist/lib/types/conversation.d.ts +2 -0
- package/dist/lib/types/conversation.js +1 -0
- package/dist/lib/types/domainTypes.js +1 -0
- package/dist/lib/types/errors.js +1 -0
- package/dist/lib/types/evaluation.js +1 -0
- package/dist/lib/types/evaluationProviders.js +1 -0
- package/dist/lib/types/evaluationTypes.js +1 -0
- package/dist/lib/types/externalMcp.js +1 -0
- package/dist/lib/types/fileTypes.d.ts +44 -0
- package/dist/lib/types/fileTypes.js +1 -0
- package/dist/lib/types/generateTypes.d.ts +1 -0
- package/dist/lib/types/generateTypes.js +1 -0
- package/dist/lib/types/guardrails.js +1 -0
- package/dist/lib/types/index.js +1 -0
- package/dist/lib/types/mcpTypes.js +1 -0
- package/dist/lib/types/middlewareTypes.js +1 -0
- package/dist/lib/types/modelTypes.d.ts +6 -6
- package/dist/lib/types/modelTypes.js +1 -0
- package/dist/lib/types/observability.d.ts +49 -0
- package/dist/lib/types/observability.js +7 -0
- package/dist/lib/types/providers.d.ts +44 -0
- package/dist/lib/types/providers.js +1 -0
- package/dist/lib/types/sdkTypes.js +1 -0
- package/dist/lib/types/serviceTypes.js +1 -0
- package/dist/lib/types/streamTypes.d.ts +1 -0
- package/dist/lib/types/streamTypes.js +1 -0
- package/dist/lib/types/taskClassificationTypes.js +1 -0
- package/dist/lib/types/tools.js +2 -0
- package/dist/lib/types/typeAliases.js +1 -0
- package/dist/lib/types/universalProviderOptions.js +1 -0
- package/dist/lib/utils/analyticsUtils.js +1 -0
- package/dist/lib/utils/conversationMemory.js +1 -0
- package/dist/lib/utils/conversationMemoryUtils.js +1 -0
- package/dist/lib/utils/csvProcessor.js +1 -0
- package/dist/lib/utils/errorHandling.js +1 -0
- package/dist/lib/utils/evaluationUtils.js +1 -0
- package/dist/lib/utils/factoryProcessing.js +1 -0
- package/dist/lib/utils/fileDetector.js +7 -3
- package/dist/lib/utils/imageProcessor.js +1 -0
- package/dist/lib/utils/logger.js +1 -0
- package/dist/lib/utils/loopUtils.js +1 -0
- package/dist/lib/utils/mcpDefaults.js +1 -0
- package/dist/lib/utils/messageBuilder.js +96 -9
- package/dist/lib/utils/modelRouter.js +1 -0
- package/dist/lib/utils/multimodalOptionsBuilder.d.ts +67 -0
- package/dist/lib/utils/multimodalOptionsBuilder.js +65 -0
- package/dist/lib/utils/optionsConversion.js +1 -0
- package/dist/lib/utils/optionsUtils.js +1 -0
- package/dist/lib/utils/parameterValidation.js +1 -0
- package/dist/lib/utils/pdfProcessor.d.ts +10 -0
- package/dist/lib/utils/pdfProcessor.js +199 -0
- package/dist/lib/utils/performance.js +1 -0
- package/dist/lib/utils/promptRedaction.js +1 -0
- package/dist/lib/utils/providerConfig.js +1 -0
- package/dist/lib/utils/providerHealth.js +1 -0
- package/dist/lib/utils/providerSetupMessages.js +1 -0
- package/dist/lib/utils/providerUtils.js +1 -0
- package/dist/lib/utils/redis.js +1 -0
- package/dist/lib/utils/retryHandler.js +1 -0
- package/dist/lib/utils/schemaConversion.js +1 -0
- package/dist/lib/utils/taskClassificationUtils.js +1 -0
- package/dist/lib/utils/taskClassifier.js +1 -0
- package/dist/lib/utils/timeout.js +1 -0
- package/dist/lib/utils/tokenLimits.js +1 -0
- package/dist/lib/utils/toolUtils.js +1 -0
- package/dist/lib/utils/transformationUtils.js +1 -0
- package/dist/lib/utils/typeUtils.js +1 -0
- package/dist/mcp/mcpClientFactory.js +1 -1
- package/dist/mcp/servers/agent/directToolsServer.js +1 -0
- package/dist/models/modelResolver.js +1 -0
- package/dist/neurolink.d.ts +41 -6
- package/dist/neurolink.js +275 -5
- package/dist/providers/amazonBedrock.d.ts +1 -0
- package/dist/providers/amazonBedrock.js +165 -14
- package/dist/providers/anthropic.js +7 -21
- package/dist/providers/azureOpenai.js +5 -21
- package/dist/providers/googleAiStudio.js +5 -21
- package/dist/providers/googleVertex.js +8 -1
- package/dist/providers/huggingFace.js +33 -3
- package/dist/providers/litellm.js +33 -3
- package/dist/providers/mistral.js +31 -2
- package/dist/providers/ollama.d.ts +37 -1
- package/dist/providers/ollama.js +543 -58
- package/dist/providers/openAI.js +5 -21
- package/dist/providers/openaiCompatible.js +40 -4
- package/dist/sdk/toolRegistration.js +1 -0
- package/dist/services/server/ai/observability/instrumentation.d.ts +57 -0
- package/dist/services/server/ai/observability/instrumentation.js +170 -0
- package/dist/session/globalSessionState.js +37 -1
- package/dist/telemetry/index.d.ts +1 -0
- package/dist/telemetry/telemetryService.d.ts +2 -0
- package/dist/telemetry/telemetryService.js +7 -7
- package/dist/types/content.d.ts +14 -1
- package/dist/types/conversation.d.ts +2 -0
- package/dist/types/fileTypes.d.ts +44 -0
- package/dist/types/generateTypes.d.ts +1 -0
- package/dist/types/observability.d.ts +49 -0
- package/dist/types/observability.js +6 -0
- package/dist/types/providers.d.ts +44 -0
- package/dist/types/streamTypes.d.ts +1 -0
- package/dist/types/tools.js +1 -0
- package/dist/utils/fileDetector.js +6 -3
- package/dist/utils/messageBuilder.js +95 -9
- package/dist/utils/multimodalOptionsBuilder.d.ts +67 -0
- package/dist/utils/multimodalOptionsBuilder.js +64 -0
- package/dist/utils/pdfProcessor.d.ts +10 -0
- package/dist/utils/pdfProcessor.js +198 -0
- package/package.json +12 -16
|
@@ -39,10 +39,23 @@ export type CSVContent = {
|
|
|
39
39
|
description?: string;
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
|
+
/**
|
|
43
|
+
* PDF document content type for multimodal messages
|
|
44
|
+
*/
|
|
45
|
+
export type PDFContent = {
|
|
46
|
+
type: "pdf";
|
|
47
|
+
data: Buffer | string;
|
|
48
|
+
metadata?: {
|
|
49
|
+
filename?: string;
|
|
50
|
+
pages?: number;
|
|
51
|
+
version?: string;
|
|
52
|
+
description?: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
42
55
|
/**
|
|
43
56
|
* Union type for all content types
|
|
44
57
|
*/
|
|
45
|
-
export type Content = TextContent | ImageContent | CSVContent;
|
|
58
|
+
export type Content = TextContent | ImageContent | CSVContent | PDFContent;
|
|
46
59
|
/**
|
|
47
60
|
* Vision capability information for providers
|
|
48
61
|
*/
|
|
@@ -157,6 +157,8 @@ export interface NeurolinkOptions {
|
|
|
157
157
|
conversationMemory?: ConversationMemoryConfig;
|
|
158
158
|
/** Session identifier for conversation context */
|
|
159
159
|
sessionId?: string;
|
|
160
|
+
/** Observability configuration */
|
|
161
|
+
observability?: import("./observability.js").ObservabilityConfig;
|
|
160
162
|
}
|
|
161
163
|
/**
|
|
162
164
|
* Session identifier for Redis storage operations
|
package/dist/lib/types/errors.js
CHANGED
|
@@ -43,6 +43,10 @@ export type FileProcessingResult = {
|
|
|
43
43
|
columnNames?: string[];
|
|
44
44
|
sampleData?: string;
|
|
45
45
|
hasEmptyColumns?: boolean;
|
|
46
|
+
version?: string;
|
|
47
|
+
estimatedPages?: number | null;
|
|
48
|
+
provider?: string;
|
|
49
|
+
apiType?: PDFAPIType;
|
|
46
50
|
};
|
|
47
51
|
};
|
|
48
52
|
/**
|
|
@@ -53,6 +57,29 @@ export type CSVProcessorOptions = {
|
|
|
53
57
|
formatStyle?: "raw" | "markdown" | "json";
|
|
54
58
|
includeHeaders?: boolean;
|
|
55
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* PDF API types for different providers
|
|
62
|
+
*/
|
|
63
|
+
export type PDFAPIType = "document" | "files-api" | "unsupported";
|
|
64
|
+
/**
|
|
65
|
+
* PDF provider configuration
|
|
66
|
+
*/
|
|
67
|
+
export interface PDFProviderConfig {
|
|
68
|
+
maxSizeMB: number;
|
|
69
|
+
maxPages: number;
|
|
70
|
+
supportsNative: boolean;
|
|
71
|
+
requiresCitations: boolean | "auto";
|
|
72
|
+
apiType: PDFAPIType;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* PDF processor options
|
|
76
|
+
*/
|
|
77
|
+
export type PDFProcessorOptions = {
|
|
78
|
+
provider?: string;
|
|
79
|
+
model?: string;
|
|
80
|
+
maxSizeMB?: number;
|
|
81
|
+
bedrockApiMode?: "converse" | "invokeModel";
|
|
82
|
+
};
|
|
56
83
|
/**
|
|
57
84
|
* File detector options
|
|
58
85
|
*/
|
|
@@ -62,4 +89,21 @@ export type FileDetectorOptions = {
|
|
|
62
89
|
allowedTypes?: FileType[];
|
|
63
90
|
csvOptions?: CSVProcessorOptions;
|
|
64
91
|
confidenceThreshold?: number;
|
|
92
|
+
provider?: string;
|
|
65
93
|
};
|
|
94
|
+
/**
|
|
95
|
+
* Google AI Studio Files API types
|
|
96
|
+
*/
|
|
97
|
+
export interface GoogleFilesAPIUploadResult {
|
|
98
|
+
file: {
|
|
99
|
+
name: string;
|
|
100
|
+
displayName: string;
|
|
101
|
+
mimeType: string;
|
|
102
|
+
sizeBytes: string;
|
|
103
|
+
createTime: string;
|
|
104
|
+
updateTime: string;
|
|
105
|
+
expirationTime: string;
|
|
106
|
+
sha256Hash: string;
|
|
107
|
+
uri: string;
|
|
108
|
+
};
|
|
109
|
+
}
|
package/dist/lib/types/index.js
CHANGED
|
@@ -87,8 +87,8 @@ export declare const ModelConfigSchema: z.ZodObject<{
|
|
|
87
87
|
releaseDate: z.ZodString;
|
|
88
88
|
}, "strip", z.ZodTypeAny, {
|
|
89
89
|
id: string;
|
|
90
|
-
capabilities: string[];
|
|
91
90
|
displayName: string;
|
|
91
|
+
capabilities: string[];
|
|
92
92
|
deprecated: boolean;
|
|
93
93
|
pricing: {
|
|
94
94
|
input: number;
|
|
@@ -98,8 +98,8 @@ export declare const ModelConfigSchema: z.ZodObject<{
|
|
|
98
98
|
releaseDate: string;
|
|
99
99
|
}, {
|
|
100
100
|
id: string;
|
|
101
|
-
capabilities: string[];
|
|
102
101
|
displayName: string;
|
|
102
|
+
capabilities: string[];
|
|
103
103
|
deprecated: boolean;
|
|
104
104
|
pricing: {
|
|
105
105
|
input: number;
|
|
@@ -133,8 +133,8 @@ export declare const ModelRegistrySchema: z.ZodObject<{
|
|
|
133
133
|
releaseDate: z.ZodString;
|
|
134
134
|
}, "strip", z.ZodTypeAny, {
|
|
135
135
|
id: string;
|
|
136
|
-
capabilities: string[];
|
|
137
136
|
displayName: string;
|
|
137
|
+
capabilities: string[];
|
|
138
138
|
deprecated: boolean;
|
|
139
139
|
pricing: {
|
|
140
140
|
input: number;
|
|
@@ -144,8 +144,8 @@ export declare const ModelRegistrySchema: z.ZodObject<{
|
|
|
144
144
|
releaseDate: string;
|
|
145
145
|
}, {
|
|
146
146
|
id: string;
|
|
147
|
-
capabilities: string[];
|
|
148
147
|
displayName: string;
|
|
148
|
+
capabilities: string[];
|
|
149
149
|
deprecated: boolean;
|
|
150
150
|
pricing: {
|
|
151
151
|
input: number;
|
|
@@ -160,8 +160,8 @@ export declare const ModelRegistrySchema: z.ZodObject<{
|
|
|
160
160
|
version: string;
|
|
161
161
|
models: Record<string, Record<string, {
|
|
162
162
|
id: string;
|
|
163
|
-
capabilities: string[];
|
|
164
163
|
displayName: string;
|
|
164
|
+
capabilities: string[];
|
|
165
165
|
deprecated: boolean;
|
|
166
166
|
pricing: {
|
|
167
167
|
input: number;
|
|
@@ -177,8 +177,8 @@ export declare const ModelRegistrySchema: z.ZodObject<{
|
|
|
177
177
|
version: string;
|
|
178
178
|
models: Record<string, Record<string, {
|
|
179
179
|
id: string;
|
|
180
|
-
capabilities: string[];
|
|
181
180
|
displayName: string;
|
|
181
|
+
capabilities: string[];
|
|
182
182
|
deprecated: boolean;
|
|
183
183
|
pricing: {
|
|
184
184
|
input: number;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Observability Configuration Types
|
|
3
|
+
* These configs are passed from the parent application (e.g., Lighthouse)
|
|
4
|
+
* to enable telemetry and observability features in Neurolink SDK
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Langfuse observability configuration
|
|
8
|
+
*/
|
|
9
|
+
export interface LangfuseConfig {
|
|
10
|
+
/** Whether Langfuse is enabled */
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
/** Langfuse public key */
|
|
13
|
+
publicKey: string;
|
|
14
|
+
/**
|
|
15
|
+
* Langfuse secret key
|
|
16
|
+
* @sensitive
|
|
17
|
+
* WARNING: This is a sensitive credential. Handle securely.
|
|
18
|
+
* Do NOT log, expose, or share this key. Follow best practices for secret management.
|
|
19
|
+
*/
|
|
20
|
+
secretKey: string;
|
|
21
|
+
/** Langfuse base URL (default: https://cloud.langfuse.com) */
|
|
22
|
+
baseUrl?: string;
|
|
23
|
+
/** Environment name (e.g., dev, staging, prod) */
|
|
24
|
+
environment?: string;
|
|
25
|
+
/** Release/version identifier */
|
|
26
|
+
release?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* OpenTelemetry configuration
|
|
30
|
+
*/
|
|
31
|
+
export interface OpenTelemetryConfig {
|
|
32
|
+
/** Whether OpenTelemetry is enabled */
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
/** OTLP endpoint URL */
|
|
35
|
+
endpoint?: string;
|
|
36
|
+
/** Service name for traces */
|
|
37
|
+
serviceName?: string;
|
|
38
|
+
/** Service version */
|
|
39
|
+
serviceVersion?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Complete observability configuration for Neurolink SDK
|
|
43
|
+
*/
|
|
44
|
+
export interface ObservabilityConfig {
|
|
45
|
+
/** Langfuse configuration */
|
|
46
|
+
langfuse?: LangfuseConfig;
|
|
47
|
+
/** OpenTelemetry configuration */
|
|
48
|
+
openTelemetry?: OpenTelemetryConfig;
|
|
49
|
+
}
|
|
@@ -441,6 +441,19 @@ export type BedrockToolResult = {
|
|
|
441
441
|
*/
|
|
442
442
|
export type BedrockContentBlock = {
|
|
443
443
|
text?: string;
|
|
444
|
+
image?: {
|
|
445
|
+
format: "png" | "jpeg" | "gif" | "webp";
|
|
446
|
+
source: {
|
|
447
|
+
bytes?: Uint8Array | Buffer;
|
|
448
|
+
};
|
|
449
|
+
};
|
|
450
|
+
document?: {
|
|
451
|
+
format: "pdf" | "csv" | "doc" | "docx" | "xls" | "xlsx" | "html" | "txt" | "md";
|
|
452
|
+
name: string;
|
|
453
|
+
source: {
|
|
454
|
+
bytes?: Uint8Array | Buffer;
|
|
455
|
+
};
|
|
456
|
+
};
|
|
444
457
|
toolUse?: BedrockToolUse;
|
|
445
458
|
toolResult?: BedrockToolResult;
|
|
446
459
|
};
|
|
@@ -555,6 +568,37 @@ export type ModelsResponse = {
|
|
|
555
568
|
owned_by?: string;
|
|
556
569
|
}>;
|
|
557
570
|
};
|
|
571
|
+
/**
|
|
572
|
+
* Ollama tool call structure
|
|
573
|
+
*/
|
|
574
|
+
export type OllamaToolCall = {
|
|
575
|
+
id: string;
|
|
576
|
+
type: "function";
|
|
577
|
+
function: {
|
|
578
|
+
name: string;
|
|
579
|
+
arguments: string;
|
|
580
|
+
};
|
|
581
|
+
};
|
|
582
|
+
/**
|
|
583
|
+
* Ollama tool result structure
|
|
584
|
+
*/
|
|
585
|
+
export type OllamaToolResult = {
|
|
586
|
+
tool_call_id: string;
|
|
587
|
+
content: string;
|
|
588
|
+
};
|
|
589
|
+
/**
|
|
590
|
+
* Ollama message structure for conversation and tool execution
|
|
591
|
+
*/
|
|
592
|
+
export type OllamaMessage = {
|
|
593
|
+
role: "system" | "user" | "assistant" | "tool";
|
|
594
|
+
content: string | Array<{
|
|
595
|
+
type: string;
|
|
596
|
+
text?: string;
|
|
597
|
+
[key: string]: unknown;
|
|
598
|
+
}>;
|
|
599
|
+
tool_calls?: OllamaToolCall[];
|
|
600
|
+
images?: string[];
|
|
601
|
+
};
|
|
558
602
|
/**
|
|
559
603
|
* Default model aliases for easy reference
|
|
560
604
|
*/
|
|
@@ -126,6 +126,7 @@ export interface StreamOptions {
|
|
|
126
126
|
audio?: AudioInputSpec;
|
|
127
127
|
images?: Array<Buffer | string>;
|
|
128
128
|
csvFiles?: Array<Buffer | string>;
|
|
129
|
+
pdfFiles?: Array<Buffer | string>;
|
|
129
130
|
files?: Array<Buffer | string>;
|
|
130
131
|
content?: Array<TextContent | ImageContent>;
|
|
131
132
|
};
|
package/dist/lib/types/tools.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Type definitions for NeuroLink tool system, including parameter schemas,
|
|
3
3
|
* argument patterns, execution metadata, context, and result types.
|
|
4
4
|
*/
|
|
5
|
+
import { z } from "zod";
|
|
5
6
|
/**
|
|
6
7
|
* Type guard for tool result
|
|
7
8
|
*/
|
|
@@ -22,3 +23,4 @@ export function isToolDefinition(value) {
|
|
|
22
23
|
typeof value.description === "string" &&
|
|
23
24
|
typeof value.execute === "function");
|
|
24
25
|
}
|
|
26
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -8,6 +8,7 @@ import { readFile, stat } from "fs/promises";
|
|
|
8
8
|
import { logger } from "./logger.js";
|
|
9
9
|
import { CSVProcessor } from "./csvProcessor.js";
|
|
10
10
|
import { ImageProcessor } from "./imageProcessor.js";
|
|
11
|
+
import { PDFProcessor } from "./pdfProcessor.js";
|
|
11
12
|
/**
|
|
12
13
|
* Format file size in human-readable units
|
|
13
14
|
*/
|
|
@@ -56,7 +57,7 @@ export class FileDetector {
|
|
|
56
57
|
const content = await this.loadContent(input, detection, options);
|
|
57
58
|
// Extract CSV-specific options from FileDetectorOptions
|
|
58
59
|
const csvOptions = options?.csvOptions;
|
|
59
|
-
return await this.processFile(content, detection, csvOptions);
|
|
60
|
+
return await this.processFile(content, detection, csvOptions, options?.provider);
|
|
60
61
|
}
|
|
61
62
|
/**
|
|
62
63
|
* Detect file type using multi-strategy approach
|
|
@@ -119,12 +120,14 @@ export class FileDetector {
|
|
|
119
120
|
/**
|
|
120
121
|
* Route to appropriate processor
|
|
121
122
|
*/
|
|
122
|
-
static async processFile(content, detection, options) {
|
|
123
|
+
static async processFile(content, detection, options, provider) {
|
|
123
124
|
switch (detection.type) {
|
|
124
125
|
case "csv":
|
|
125
126
|
return await CSVProcessor.process(content, options);
|
|
126
127
|
case "image":
|
|
127
128
|
return await ImageProcessor.process(content);
|
|
129
|
+
case "pdf":
|
|
130
|
+
return await PDFProcessor.process(content, { provider });
|
|
128
131
|
case "text":
|
|
129
132
|
return {
|
|
130
133
|
type: "text",
|
|
@@ -354,7 +357,7 @@ class ExtensionStrategy {
|
|
|
354
357
|
mimeType: this.getMimeType(ext),
|
|
355
358
|
extension: ext,
|
|
356
359
|
source: this.detectSource(input),
|
|
357
|
-
metadata: { confidence: type ?
|
|
360
|
+
metadata: { confidence: type ? 85 : 0 },
|
|
358
361
|
};
|
|
359
362
|
}
|
|
360
363
|
getExtension(input) {
|
|
@@ -455,3 +458,4 @@ class ContentHeuristicStrategy {
|
|
|
455
458
|
};
|
|
456
459
|
}
|
|
457
460
|
}
|
|
461
|
+
//# sourceMappingURL=fileDetector.js.map
|
package/dist/lib/utils/logger.js
CHANGED