@juspay/neurolink 7.32.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 +8 -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 +7 -1
- package/dist/core/baseProvider.js +59 -42
- 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 +7 -1
- package/dist/lib/core/baseProvider.js +59 -42
- 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,14 +2,7 @@
|
|
|
2
2
|
* Service Registry for Dependency Injection
|
|
3
3
|
* Breaks circular dependencies by providing lazy loading and centralized service management
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
(): T | Promise<T>;
|
|
7
|
-
}
|
|
8
|
-
export interface ServiceRegistration<T = unknown> {
|
|
9
|
-
factory: ServiceFactory<T>;
|
|
10
|
-
singleton: boolean;
|
|
11
|
-
instance?: T;
|
|
12
|
-
}
|
|
5
|
+
import type { ServiceFactory } from "../types/serviceTypes.js";
|
|
13
6
|
export declare class ServiceRegistry {
|
|
14
7
|
private static services;
|
|
15
8
|
private static initializing;
|
|
@@ -1,47 +1,5 @@
|
|
|
1
|
-
import type { AnalyticsData } from "
|
|
2
|
-
import type {
|
|
3
|
-
import type { ToolCall, ToolResult } from "../types/streamTypes.js";
|
|
4
|
-
/**
|
|
5
|
-
* Raw usage data from Vercel AI SDK (uses different field names)
|
|
6
|
-
*/
|
|
7
|
-
interface AISDKUsage {
|
|
8
|
-
promptTokens: number;
|
|
9
|
-
completionTokens: number;
|
|
10
|
-
totalTokens: number;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Stream analytics result from Vercel AI SDK streamText
|
|
14
|
-
*/
|
|
15
|
-
export interface StreamTextResult {
|
|
16
|
-
textStream: AsyncIterable<string>;
|
|
17
|
-
text: Promise<string>;
|
|
18
|
-
usage: Promise<AISDKUsage | undefined>;
|
|
19
|
-
response: Promise<{
|
|
20
|
-
id?: string;
|
|
21
|
-
model?: string;
|
|
22
|
-
timestamp?: number | Date;
|
|
23
|
-
} | undefined>;
|
|
24
|
-
finishReason: Promise<"stop" | "length" | "content-filter" | "tool-calls" | "error" | "other" | "unknown">;
|
|
25
|
-
toolResults?: Promise<ToolResult[]>;
|
|
26
|
-
toolCalls?: Promise<ToolCall[]>;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Interface for collecting analytics from streaming results
|
|
30
|
-
*/
|
|
31
|
-
export interface StreamAnalyticsCollector {
|
|
32
|
-
collectUsage(result: StreamTextResult): Promise<TokenUsage>;
|
|
33
|
-
collectMetadata(result: StreamTextResult): Promise<ResponseMetadata>;
|
|
34
|
-
createAnalytics(provider: string, model: string, result: StreamTextResult, responseTime: number, metadata?: Record<string, unknown>): Promise<AnalyticsData>;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Response metadata from stream result
|
|
38
|
-
*/
|
|
39
|
-
export interface ResponseMetadata {
|
|
40
|
-
id?: string;
|
|
41
|
-
model?: string;
|
|
42
|
-
timestamp?: number;
|
|
43
|
-
finishReason?: string;
|
|
44
|
-
}
|
|
1
|
+
import type { AnalyticsData, TokenUsage } from "../types/analytics.js";
|
|
2
|
+
import type { StreamTextResult, StreamAnalyticsCollector, ResponseMetadata } from "../types/streamTypes.js";
|
|
45
3
|
/**
|
|
46
4
|
* Base implementation for collecting analytics from Vercel AI SDK stream results
|
|
47
5
|
*/
|
|
@@ -67,4 +25,3 @@ export declare class BaseStreamAnalyticsCollector implements StreamAnalyticsColl
|
|
|
67
25
|
* Global instance of stream analytics collector
|
|
68
26
|
*/
|
|
69
27
|
export declare const streamAnalyticsCollector: BaseStreamAnalyticsCollector;
|
|
70
|
-
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AIProvider, AIProviderName } from "../
|
|
1
|
+
import type { AIProvider, AIProviderName } from "../types/index.js";
|
|
2
2
|
import type { UnknownRecord } from "../types/common.js";
|
|
3
3
|
/**
|
|
4
4
|
* Provider constructor interface - supports both sync constructors and async factory functions
|
|
@@ -2,7 +2,7 @@ import { ProviderFactory } from "./providerFactory.js";
|
|
|
2
2
|
// Lazy loading all providers to avoid circular dependencies
|
|
3
3
|
// Removed all static imports - providers loaded dynamically when needed
|
|
4
4
|
// This breaks the circular dependency chain completely
|
|
5
|
-
import { AIProviderName, GoogleAIModels, OpenAIModels } from "../
|
|
5
|
+
import { AIProviderName, GoogleAIModels, OpenAIModels, } from "../types/index.js";
|
|
6
6
|
import { logger } from "../utils/logger.js";
|
|
7
7
|
/**
|
|
8
8
|
* Provider Registry - registers all providers with the factory
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { AIProviderFactory } from "./core/factory.js";
|
|
10
10
|
export { AIProviderFactory };
|
|
11
|
-
export type { AIProvider, AIProviderName, ProviderConfig, StreamingOptions, ProviderAttempt, SupportedModelName, } from "./
|
|
11
|
+
export type { AIProvider, AIProviderName, ProviderConfig, StreamingOptions, ProviderAttempt, SupportedModelName, } from "./types/index.js";
|
|
12
12
|
export type { GenerateOptions, GenerateResult, EnhancedProvider, } from "./types/generateTypes.js";
|
|
13
13
|
export type { ToolContext } from "./sdk/toolRegistration.js";
|
|
14
14
|
export { validateTool } from "./sdk/toolRegistration.js";
|
|
15
15
|
export type { ToolResult, ToolDefinition } from "./types/tools.js";
|
|
16
|
-
export { BedrockModels, OpenAIModels, VertexModels, DEFAULT_PROVIDER_CONFIGS, } from "./
|
|
16
|
+
export { BedrockModels, OpenAIModels, VertexModels, DEFAULT_PROVIDER_CONFIGS, } from "./types/index.js";
|
|
17
17
|
export { getBestProvider, getAvailableProviders, isValidProvider, } from "./utils/providerUtils.js";
|
|
18
18
|
export { dynamicModelProvider } from "./core/dynamicModels.js";
|
|
19
|
-
export type {
|
|
19
|
+
export type { DynamicModelConfig, ModelRegistry } from "./types/modelTypes.js";
|
|
20
20
|
export { NeuroLink } from "./neurolink.js";
|
|
21
21
|
export type { ProviderStatus, MCPStatus } from "./neurolink.js";
|
|
22
22
|
export type { MCPServerInfo } from "./types/mcpTypes.js";
|
|
@@ -85,8 +85,7 @@ export declare function getTelemetryStatus(): {
|
|
|
85
85
|
enabled: boolean;
|
|
86
86
|
initialized: boolean;
|
|
87
87
|
};
|
|
88
|
-
export type { TextGenerationOptions, TextGenerationResult, AnalyticsData, } from "./
|
|
89
|
-
export type { EvaluationData } from "./types/providers.js";
|
|
88
|
+
export type { TextGenerationOptions, TextGenerationResult, AnalyticsData, EvaluationData, } from "./types/index.js";
|
|
90
89
|
/**
|
|
91
90
|
* BACKWARD COMPATIBILITY: Legacy generateText function
|
|
92
91
|
* Provides standalone generateText function for existing code that uses it
|
|
@@ -103,4 +102,4 @@ export type { EvaluationData } from "./types/providers.js";
|
|
|
103
102
|
* console.log(result.content);
|
|
104
103
|
* ```
|
|
105
104
|
*/
|
|
106
|
-
export declare function generateText(options: import("./
|
|
105
|
+
export declare function generateText(options: import("./types/index.js").TextGenerationOptions): Promise<import("./types/index.js").TextGenerationResult>;
|
package/dist/lib/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import { AIProviderFactory } from "./core/factory.js";
|
|
|
11
11
|
export { AIProviderFactory };
|
|
12
12
|
export { validateTool } from "./sdk/toolRegistration.js";
|
|
13
13
|
// Model enums
|
|
14
|
-
export { BedrockModels, OpenAIModels, VertexModels, DEFAULT_PROVIDER_CONFIGS, } from "./
|
|
14
|
+
export { BedrockModels, OpenAIModels, VertexModels, DEFAULT_PROVIDER_CONFIGS, } from "./types/index.js";
|
|
15
15
|
// Utility exports
|
|
16
16
|
export { getBestProvider, getAvailableProviders, isValidProvider, } from "./utils/providerUtils.js";
|
|
17
17
|
// Dynamic Models exports
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Provides centralized model data for models command system
|
|
4
4
|
* Part of Phase 4.1 - Models Command System
|
|
5
5
|
*/
|
|
6
|
-
import { AIProviderName } from "../
|
|
6
|
+
import { AIProviderName } from "../types/index.js";
|
|
7
7
|
import type { JsonValue } from "../types/common.js";
|
|
8
8
|
/**
|
|
9
9
|
* Model capabilities interface
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Provides model resolution, search, and recommendation functionality
|
|
4
4
|
* Part of Phase 4.1 - Models Command System
|
|
5
5
|
*/
|
|
6
|
-
import { AIProviderName } from "../
|
|
6
|
+
import { AIProviderName } from "../types/index.js";
|
|
7
7
|
import type { JsonValue } from "../types/common.js";
|
|
8
8
|
import { type ModelInfo, type ModelSearchFilters, type ModelSearchResult, type ModelCapabilities, type UseCaseSuitability } from "./modelRegistry.js";
|
|
9
9
|
/**
|
package/dist/lib/neurolink.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Enhanced AI provider system with natural MCP tool access.
|
|
6
6
|
* Uses real MCP infrastructure for tool discovery and execution.
|
|
7
7
|
*/
|
|
8
|
-
import type { TextGenerationOptions, TextGenerationResult } from "./
|
|
8
|
+
import type { TextGenerationOptions, TextGenerationResult } from "./types/index.js";
|
|
9
9
|
import type { GenerateOptions, GenerateResult } from "./types/generateTypes.js";
|
|
10
10
|
import type { StreamOptions, StreamResult } from "./types/streamTypes.js";
|
|
11
11
|
import type { MCPServerInfo, MCPExecutableTool } from "./types/mcpTypes.js";
|
package/dist/lib/neurolink.js
CHANGED
|
@@ -36,7 +36,7 @@ import { ExternalServerManager } from "./mcp/externalServerManager.js";
|
|
|
36
36
|
// Import direct tools server for automatic registration
|
|
37
37
|
import { directToolsServer } from "./mcp/servers/agent/directToolsServer.js";
|
|
38
38
|
import { isNonNullObject } from "./utils/typeUtils.js";
|
|
39
|
-
// Core types imported from
|
|
39
|
+
// Core types imported from "./types/index.js"
|
|
40
40
|
export class NeuroLink {
|
|
41
41
|
mcpInitialized = false;
|
|
42
42
|
emitter = new EventEmitter();
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { BedrockRuntimeClient } from "@aws-sdk/client-bedrock-runtime";
|
|
2
2
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
3
|
-
import type { AIProviderName, EnhancedGenerateResult } from "../
|
|
3
|
+
import type { AIProviderName, EnhancedGenerateResult, TextGenerationOptions } from "../types/index.js";
|
|
4
4
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
|
-
import type { TextGenerationOptions } from "../core/types.js";
|
|
6
5
|
import type { NeuroLink } from "../neurolink.js";
|
|
7
6
|
export declare class AmazonBedrockProvider extends BaseProvider {
|
|
8
7
|
private bedrockClient;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { ZodType, ZodTypeDef } from "zod";
|
|
8
8
|
import type { Schema, LanguageModelV1 } from "ai";
|
|
9
|
-
import type { AIProviderName } from "../
|
|
9
|
+
import type { AIProviderName } from "../types/index.js";
|
|
10
10
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
11
11
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
12
12
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type LanguageModelV1 } from "ai";
|
|
2
2
|
import type { ValidationSchema } from "../types/typeAliases.js";
|
|
3
|
-
import type { AIProviderName } from "../
|
|
3
|
+
import type { AIProviderName } from "../types/index.js";
|
|
4
4
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
5
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createAnthropic } from "@ai-sdk/anthropic";
|
|
2
2
|
import { streamText } from "ai";
|
|
3
|
-
import { AnthropicModels } from "../
|
|
3
|
+
import { AnthropicModels } from "../types/index.js";
|
|
4
4
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
5
5
|
import { logger } from "../utils/logger.js";
|
|
6
6
|
import { createTimeoutController, TimeoutError } from "../utils/timeout.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ZodType, ZodTypeDef } from "zod";
|
|
2
2
|
import { type Schema, type LanguageModelV1 } from "ai";
|
|
3
|
-
import type { AIProviderName } from "../
|
|
3
|
+
import type { AIProviderName } from "../types/index.js";
|
|
4
4
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
5
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createAnthropic } from "@ai-sdk/anthropic";
|
|
2
2
|
import { streamText } from "ai";
|
|
3
|
-
import { AnthropicModels } from "../
|
|
3
|
+
import { AnthropicModels } from "../types/index.js";
|
|
4
4
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
5
5
|
import { logger } from "../utils/logger.js";
|
|
6
6
|
import { createTimeoutController, TimeoutError } from "../utils/timeout.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type LanguageModelV1 } from "ai";
|
|
2
2
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
3
|
-
import type { AIProviderName } from "../
|
|
3
|
+
import type { AIProviderName } from "../types/index.js";
|
|
4
4
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
5
|
export declare class AzureOpenAIProvider extends BaseProvider {
|
|
6
6
|
private apiKey;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Schema, type LanguageModelV1 } from "ai";
|
|
2
2
|
import type { ZodUnknownSchema } from "../types/typeAliases.js";
|
|
3
|
-
import type { AIProviderName } from "../
|
|
3
|
+
import type { AIProviderName } from "../types/index.js";
|
|
4
4
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
5
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createGoogleGenerativeAI } from "@ai-sdk/google";
|
|
2
2
|
import { streamText } from "ai";
|
|
3
|
-
import { GoogleAIModels } from "../
|
|
3
|
+
import { GoogleAIModels } from "../types/index.js";
|
|
4
4
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
5
5
|
import { logger } from "../utils/logger.js";
|
|
6
6
|
import { createTimeoutController, TimeoutError } from "../utils/timeout.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ZodType, ZodTypeDef } from "zod";
|
|
2
2
|
import { type Schema, type LanguageModelV1, type LanguageModel } from "ai";
|
|
3
|
-
import type { AIProviderName } from "../
|
|
3
|
+
import type { AIProviderName } from "../types/index.js";
|
|
4
4
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
5
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
6
|
/**
|
|
@@ -1122,7 +1122,7 @@ export class GoogleVertexProvider extends BaseProvider {
|
|
|
1122
1122
|
// Cache expired, refresh it with memory management
|
|
1123
1123
|
GoogleVertexProvider.modelConfigCache.clear();
|
|
1124
1124
|
const config = ModelConfigurationManager.getInstance();
|
|
1125
|
-
const vertexConfig = config.
|
|
1125
|
+
const vertexConfig = config.getProviderConfiguration("google-vertex");
|
|
1126
1126
|
GoogleVertexProvider.modelConfigCache.set(cacheKey, vertexConfig);
|
|
1127
1127
|
GoogleVertexProvider.modelConfigCacheTime = now;
|
|
1128
1128
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ZodType, ZodTypeDef } from "zod";
|
|
2
2
|
import { type Schema, type LanguageModelV1 } from "ai";
|
|
3
|
-
import type { AIProviderName } from "../
|
|
3
|
+
import type { AIProviderName } from "../types/index.js";
|
|
4
4
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
5
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
6
|
/**
|
|
@@ -14,7 +14,7 @@ export { HuggingFaceProvider as HuggingFace } from "./huggingFace.js";
|
|
|
14
14
|
export { OllamaProvider as Ollama } from "./ollama.js";
|
|
15
15
|
export { MistralProvider as MistralAI } from "./mistral.js";
|
|
16
16
|
export { LiteLLMProvider as LiteLLM } from "./litellm.js";
|
|
17
|
-
export type { AIProvider } from "../
|
|
17
|
+
export type { AIProvider } from "../types/index.js";
|
|
18
18
|
/**
|
|
19
19
|
* Provider registry for dynamic provider instantiation
|
|
20
20
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ZodType, ZodTypeDef } from "zod";
|
|
2
2
|
import { type Schema, type LanguageModelV1 } from "ai";
|
|
3
|
-
import type { AIProviderName } from "../
|
|
3
|
+
import type { AIProviderName } from "../types/index.js";
|
|
4
4
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
5
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type LanguageModelV1 } from "ai";
|
|
2
2
|
import type { ValidationSchema } from "../types/typeAliases.js";
|
|
3
|
-
import type { AIProviderName } from "../
|
|
3
|
+
import type { AIProviderName } from "../types/index.js";
|
|
4
4
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
5
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
6
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AIProviderName } from "../
|
|
1
|
+
import type { AIProviderName } from "../types/index.js";
|
|
2
2
|
import type { LanguageModelV1 } from "ai";
|
|
3
3
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
4
4
|
import type { ZodUnknownSchema } from "../types/typeAliases.js";
|
|
@@ -273,7 +273,7 @@ export class OllamaProvider extends BaseProvider {
|
|
|
273
273
|
supportsTools() {
|
|
274
274
|
const modelName = this.modelName.toLowerCase();
|
|
275
275
|
// Get tool-capable models from configuration
|
|
276
|
-
const ollamaConfig = modelConfig.
|
|
276
|
+
const ollamaConfig = modelConfig.getProviderConfiguration("ollama");
|
|
277
277
|
const toolCapableModels = ollamaConfig?.modelBehavior?.toolCapableModels || [];
|
|
278
278
|
// Check if current model matches tool-capable model patterns
|
|
279
279
|
const isToolCapable = toolCapableModels.some((capableModel) => modelName.includes(capableModel));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type LanguageModelV1 } from "ai";
|
|
2
2
|
import type { ValidationSchema } from "../types/typeAliases.js";
|
|
3
|
-
import { AIProviderName } from "../
|
|
3
|
+
import { AIProviderName } from "../types/index.js";
|
|
4
4
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
5
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
6
|
import type { NeuroLink } from "../neurolink.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createOpenAI } from "@ai-sdk/openai";
|
|
2
2
|
import { streamText } from "ai";
|
|
3
|
-
import { AIProviderName } from "../
|
|
3
|
+
import { AIProviderName } from "../types/index.js";
|
|
4
4
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
5
5
|
import { logger } from "../utils/logger.js";
|
|
6
6
|
import { createTimeoutController, TimeoutError } from "../utils/timeout.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Schema, type LanguageModelV1 } from "ai";
|
|
2
2
|
import type { ZodUnknownSchema } from "../types/typeAliases.js";
|
|
3
|
-
import type { AIProviderName } from "../
|
|
3
|
+
import type { AIProviderName } from "../types/index.js";
|
|
4
4
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
5
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
6
|
/**
|
|
@@ -126,7 +126,7 @@ export declare class SageMakerLanguageModel implements LanguageModelV1 {
|
|
|
126
126
|
provider: string;
|
|
127
127
|
specificationVersion: string;
|
|
128
128
|
endpointName: string;
|
|
129
|
-
modelType: "
|
|
129
|
+
modelType: "huggingface" | "mistral" | "custom" | "claude" | "llama" | "jumpstart" | undefined;
|
|
130
130
|
region: string;
|
|
131
131
|
};
|
|
132
132
|
/**
|
|
@@ -173,7 +173,7 @@ export declare class SageMakerLanguageModel implements LanguageModelV1 {
|
|
|
173
173
|
provider: string;
|
|
174
174
|
specificationVersion: string;
|
|
175
175
|
endpointName: string;
|
|
176
|
-
modelType: "
|
|
176
|
+
modelType: "huggingface" | "mistral" | "custom" | "claude" | "llama" | "jumpstart" | undefined;
|
|
177
177
|
region: string;
|
|
178
178
|
};
|
|
179
179
|
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Analytics-related type definitions for NeuroLink
|
|
3
|
+
* Comprehensive usage tracking, performance metrics, and cost analysis types
|
|
4
|
+
*/
|
|
5
|
+
import type { JsonValue, UnknownRecord } from "./common.js";
|
|
6
|
+
/**
|
|
7
|
+
* Token usage information (consolidated from multiple sources)
|
|
8
|
+
*/
|
|
9
|
+
export type TokenUsage = {
|
|
10
|
+
input: number;
|
|
11
|
+
output: number;
|
|
12
|
+
total: number;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Error info type for analytics
|
|
16
|
+
*/
|
|
17
|
+
export type ErrorInfo = {
|
|
18
|
+
message: string;
|
|
19
|
+
code?: string | number;
|
|
20
|
+
stack?: string;
|
|
21
|
+
details?: UnknownRecord;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Analytics data structure (consolidated from core analytics)
|
|
25
|
+
*/
|
|
26
|
+
export type AnalyticsData = {
|
|
27
|
+
provider: string;
|
|
28
|
+
model?: string;
|
|
29
|
+
tokenUsage: TokenUsage;
|
|
30
|
+
requestDuration: number;
|
|
31
|
+
timestamp: string;
|
|
32
|
+
cost?: number;
|
|
33
|
+
context?: JsonValue;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Stream Analytics Data - Enhanced for performance tracking
|
|
37
|
+
*/
|
|
38
|
+
export type StreamAnalyticsData = {
|
|
39
|
+
/** Tool execution results with timing */
|
|
40
|
+
toolResults?: Promise<Array<unknown>>;
|
|
41
|
+
/** Tool calls made during stream */
|
|
42
|
+
toolCalls?: Promise<Array<unknown>>;
|
|
43
|
+
/** Stream performance metrics */
|
|
44
|
+
performance?: {
|
|
45
|
+
startTime: number;
|
|
46
|
+
endTime?: number;
|
|
47
|
+
chunkCount: number;
|
|
48
|
+
avgChunkSize: number;
|
|
49
|
+
totalBytes: number;
|
|
50
|
+
};
|
|
51
|
+
/** Provider analytics */
|
|
52
|
+
providerAnalytics?: AnalyticsData;
|
|
53
|
+
};
|
package/dist/lib/types/cli.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* CLI-specific type definitions for NeuroLink
|
|
3
3
|
*/
|
|
4
4
|
import type { UnknownRecord, JsonValue } from "./common.js";
|
|
5
|
-
import type { AnalyticsData, TokenUsage } from "./
|
|
5
|
+
import type { AnalyticsData, TokenUsage } from "./analytics.js";
|
|
6
6
|
import type { EvaluationData } from "../index.js";
|
|
7
7
|
import type { ToolCall, ToolResult } from "./tools.js";
|
|
8
8
|
/**
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Evaluation provider type definitions for NeuroLink
|
|
3
|
+
* Provider performance tracking, evaluation configurations, and provider optimization types
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Evaluation provider type as specified in core module refactoring
|
|
7
|
+
*/
|
|
8
|
+
export type EvaluationProvider = "openai" | "anthropic" | "vertex" | "google-ai" | "local";
|
|
9
|
+
/**
|
|
10
|
+
* Evaluation modes
|
|
11
|
+
*/
|
|
12
|
+
export type EvaluationMode = "basic" | "detailed" | "domain-aware" | "disabled";
|
|
13
|
+
/**
|
|
14
|
+
* Alert severity levels
|
|
15
|
+
*/
|
|
16
|
+
export type AlertSeverity = "low" | "medium" | "high" | "none";
|
|
17
|
+
/**
|
|
18
|
+
* Response quality evaluation scores - Comprehensive evaluation type
|
|
19
|
+
*/
|
|
20
|
+
export type EvaluationData = {
|
|
21
|
+
relevance: number;
|
|
22
|
+
accuracy: number;
|
|
23
|
+
completeness: number;
|
|
24
|
+
overall: number;
|
|
25
|
+
domainAlignment?: number;
|
|
26
|
+
terminologyAccuracy?: number;
|
|
27
|
+
toolEffectiveness?: number;
|
|
28
|
+
isOffTopic: boolean;
|
|
29
|
+
alertSeverity: AlertSeverity;
|
|
30
|
+
reasoning: string;
|
|
31
|
+
suggestedImprovements?: string;
|
|
32
|
+
evaluationModel: string;
|
|
33
|
+
evaluationTime: number;
|
|
34
|
+
evaluationDomain?: string;
|
|
35
|
+
evaluationProvider?: string;
|
|
36
|
+
evaluationAttempt?: number;
|
|
37
|
+
evaluationConfig?: {
|
|
38
|
+
mode: string;
|
|
39
|
+
fallbackUsed: boolean;
|
|
40
|
+
costEstimate: number;
|
|
41
|
+
};
|
|
42
|
+
domainConfig?: {
|
|
43
|
+
domainName: string;
|
|
44
|
+
domainDescription: string;
|
|
45
|
+
keyTerms: string[];
|
|
46
|
+
failurePatterns: string[];
|
|
47
|
+
successPatterns: string[];
|
|
48
|
+
evaluationCriteria?: Record<string, unknown>;
|
|
49
|
+
};
|
|
50
|
+
domainEvaluation?: {
|
|
51
|
+
domainRelevance: number;
|
|
52
|
+
terminologyAccuracy: number;
|
|
53
|
+
domainExpertise: number;
|
|
54
|
+
domainSpecificInsights: string[];
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Enhanced evaluation context for comprehensive response assessment
|
|
59
|
+
*/
|
|
60
|
+
export type EvaluationContext = {
|
|
61
|
+
userQuery: string;
|
|
62
|
+
aiResponse: string;
|
|
63
|
+
context?: Record<string, unknown>;
|
|
64
|
+
primaryDomain?: string;
|
|
65
|
+
assistantRole?: string;
|
|
66
|
+
conversationHistory?: Array<{
|
|
67
|
+
role: "user" | "assistant";
|
|
68
|
+
content: string;
|
|
69
|
+
timestamp?: string;
|
|
70
|
+
}>;
|
|
71
|
+
toolUsage?: Array<{
|
|
72
|
+
toolName: string;
|
|
73
|
+
input: unknown;
|
|
74
|
+
output: unknown;
|
|
75
|
+
executionTime: number;
|
|
76
|
+
}>;
|
|
77
|
+
expectedOutcome?: string;
|
|
78
|
+
evaluationCriteria?: string[];
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Evaluation result type
|
|
82
|
+
* Extends EvaluationData with additional fields
|
|
83
|
+
*/
|
|
84
|
+
export type EnhancedEvaluationResult = EvaluationData & {
|
|
85
|
+
domainAlignment?: number;
|
|
86
|
+
terminologyAccuracy?: number;
|
|
87
|
+
toolEffectiveness?: number;
|
|
88
|
+
contextUtilization?: {
|
|
89
|
+
conversationUsed: boolean;
|
|
90
|
+
toolsUsed: boolean;
|
|
91
|
+
domainKnowledgeUsed: boolean;
|
|
92
|
+
};
|
|
93
|
+
evaluationContext?: {
|
|
94
|
+
domain: string;
|
|
95
|
+
toolsEvaluated: string[];
|
|
96
|
+
conversationTurns: number;
|
|
97
|
+
};
|
|
98
|
+
isOffTopic: boolean;
|
|
99
|
+
alertSeverity: AlertSeverity;
|
|
100
|
+
reasoning: string;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Evaluation request type as specified in core module refactoring
|
|
104
|
+
*/
|
|
105
|
+
export type EvaluationRequest = {
|
|
106
|
+
content: string;
|
|
107
|
+
context?: string;
|
|
108
|
+
domain?: string;
|
|
109
|
+
criteria: EvaluationCriteria;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Evaluation criteria type as specified in core module refactoring
|
|
113
|
+
*/
|
|
114
|
+
export type EvaluationCriteria = {
|
|
115
|
+
relevance: boolean;
|
|
116
|
+
accuracy: boolean;
|
|
117
|
+
completeness: boolean;
|
|
118
|
+
domainSpecific?: boolean;
|
|
119
|
+
};
|