rcc-pipeline
Version:
RCC Pipeline Module - Pipeline system and workflow management based on pipeline-framework
128 lines • 4.03 kB
TypeScript
/**
* Pipeline Assembler - Assembles pipelines from configuration and discovered providers
* 流水线组装器 - 从配置和发现的provider组装流水线
*/
import { ProviderDiscoveryOptions } from './ModuleScanner';
import { PipelineFactoryConfig } from './PipelineFactory';
import { PipelineTracker } from './PipelineTracker';
import { VirtualModelConfig } from '../types/virtual-model';
import { Pipeline } from './Pipeline';
import { BaseProvider } from './BaseProvider';
export interface AssemblerConfig {
providerDiscoveryOptions?: ProviderDiscoveryOptions;
pipelineFactoryConfig?: PipelineFactoryConfig;
enableAutoDiscovery?: boolean;
fallbackStrategy?: 'first-available' | 'round-robin';
}
export interface PipelinePool {
virtualModelId: string;
pipelines: Map<string, Pipeline>;
activePipeline: Pipeline | null;
healthStatus: 'healthy';
lastHealthCheck: number;
metrics: {
totalRequests: number;
successfulRequests: number;
failedRequests: number;
averageResponseTime: number;
};
}
export interface AssemblyResult {
success: boolean;
pipelinePools: Map<string, PipelinePool>;
errors: Array<{
virtualModelId: string;
error: string;
provider?: string;
}>;
warnings: Array<{
virtualModelId: string;
warning: string;
}>;
}
/**
* Pipeline Assembler - Core service for assembling pipelines from configuration
* 流水线组装器 - 从配置组装流水线的核心服务
*/
export declare class PipelineAssembler {
private config;
private moduleScanner;
private pipelineFactory;
private pipelineTracker;
private pipelinePools;
private discoveredProviders;
constructor(config: AssemblerConfig, pipelineTracker: PipelineTracker);
/**
* Assemble pipelines from virtual model configurations
* 从虚拟模型配置组装流水线
*/
assemblePipelines(virtualModelConfigs: VirtualModelConfig[]): Promise<AssemblyResult>;
/**
* Discover available providers using ModuleScanner
* 使用ModuleScanner发现可用的provider
*/
private discoverProviders;
/**
* Assemble pipeline pool for a single virtual model
* 为单个虚拟模型组装流水线池
*/
private assemblePipelinePool;
/**
* Create fallback pipeline when no targets are configured
* 当没有配置目标时创建回退流水线
*/
private createFallbackPipeline;
/**
* Create pipeline from target configuration
* 从目标配置创建流水线
*/
private createPipelineFromTarget;
/**
* Build pipeline configuration from virtual model and target
* 从虚拟模型和目标构建流水线配置
*/
private buildPipelineConfig;
/**
* Get assembled pipeline pools
* 获取已组装的流水线池
*/
getPipelinePools(): Map<string, PipelinePool>;
/**
* Get pipeline pool for specific virtual model
* 获取特定虚拟模型的流水线池
*/
getPipelinePool(virtualModelId: string): PipelinePool | null;
/**
* Get all discovered providers
* 获取所有发现的provider
*/
getDiscoveredProviders(): Map<string, BaseProvider>;
/**
* Reload providers and reassemble pipelines
* 重新加载provider并重新组装流水线
*/
reloadProviders(): Promise<void>;
/**
* Infer virtual model configuration from existing pool (fallback)
* 从现有池推断虚拟模型配置(回退)
*/
private inferVirtualModelConfig;
/**
* Get assembler status
* 获取组装器状态
*/
getStatus(): {
initialized: boolean;
totalPools: number;
totalPipelines: number;
healthyPools: number;
discoveredProviders: number;
virtualModelIds: string[];
};
/**
* Cleanup resources
* 清理资源
*/
destroy(): void;
}
//# sourceMappingURL=PipelineAssembler.d.ts.map