@juspay/neurolink 7.33.0 → 7.33.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 +2 -0
- package/dist/agent/directTools.d.ts +6 -6
- package/dist/cli/commands/config.d.ts +68 -68
- package/dist/cli/utils/interactiveSetup.d.ts +1 -1
- package/dist/cli/utils/interactiveSetup.js +1 -1
- package/dist/core/analytics.d.ts +1 -2
- package/dist/core/baseProvider.d.ts +1 -1
- package/dist/core/baseProvider.js +1 -0
- package/dist/core/dynamicModels.d.ts +1 -132
- package/dist/core/dynamicModels.js +0 -7
- package/dist/core/evaluation.d.ts +1 -39
- package/dist/core/evaluationProviders.d.ts +1 -17
- package/dist/core/evaluationProviders.js +1 -1
- package/dist/core/factory.d.ts +1 -3
- package/dist/core/factory.js +0 -1
- package/dist/core/modelConfiguration.d.ts +8 -69
- package/dist/core/modelConfiguration.js +11 -11
- package/dist/core/serviceRegistry.d.ts +1 -8
- package/dist/core/streamAnalytics.d.ts +2 -45
- package/dist/factories/providerFactory.d.ts +1 -1
- package/dist/factories/providerRegistry.js +1 -1
- package/dist/index.d.ts +8 -9
- package/dist/index.js +1 -1
- package/dist/lib/core/analytics.d.ts +1 -2
- package/dist/lib/core/baseProvider.d.ts +1 -1
- package/dist/lib/core/baseProvider.js +1 -0
- package/dist/lib/core/dynamicModels.d.ts +1 -132
- package/dist/lib/core/dynamicModels.js +0 -7
- package/dist/lib/core/evaluation.d.ts +1 -39
- package/dist/lib/core/evaluationProviders.d.ts +1 -17
- package/dist/lib/core/evaluationProviders.js +1 -1
- package/dist/lib/core/factory.d.ts +1 -3
- package/dist/lib/core/factory.js +0 -1
- package/dist/lib/core/modelConfiguration.d.ts +8 -69
- package/dist/lib/core/modelConfiguration.js +11 -11
- package/dist/lib/core/serviceRegistry.d.ts +1 -8
- package/dist/lib/core/streamAnalytics.d.ts +2 -45
- package/dist/lib/factories/providerFactory.d.ts +1 -1
- package/dist/lib/factories/providerRegistry.js +1 -1
- package/dist/lib/index.d.ts +5 -6
- package/dist/lib/index.js +1 -1
- package/dist/lib/models/modelRegistry.d.ts +1 -1
- package/dist/lib/models/modelRegistry.js +1 -1
- package/dist/lib/models/modelResolver.d.ts +1 -1
- package/dist/lib/neurolink.d.ts +1 -1
- package/dist/lib/neurolink.js +1 -1
- package/dist/lib/providers/amazonBedrock.d.ts +1 -2
- package/dist/lib/providers/amazonSagemaker.d.ts +1 -1
- package/dist/lib/providers/anthropic.d.ts +1 -1
- package/dist/lib/providers/anthropic.js +1 -1
- package/dist/lib/providers/anthropicBaseProvider.d.ts +1 -1
- package/dist/lib/providers/anthropicBaseProvider.js +1 -1
- package/dist/lib/providers/azureOpenai.d.ts +1 -1
- package/dist/lib/providers/googleAiStudio.d.ts +1 -1
- package/dist/lib/providers/googleAiStudio.js +1 -1
- package/dist/lib/providers/googleVertex.d.ts +1 -1
- package/dist/lib/providers/googleVertex.js +1 -1
- package/dist/lib/providers/huggingFace.d.ts +1 -1
- package/dist/lib/providers/index.d.ts +1 -1
- package/dist/lib/providers/litellm.d.ts +1 -1
- package/dist/lib/providers/mistral.d.ts +1 -1
- package/dist/lib/providers/ollama.d.ts +1 -1
- package/dist/lib/providers/ollama.js +1 -1
- package/dist/lib/providers/openAI.d.ts +1 -1
- package/dist/lib/providers/openAI.js +1 -1
- package/dist/lib/providers/openaiCompatible.d.ts +1 -1
- package/dist/lib/providers/sagemaker/language-model.d.ts +2 -2
- package/dist/lib/types/analytics.d.ts +53 -0
- package/dist/lib/types/analytics.js +5 -0
- package/dist/lib/types/cli.d.ts +1 -1
- package/dist/lib/types/evaluation.d.ts +119 -0
- package/dist/lib/types/evaluation.js +5 -0
- package/dist/lib/types/evaluationProviders.d.ts +104 -0
- package/dist/lib/types/evaluationProviders.js +5 -0
- package/dist/lib/types/generateTypes.d.ts +89 -18
- package/dist/lib/types/index.d.ts +10 -2
- package/dist/lib/types/index.js +12 -0
- package/dist/lib/types/modelTypes.d.ts +242 -0
- package/dist/lib/types/modelTypes.js +30 -0
- package/dist/lib/types/providers.d.ts +193 -127
- package/dist/lib/types/providers.js +110 -18
- package/dist/lib/types/serviceTypes.d.ts +79 -0
- package/dist/lib/types/serviceTypes.js +5 -0
- package/dist/lib/types/streamTypes.d.ts +101 -21
- package/dist/lib/utils/analyticsUtils.d.ts +5 -1
- package/dist/lib/utils/analyticsUtils.js +13 -0
- package/dist/lib/utils/conversationMemoryUtils.d.ts +1 -1
- package/dist/lib/utils/evaluationUtils.d.ts +1 -1
- package/dist/lib/utils/factoryProcessing.d.ts +1 -1
- package/dist/lib/utils/messageBuilder.d.ts +1 -1
- package/dist/lib/utils/providerHealth.d.ts +1 -1
- package/dist/lib/utils/providerHealth.js +1 -1
- package/dist/lib/utils/providerUtils.d.ts +5 -0
- package/dist/lib/utils/providerUtils.js +6 -0
- package/dist/models/modelRegistry.d.ts +1 -1
- package/dist/models/modelRegistry.js +1 -1
- package/dist/models/modelResolver.d.ts +1 -1
- package/dist/neurolink.d.ts +1 -1
- package/dist/neurolink.js +1 -1
- package/dist/providers/amazonBedrock.d.ts +1 -2
- package/dist/providers/amazonSagemaker.d.ts +1 -1
- package/dist/providers/anthropic.d.ts +1 -1
- package/dist/providers/anthropic.js +1 -1
- package/dist/providers/anthropicBaseProvider.d.ts +1 -1
- package/dist/providers/anthropicBaseProvider.js +1 -1
- package/dist/providers/azureOpenai.d.ts +1 -1
- package/dist/providers/googleAiStudio.d.ts +1 -1
- package/dist/providers/googleAiStudio.js +1 -1
- package/dist/providers/googleVertex.d.ts +1 -1
- package/dist/providers/googleVertex.js +1 -1
- package/dist/providers/huggingFace.d.ts +1 -1
- package/dist/providers/index.d.ts +1 -1
- package/dist/providers/litellm.d.ts +1 -1
- package/dist/providers/mistral.d.ts +1 -1
- package/dist/providers/ollama.d.ts +1 -1
- package/dist/providers/ollama.js +1 -1
- package/dist/providers/openAI.d.ts +1 -1
- package/dist/providers/openAI.js +1 -1
- package/dist/providers/openaiCompatible.d.ts +1 -1
- package/dist/types/analytics.d.ts +53 -0
- package/dist/types/analytics.js +5 -0
- package/dist/types/cli.d.ts +1 -1
- package/dist/types/evaluation.d.ts +119 -0
- package/dist/types/evaluation.js +5 -0
- package/dist/types/evaluationProviders.d.ts +104 -0
- package/dist/types/evaluationProviders.js +5 -0
- package/dist/types/generateTypes.d.ts +89 -18
- package/dist/types/index.d.ts +10 -2
- package/dist/types/index.js +12 -0
- package/dist/types/modelTypes.d.ts +242 -0
- package/dist/types/modelTypes.js +30 -0
- package/dist/types/providers.d.ts +193 -127
- package/dist/types/providers.js +110 -18
- package/dist/types/serviceTypes.d.ts +79 -0
- package/dist/types/serviceTypes.js +5 -0
- package/dist/types/streamTypes.d.ts +101 -21
- package/dist/utils/analyticsUtils.d.ts +5 -1
- package/dist/utils/analyticsUtils.js +13 -0
- package/dist/utils/conversationMemoryUtils.d.ts +1 -1
- package/dist/utils/evaluationUtils.d.ts +1 -1
- package/dist/utils/factoryProcessing.d.ts +1 -1
- package/dist/utils/messageBuilder.d.ts +1 -1
- package/dist/utils/providerHealth.d.ts +1 -1
- package/dist/utils/providerHealth.js +1 -1
- package/dist/utils/providerUtils.d.ts +5 -0
- package/dist/utils/providerUtils.js +6 -0
- package/package.json +1 -1
- package/dist/core/types.d.ts +0 -223
- package/dist/core/types.js +0 -111
- package/dist/lib/core/types.d.ts +0 -223
- package/dist/lib/core/types.js +0 -111
|
@@ -2,45 +2,115 @@
|
|
|
2
2
|
* Provider-specific type definitions for NeuroLink
|
|
3
3
|
*/
|
|
4
4
|
import type { UnknownRecord, JsonValue } from "./common.js";
|
|
5
|
+
import type { Tool } from "ai";
|
|
6
|
+
import type { ValidationSchema } from "./typeAliases.js";
|
|
7
|
+
import type { EnhancedGenerateResult, GenerateResult, TextGenerationOptions } from "./generateTypes.js";
|
|
8
|
+
import type { StreamOptions, StreamResult } from "./streamTypes.js";
|
|
9
|
+
import type { ExternalMCPToolInfo } from "./externalMcp.js";
|
|
5
10
|
/**
|
|
6
11
|
* Generic AI SDK model interface
|
|
7
12
|
*/
|
|
8
|
-
export
|
|
13
|
+
export type AISDKModel = {
|
|
9
14
|
[key: string]: unknown;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Supported AI Provider Names
|
|
18
|
+
*/
|
|
19
|
+
export declare enum AIProviderName {
|
|
20
|
+
BEDROCK = "bedrock",
|
|
21
|
+
OPENAI = "openai",
|
|
22
|
+
OPENAI_COMPATIBLE = "openai-compatible",
|
|
23
|
+
VERTEX = "vertex",
|
|
24
|
+
ANTHROPIC = "anthropic",
|
|
25
|
+
AZURE = "azure",
|
|
26
|
+
GOOGLE_AI = "google-ai",
|
|
27
|
+
HUGGINGFACE = "huggingface",
|
|
28
|
+
OLLAMA = "ollama",
|
|
29
|
+
MISTRAL = "mistral",
|
|
30
|
+
LITELLM = "litellm",
|
|
31
|
+
SAGEMAKER = "sagemaker",
|
|
32
|
+
AUTO = "auto"
|
|
10
33
|
}
|
|
11
34
|
/**
|
|
12
|
-
*
|
|
35
|
+
* Supported Models for Amazon Bedrock
|
|
13
36
|
*/
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
37
|
+
export declare enum BedrockModels {
|
|
38
|
+
CLAUDE_3_SONNET = "anthropic.claude-3-sonnet-20240229-v1:0",
|
|
39
|
+
CLAUDE_3_HAIKU = "anthropic.claude-3-haiku-20240307-v1:0",
|
|
40
|
+
CLAUDE_3_5_SONNET = "anthropic.claude-3-5-sonnet-20240620-v1:0",
|
|
41
|
+
CLAUDE_3_7_SONNET = "arn:aws:bedrock:us-east-2:225681119357:inference-profile/us.anthropic.claude-3-7-sonnet-20250219-v1:0"
|
|
19
42
|
}
|
|
20
43
|
/**
|
|
21
|
-
*
|
|
44
|
+
* Supported Models for OpenAI
|
|
22
45
|
*/
|
|
23
|
-
export
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
46
|
+
export declare enum OpenAIModels {
|
|
47
|
+
GPT_4 = "gpt-4",
|
|
48
|
+
GPT_4_TURBO = "gpt-4-turbo",
|
|
49
|
+
GPT_4O = "gpt-4o",
|
|
50
|
+
GPT_4O_MINI = "gpt-4o-mini",
|
|
51
|
+
GPT_3_5_TURBO = "gpt-3.5-turbo"
|
|
27
52
|
}
|
|
28
53
|
/**
|
|
29
|
-
*
|
|
54
|
+
* Supported Models for Google Vertex AI
|
|
30
55
|
*/
|
|
31
|
-
export
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
56
|
+
export declare enum VertexModels {
|
|
57
|
+
CLAUDE_4_0_SONNET = "claude-sonnet-4@20250514",
|
|
58
|
+
CLAUDE_4_0_OPUS = "claude-opus-4@20250514",
|
|
59
|
+
CLAUDE_3_5_SONNET = "claude-3-5-sonnet-20241022",
|
|
60
|
+
CLAUDE_3_5_HAIKU = "claude-3-5-haiku-20241022",
|
|
61
|
+
CLAUDE_3_SONNET = "claude-3-sonnet-20240229",
|
|
62
|
+
CLAUDE_3_OPUS = "claude-3-opus-20240229",
|
|
63
|
+
CLAUDE_3_HAIKU = "claude-3-haiku-20240307",
|
|
64
|
+
GEMINI_2_5_PRO = "gemini-2.5-pro",
|
|
65
|
+
GEMINI_2_5_FLASH = "gemini-2.5-flash",
|
|
66
|
+
GEMINI_2_5_FLASH_LITE = "gemini-2.5-flash-lite",
|
|
67
|
+
GEMINI_2_0_FLASH_001 = "gemini-2.0-flash-001",
|
|
68
|
+
GEMINI_1_5_PRO = "gemini-1.5-pro",
|
|
69
|
+
GEMINI_1_5_FLASH = "gemini-1.5-flash"
|
|
39
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Supported Models for Google AI Studio
|
|
73
|
+
*/
|
|
74
|
+
export declare enum GoogleAIModels {
|
|
75
|
+
GEMINI_2_5_PRO = "gemini-2.5-pro",
|
|
76
|
+
GEMINI_2_5_FLASH = "gemini-2.5-flash",
|
|
77
|
+
GEMINI_2_5_FLASH_LITE = "gemini-2.5-flash-lite",
|
|
78
|
+
GEMINI_2_0_FLASH_001 = "gemini-2.0-flash-001",
|
|
79
|
+
GEMINI_1_5_PRO = "gemini-1.5-pro",
|
|
80
|
+
GEMINI_1_5_FLASH = "gemini-1.5-flash",
|
|
81
|
+
GEMINI_1_5_FLASH_LITE = "gemini-1.5-flash-lite"
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Supported Models for Anthropic (Direct API)
|
|
85
|
+
*/
|
|
86
|
+
export declare enum AnthropicModels {
|
|
87
|
+
CLAUDE_3_5_SONNET = "claude-3-5-sonnet-20241022",
|
|
88
|
+
CLAUDE_3_5_HAIKU = "claude-3-5-haiku-20241022",
|
|
89
|
+
CLAUDE_3_SONNET = "claude-3-sonnet-20240229",
|
|
90
|
+
CLAUDE_3_OPUS = "claude-3-opus-20240229",
|
|
91
|
+
CLAUDE_3_HAIKU = "claude-3-haiku-20240307"
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Union type of all supported model names
|
|
95
|
+
*/
|
|
96
|
+
export type SupportedModelName = BedrockModels | OpenAIModels | VertexModels | GoogleAIModels | AnthropicModels;
|
|
97
|
+
/**
|
|
98
|
+
* Extract provider names from enum
|
|
99
|
+
*/
|
|
100
|
+
export type ProviderName = keyof typeof AIProviderName;
|
|
101
|
+
/**
|
|
102
|
+
* Provider error information
|
|
103
|
+
*/
|
|
104
|
+
export type ProviderError = Error & {
|
|
105
|
+
code?: string | number;
|
|
106
|
+
statusCode?: number;
|
|
107
|
+
provider?: string;
|
|
108
|
+
originalError?: unknown;
|
|
109
|
+
};
|
|
40
110
|
/**
|
|
41
111
|
* AWS Credential Configuration for Bedrock provider
|
|
42
112
|
*/
|
|
43
|
-
export
|
|
113
|
+
export type AWSCredentialConfig = {
|
|
44
114
|
region?: string;
|
|
45
115
|
profile?: string;
|
|
46
116
|
roleArn?: string;
|
|
@@ -53,11 +123,11 @@ export interface AWSCredentialConfig {
|
|
|
53
123
|
enableDebugLogging?: boolean;
|
|
54
124
|
/** Optional service endpoint override (e.g., VPC/Gov endpoints) */
|
|
55
125
|
endpoint?: string;
|
|
56
|
-
}
|
|
126
|
+
};
|
|
57
127
|
/**
|
|
58
128
|
* AWS Credential Validation Result
|
|
59
129
|
*/
|
|
60
|
-
export
|
|
130
|
+
export type CredentialValidationResult = {
|
|
61
131
|
isValid: boolean;
|
|
62
132
|
credentialSource: string;
|
|
63
133
|
region: string;
|
|
@@ -69,17 +139,17 @@ export interface CredentialValidationResult {
|
|
|
69
139
|
hasSessionToken: boolean;
|
|
70
140
|
providerConfig: Readonly<Required<AWSCredentialConfig>>;
|
|
71
141
|
};
|
|
72
|
-
}
|
|
142
|
+
};
|
|
73
143
|
/**
|
|
74
144
|
* Service Connectivity Test Result
|
|
75
145
|
*/
|
|
76
|
-
export
|
|
146
|
+
export type ServiceConnectivityResult = {
|
|
77
147
|
bedrockAccessible: boolean;
|
|
78
148
|
availableModels: number;
|
|
79
149
|
responseTimeMs: number;
|
|
80
150
|
error?: string;
|
|
81
151
|
sampleModels: string[];
|
|
82
|
-
}
|
|
152
|
+
};
|
|
83
153
|
/**
|
|
84
154
|
* Model Capabilities - Maximally Reusable
|
|
85
155
|
*/
|
|
@@ -88,10 +158,18 @@ export type ModelCapability = "text" | "vision" | "function-calling" | "embeddin
|
|
|
88
158
|
* Model Use Cases - High Reusability
|
|
89
159
|
*/
|
|
90
160
|
export type ModelUseCase = "chat" | "completion" | "analysis" | "coding" | "creative" | "reasoning" | "translation" | "summarization" | "classification";
|
|
161
|
+
/**
|
|
162
|
+
* Provider health status
|
|
163
|
+
*/
|
|
164
|
+
export type ProviderHealthStatus = "healthy" | "degraded" | "unhealthy" | "unknown";
|
|
165
|
+
/**
|
|
166
|
+
* Stream processing phases
|
|
167
|
+
*/
|
|
168
|
+
export type StreamPhase = "initializing" | "streaming" | "processing" | "complete" | "error";
|
|
91
169
|
/**
|
|
92
170
|
* Model Filter Configuration - High Reusability
|
|
93
171
|
*/
|
|
94
|
-
export
|
|
172
|
+
export type ModelFilter = {
|
|
95
173
|
provider?: string;
|
|
96
174
|
capability?: ModelCapability;
|
|
97
175
|
useCase?: ModelUseCase;
|
|
@@ -99,11 +177,11 @@ export interface ModelFilter {
|
|
|
99
177
|
requireFunctionCalling?: boolean;
|
|
100
178
|
maxTokens?: number;
|
|
101
179
|
costLimit?: number;
|
|
102
|
-
}
|
|
180
|
+
};
|
|
103
181
|
/**
|
|
104
182
|
* Model Resolution Context - High Reusability
|
|
105
183
|
*/
|
|
106
|
-
export
|
|
184
|
+
export type ModelResolutionContext = {
|
|
107
185
|
requireCapabilities?: ModelCapability[];
|
|
108
186
|
preferredProviders?: string[];
|
|
109
187
|
useCase?: ModelUseCase;
|
|
@@ -115,11 +193,11 @@ export interface ModelResolutionContext {
|
|
|
115
193
|
maxLatency?: number;
|
|
116
194
|
minQuality?: number;
|
|
117
195
|
};
|
|
118
|
-
}
|
|
196
|
+
};
|
|
119
197
|
/**
|
|
120
198
|
* Model Statistics Object - High Reusability
|
|
121
199
|
*/
|
|
122
|
-
export
|
|
200
|
+
export type ModelStats = {
|
|
123
201
|
name: string;
|
|
124
202
|
provider: string;
|
|
125
203
|
capabilities: ModelCapability[];
|
|
@@ -136,11 +214,11 @@ export interface ModelStats {
|
|
|
136
214
|
version?: string;
|
|
137
215
|
lastUpdated?: Date;
|
|
138
216
|
};
|
|
139
|
-
}
|
|
217
|
+
};
|
|
140
218
|
/**
|
|
141
219
|
* Model Pricing Information - High Reusability
|
|
142
220
|
*/
|
|
143
|
-
export
|
|
221
|
+
export type ModelPricing = {
|
|
144
222
|
inputTokens?: {
|
|
145
223
|
price: number;
|
|
146
224
|
currency: string;
|
|
@@ -160,107 +238,67 @@ export interface ModelPricing {
|
|
|
160
238
|
min?: number;
|
|
161
239
|
max?: number;
|
|
162
240
|
free?: boolean;
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Response quality evaluation scores - Comprehensive evaluation interface
|
|
166
|
-
*/
|
|
167
|
-
export interface EvaluationData {
|
|
168
|
-
relevance: number;
|
|
169
|
-
accuracy: number;
|
|
170
|
-
completeness: number;
|
|
171
|
-
overall: number;
|
|
172
|
-
domainAlignment?: number;
|
|
173
|
-
terminologyAccuracy?: number;
|
|
174
|
-
toolEffectiveness?: number;
|
|
175
|
-
isOffTopic: boolean;
|
|
176
|
-
alertSeverity: "low" | "medium" | "high" | "none";
|
|
177
|
-
reasoning: string;
|
|
178
|
-
suggestedImprovements?: string;
|
|
179
|
-
evaluationModel: string;
|
|
180
|
-
evaluationTime: number;
|
|
181
|
-
evaluationDomain?: string;
|
|
182
|
-
evaluationProvider?: string;
|
|
183
|
-
evaluationAttempt?: number;
|
|
184
|
-
evaluationConfig?: {
|
|
185
|
-
mode: string;
|
|
186
|
-
fallbackUsed: boolean;
|
|
187
|
-
costEstimate: number;
|
|
188
|
-
};
|
|
189
|
-
domainConfig?: {
|
|
190
|
-
domainName: string;
|
|
191
|
-
domainDescription: string;
|
|
192
|
-
keyTerms: string[];
|
|
193
|
-
failurePatterns: string[];
|
|
194
|
-
successPatterns: string[];
|
|
195
|
-
evaluationCriteria?: Record<string, unknown>;
|
|
196
|
-
};
|
|
197
|
-
domainEvaluation?: {
|
|
198
|
-
domainRelevance: number;
|
|
199
|
-
terminologyAccuracy: number;
|
|
200
|
-
domainExpertise: number;
|
|
201
|
-
domainSpecificInsights: string[];
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Enhanced evaluation context for comprehensive response assessment
|
|
206
|
-
*/
|
|
207
|
-
export interface EvaluationContext {
|
|
208
|
-
userQuery: string;
|
|
209
|
-
aiResponse: string;
|
|
210
|
-
context?: Record<string, unknown>;
|
|
211
|
-
primaryDomain?: string;
|
|
212
|
-
assistantRole?: string;
|
|
213
|
-
conversationHistory?: Array<{
|
|
214
|
-
role: "user" | "assistant";
|
|
215
|
-
content: string;
|
|
216
|
-
timestamp?: string;
|
|
217
|
-
}>;
|
|
218
|
-
toolUsage?: Array<{
|
|
219
|
-
toolName: string;
|
|
220
|
-
input: unknown;
|
|
221
|
-
output: unknown;
|
|
222
|
-
executionTime: number;
|
|
223
|
-
}>;
|
|
224
|
-
expectedOutcome?: string;
|
|
225
|
-
evaluationCriteria?: string[];
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Evaluation result interface that extends EvaluationData with additional context
|
|
229
|
-
*/
|
|
230
|
-
export interface EvaluationResult extends EvaluationData {
|
|
231
|
-
contextUtilization?: {
|
|
232
|
-
conversationUsed: boolean;
|
|
233
|
-
toolsUsed: boolean;
|
|
234
|
-
domainKnowledgeUsed: boolean;
|
|
235
|
-
};
|
|
236
|
-
evaluationContext?: {
|
|
237
|
-
domain: string;
|
|
238
|
-
toolsEvaluated: string[];
|
|
239
|
-
conversationTurns: number;
|
|
240
|
-
};
|
|
241
|
-
}
|
|
241
|
+
};
|
|
242
242
|
/**
|
|
243
243
|
* Provider capabilities
|
|
244
244
|
*/
|
|
245
|
-
export
|
|
245
|
+
export type ProviderCapabilities = {
|
|
246
246
|
supportsStreaming: boolean;
|
|
247
247
|
supportsTools: boolean;
|
|
248
248
|
supportsImages: boolean;
|
|
249
249
|
supportsAudio: boolean;
|
|
250
250
|
maxTokens?: number;
|
|
251
251
|
supportedModels: string[];
|
|
252
|
-
}
|
|
252
|
+
};
|
|
253
253
|
/**
|
|
254
|
-
* Provider configuration
|
|
254
|
+
* Provider configuration specifying provider and its available models (from core types)
|
|
255
255
|
*/
|
|
256
|
-
export
|
|
256
|
+
export type ProviderConfig = {
|
|
257
|
+
provider: AIProviderName;
|
|
258
|
+
models: SupportedModelName[];
|
|
259
|
+
};
|
|
260
|
+
/**
|
|
261
|
+
* Provider configuration for individual providers
|
|
262
|
+
*/
|
|
263
|
+
export type IndividualProviderConfig = {
|
|
257
264
|
apiKey?: string;
|
|
258
265
|
baseURL?: string;
|
|
259
266
|
timeout?: number;
|
|
260
267
|
retries?: number;
|
|
261
268
|
model?: string;
|
|
262
269
|
[key: string]: unknown;
|
|
263
|
-
}
|
|
270
|
+
};
|
|
271
|
+
/**
|
|
272
|
+
* AI Provider interface with flexible parameter support (converted from interface)
|
|
273
|
+
*/
|
|
274
|
+
export type AIProvider = {
|
|
275
|
+
stream(optionsOrPrompt: StreamOptions | string, analysisSchema?: ValidationSchema): Promise<StreamResult>;
|
|
276
|
+
generate(optionsOrPrompt: TextGenerationOptions | string, analysisSchema?: ValidationSchema): Promise<EnhancedGenerateResult | null>;
|
|
277
|
+
gen(optionsOrPrompt: TextGenerationOptions | string, analysisSchema?: ValidationSchema): Promise<EnhancedGenerateResult | null>;
|
|
278
|
+
setupToolExecutor(sdk: {
|
|
279
|
+
customTools: Map<string, unknown>;
|
|
280
|
+
executeTool: (toolName: string, params: unknown) => Promise<unknown>;
|
|
281
|
+
}, functionTag: string): void;
|
|
282
|
+
};
|
|
283
|
+
/**
|
|
284
|
+
* Provider attempt result for iteration tracking (converted from interface)
|
|
285
|
+
*/
|
|
286
|
+
export type ProviderAttempt = {
|
|
287
|
+
provider: AIProviderName;
|
|
288
|
+
model: SupportedModelName;
|
|
289
|
+
success: boolean;
|
|
290
|
+
error?: string;
|
|
291
|
+
stack?: string;
|
|
292
|
+
};
|
|
293
|
+
/**
|
|
294
|
+
* Error types for provider creation
|
|
295
|
+
*/
|
|
296
|
+
export type ProviderCreationError = {
|
|
297
|
+
code: "INVALID_PROVIDER" | "CONFIGURATION_ERROR" | "INSTANTIATION_ERROR";
|
|
298
|
+
message: string;
|
|
299
|
+
provider: string;
|
|
300
|
+
details?: Record<string, unknown>;
|
|
301
|
+
};
|
|
264
302
|
/**
|
|
265
303
|
* Amazon Bedrock specific types
|
|
266
304
|
*/
|
|
@@ -321,23 +359,51 @@ export type ProviderFactory = (modelName?: string, providerName?: string, sdk?:
|
|
|
321
359
|
/**
|
|
322
360
|
* Provider constructor type
|
|
323
361
|
*/
|
|
324
|
-
export
|
|
362
|
+
export type ProviderConstructor = {
|
|
325
363
|
new (modelName?: string, providerName?: string, sdk?: unknown): unknown;
|
|
326
|
-
}
|
|
364
|
+
};
|
|
327
365
|
/**
|
|
328
366
|
* Provider registration entry
|
|
329
367
|
*/
|
|
330
|
-
export
|
|
368
|
+
export type ProviderRegistration = {
|
|
331
369
|
name: string;
|
|
332
370
|
constructor: ProviderConstructor | ProviderFactory;
|
|
333
371
|
capabilities?: ProviderCapabilities;
|
|
334
|
-
defaultConfig?:
|
|
335
|
-
}
|
|
372
|
+
defaultConfig?: IndividualProviderConfig;
|
|
373
|
+
};
|
|
336
374
|
/**
|
|
337
|
-
*
|
|
375
|
+
* Provider metadata type
|
|
338
376
|
*/
|
|
339
|
-
export
|
|
377
|
+
export type ProviderMetadata = {
|
|
378
|
+
name: string;
|
|
379
|
+
version: string;
|
|
380
|
+
capabilities: ProviderCapability[];
|
|
381
|
+
models: string[];
|
|
382
|
+
healthStatus: ProviderHealthStatus;
|
|
383
|
+
};
|
|
384
|
+
/**
|
|
385
|
+
* Provider capability type
|
|
386
|
+
*/
|
|
387
|
+
export type ProviderCapability = "text-generation" | "streaming" | "tool-calling" | "image-generation" | "embeddings";
|
|
388
|
+
/**
|
|
389
|
+
* Extended tool type that combines AI SDK tools with external MCP tool info
|
|
390
|
+
*/
|
|
391
|
+
export type ExtendedTool = Tool & Partial<ExternalMCPToolInfo>;
|
|
392
|
+
/**
|
|
393
|
+
* AI SDK generate result with steps support (extends GenerateResult)
|
|
394
|
+
*/
|
|
395
|
+
export type AISDKGenerateResult = GenerateResult & {
|
|
396
|
+
steps?: Array<{
|
|
397
|
+
toolCalls?: Array<{
|
|
398
|
+
toolName?: string;
|
|
399
|
+
name?: string;
|
|
400
|
+
[key: string]: unknown;
|
|
401
|
+
}>;
|
|
402
|
+
[key: string]: unknown;
|
|
403
|
+
}>;
|
|
404
|
+
[key: string]: unknown;
|
|
405
|
+
};
|
|
340
406
|
/**
|
|
341
|
-
*
|
|
407
|
+
* Default provider configurations
|
|
342
408
|
*/
|
|
343
|
-
export declare
|
|
409
|
+
export declare const DEFAULT_PROVIDER_CONFIGS: ProviderConfig[];
|
|
@@ -2,21 +2,113 @@
|
|
|
2
2
|
* Provider-specific type definitions for NeuroLink
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
5
|
+
* Supported AI Provider Names
|
|
6
|
+
*/
|
|
7
|
+
export var AIProviderName;
|
|
8
|
+
(function (AIProviderName) {
|
|
9
|
+
AIProviderName["BEDROCK"] = "bedrock";
|
|
10
|
+
AIProviderName["OPENAI"] = "openai";
|
|
11
|
+
AIProviderName["OPENAI_COMPATIBLE"] = "openai-compatible";
|
|
12
|
+
AIProviderName["VERTEX"] = "vertex";
|
|
13
|
+
AIProviderName["ANTHROPIC"] = "anthropic";
|
|
14
|
+
AIProviderName["AZURE"] = "azure";
|
|
15
|
+
AIProviderName["GOOGLE_AI"] = "google-ai";
|
|
16
|
+
AIProviderName["HUGGINGFACE"] = "huggingface";
|
|
17
|
+
AIProviderName["OLLAMA"] = "ollama";
|
|
18
|
+
AIProviderName["MISTRAL"] = "mistral";
|
|
19
|
+
AIProviderName["LITELLM"] = "litellm";
|
|
20
|
+
AIProviderName["SAGEMAKER"] = "sagemaker";
|
|
21
|
+
AIProviderName["AUTO"] = "auto";
|
|
22
|
+
})(AIProviderName || (AIProviderName = {}));
|
|
23
|
+
/**
|
|
24
|
+
* Supported Models for Amazon Bedrock
|
|
25
|
+
*/
|
|
26
|
+
export var BedrockModels;
|
|
27
|
+
(function (BedrockModels) {
|
|
28
|
+
BedrockModels["CLAUDE_3_SONNET"] = "anthropic.claude-3-sonnet-20240229-v1:0";
|
|
29
|
+
BedrockModels["CLAUDE_3_HAIKU"] = "anthropic.claude-3-haiku-20240307-v1:0";
|
|
30
|
+
BedrockModels["CLAUDE_3_5_SONNET"] = "anthropic.claude-3-5-sonnet-20240620-v1:0";
|
|
31
|
+
BedrockModels["CLAUDE_3_7_SONNET"] = "arn:aws:bedrock:us-east-2:225681119357:inference-profile/us.anthropic.claude-3-7-sonnet-20250219-v1:0";
|
|
32
|
+
})(BedrockModels || (BedrockModels = {}));
|
|
33
|
+
/**
|
|
34
|
+
* Supported Models for OpenAI
|
|
35
|
+
*/
|
|
36
|
+
export var OpenAIModels;
|
|
37
|
+
(function (OpenAIModels) {
|
|
38
|
+
OpenAIModels["GPT_4"] = "gpt-4";
|
|
39
|
+
OpenAIModels["GPT_4_TURBO"] = "gpt-4-turbo";
|
|
40
|
+
OpenAIModels["GPT_4O"] = "gpt-4o";
|
|
41
|
+
OpenAIModels["GPT_4O_MINI"] = "gpt-4o-mini";
|
|
42
|
+
OpenAIModels["GPT_3_5_TURBO"] = "gpt-3.5-turbo";
|
|
43
|
+
})(OpenAIModels || (OpenAIModels = {}));
|
|
44
|
+
/**
|
|
45
|
+
* Supported Models for Google Vertex AI
|
|
46
|
+
*/
|
|
47
|
+
export var VertexModels;
|
|
48
|
+
(function (VertexModels) {
|
|
49
|
+
// Claude 4 Series (Latest - May 2025)
|
|
50
|
+
VertexModels["CLAUDE_4_0_SONNET"] = "claude-sonnet-4@20250514";
|
|
51
|
+
VertexModels["CLAUDE_4_0_OPUS"] = "claude-opus-4@20250514";
|
|
52
|
+
// Claude 3.5 Series (Still supported)
|
|
53
|
+
VertexModels["CLAUDE_3_5_SONNET"] = "claude-3-5-sonnet-20241022";
|
|
54
|
+
VertexModels["CLAUDE_3_5_HAIKU"] = "claude-3-5-haiku-20241022";
|
|
55
|
+
// Claude 3 Series (Legacy support)
|
|
56
|
+
VertexModels["CLAUDE_3_SONNET"] = "claude-3-sonnet-20240229";
|
|
57
|
+
VertexModels["CLAUDE_3_OPUS"] = "claude-3-opus-20240229";
|
|
58
|
+
VertexModels["CLAUDE_3_HAIKU"] = "claude-3-haiku-20240307";
|
|
59
|
+
// Gemini 2.5 Series (Latest - 2025)
|
|
60
|
+
VertexModels["GEMINI_2_5_PRO"] = "gemini-2.5-pro";
|
|
61
|
+
VertexModels["GEMINI_2_5_FLASH"] = "gemini-2.5-flash";
|
|
62
|
+
VertexModels["GEMINI_2_5_FLASH_LITE"] = "gemini-2.5-flash-lite";
|
|
63
|
+
// Gemini 2.0 Series
|
|
64
|
+
VertexModels["GEMINI_2_0_FLASH_001"] = "gemini-2.0-flash-001";
|
|
65
|
+
// Gemini 1.5 Series (Legacy support)
|
|
66
|
+
VertexModels["GEMINI_1_5_PRO"] = "gemini-1.5-pro";
|
|
67
|
+
VertexModels["GEMINI_1_5_FLASH"] = "gemini-1.5-flash";
|
|
68
|
+
})(VertexModels || (VertexModels = {}));
|
|
69
|
+
/**
|
|
70
|
+
* Supported Models for Google AI Studio
|
|
71
|
+
*/
|
|
72
|
+
export var GoogleAIModels;
|
|
73
|
+
(function (GoogleAIModels) {
|
|
74
|
+
// Gemini 2.5 Series (Latest - 2025)
|
|
75
|
+
GoogleAIModels["GEMINI_2_5_PRO"] = "gemini-2.5-pro";
|
|
76
|
+
GoogleAIModels["GEMINI_2_5_FLASH"] = "gemini-2.5-flash";
|
|
77
|
+
GoogleAIModels["GEMINI_2_5_FLASH_LITE"] = "gemini-2.5-flash-lite";
|
|
78
|
+
// Gemini 2.0 Series
|
|
79
|
+
GoogleAIModels["GEMINI_2_0_FLASH_001"] = "gemini-2.0-flash-001";
|
|
80
|
+
// Gemini 1.5 Series (Legacy support)
|
|
81
|
+
GoogleAIModels["GEMINI_1_5_PRO"] = "gemini-1.5-pro";
|
|
82
|
+
GoogleAIModels["GEMINI_1_5_FLASH"] = "gemini-1.5-flash";
|
|
83
|
+
GoogleAIModels["GEMINI_1_5_FLASH_LITE"] = "gemini-1.5-flash-lite";
|
|
84
|
+
})(GoogleAIModels || (GoogleAIModels = {}));
|
|
85
|
+
/**
|
|
86
|
+
* Supported Models for Anthropic (Direct API)
|
|
87
|
+
*/
|
|
88
|
+
export var AnthropicModels;
|
|
89
|
+
(function (AnthropicModels) {
|
|
90
|
+
// Claude 3.5 Series (Latest)
|
|
91
|
+
AnthropicModels["CLAUDE_3_5_SONNET"] = "claude-3-5-sonnet-20241022";
|
|
92
|
+
AnthropicModels["CLAUDE_3_5_HAIKU"] = "claude-3-5-haiku-20241022";
|
|
93
|
+
// Claude 3 Series (Legacy support)
|
|
94
|
+
AnthropicModels["CLAUDE_3_SONNET"] = "claude-3-sonnet-20240229";
|
|
95
|
+
AnthropicModels["CLAUDE_3_OPUS"] = "claude-3-opus-20240229";
|
|
96
|
+
AnthropicModels["CLAUDE_3_HAIKU"] = "claude-3-haiku-20240307";
|
|
97
|
+
})(AnthropicModels || (AnthropicModels = {}));
|
|
98
|
+
/**
|
|
99
|
+
* Default provider configurations
|
|
100
|
+
*/
|
|
101
|
+
export const DEFAULT_PROVIDER_CONFIGS = [
|
|
102
|
+
{
|
|
103
|
+
provider: AIProviderName.BEDROCK,
|
|
104
|
+
models: [BedrockModels.CLAUDE_3_7_SONNET, BedrockModels.CLAUDE_3_5_SONNET],
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
provider: AIProviderName.VERTEX,
|
|
108
|
+
models: [VertexModels.CLAUDE_4_0_SONNET, VertexModels.GEMINI_2_5_FLASH],
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
provider: AIProviderName.OPENAI,
|
|
112
|
+
models: [OpenAIModels.GPT_4O, OpenAIModels.GPT_4O_MINI],
|
|
113
|
+
},
|
|
114
|
+
];
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Service-related type definitions for NeuroLink
|
|
3
|
+
* Service registry, dependency injection, and service management types
|
|
4
|
+
*/
|
|
5
|
+
import type { UnknownRecord } from "./common.js";
|
|
6
|
+
/**
|
|
7
|
+
* Service factory function type
|
|
8
|
+
*/
|
|
9
|
+
export type ServiceFactory<T = unknown> = () => T | Promise<T>;
|
|
10
|
+
/**
|
|
11
|
+
* Service registration configuration
|
|
12
|
+
*/
|
|
13
|
+
export type ServiceRegistration<T = unknown> = {
|
|
14
|
+
factory: ServiceFactory<T>;
|
|
15
|
+
singleton: boolean;
|
|
16
|
+
instance?: T;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Service definition with metadata and status
|
|
20
|
+
*/
|
|
21
|
+
export type ServiceDefinition<T = UnknownRecord> = {
|
|
22
|
+
name: string;
|
|
23
|
+
version: string;
|
|
24
|
+
instance: T;
|
|
25
|
+
metadata: ServiceMetadata;
|
|
26
|
+
status: ServiceStatus;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Service metadata for describing service capabilities
|
|
30
|
+
*/
|
|
31
|
+
export type ServiceMetadata = {
|
|
32
|
+
description: string;
|
|
33
|
+
tags: string[];
|
|
34
|
+
dependencies: string[];
|
|
35
|
+
capabilities: string[];
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Service status enumeration
|
|
39
|
+
*/
|
|
40
|
+
export type ServiceStatus = "active" | "inactive" | "error" | "initializing";
|
|
41
|
+
/**
|
|
42
|
+
* Service health information
|
|
43
|
+
*/
|
|
44
|
+
export type ServiceHealth = {
|
|
45
|
+
status: ServiceStatus;
|
|
46
|
+
lastChecked: Date;
|
|
47
|
+
uptime: number;
|
|
48
|
+
errorCount: number;
|
|
49
|
+
dependencies: ServiceDependencyHealth[];
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Service dependency health status
|
|
53
|
+
*/
|
|
54
|
+
export type ServiceDependencyHealth = {
|
|
55
|
+
name: string;
|
|
56
|
+
status: ServiceStatus;
|
|
57
|
+
lastChecked: Date;
|
|
58
|
+
responseTime?: number;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Service configuration options
|
|
62
|
+
*/
|
|
63
|
+
export type ServiceConfigOptions = {
|
|
64
|
+
singleton?: boolean;
|
|
65
|
+
lazy?: boolean;
|
|
66
|
+
timeout?: number;
|
|
67
|
+
retries?: number;
|
|
68
|
+
dependencies?: string[];
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Service registry statistics
|
|
72
|
+
*/
|
|
73
|
+
export type ServiceRegistryStats = {
|
|
74
|
+
totalServices: number;
|
|
75
|
+
activeServices: number;
|
|
76
|
+
failedServices: number;
|
|
77
|
+
initializingServices: number;
|
|
78
|
+
circularDependencies: string[][];
|
|
79
|
+
};
|