@juspay/neurolink 9.2.0 → 9.4.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 +27 -0
- package/README.md +60 -38
- package/dist/agent/directTools.d.ts +8 -8
- package/dist/cli/commands/rag.d.ts +19 -0
- package/dist/cli/commands/rag.js +756 -0
- package/dist/cli/factories/commandFactory.js +146 -83
- package/dist/cli/index.js +1 -0
- package/dist/cli/parser.js +4 -1
- package/dist/core/baseProvider.d.ts +43 -30
- package/dist/core/baseProvider.js +98 -138
- package/dist/core/conversationMemoryFactory.d.ts +2 -2
- package/dist/core/conversationMemoryFactory.js +2 -2
- package/dist/core/conversationMemoryInitializer.d.ts +1 -2
- package/dist/core/conversationMemoryInitializer.js +2 -2
- package/dist/core/infrastructure/baseError.d.ts +21 -0
- package/dist/core/infrastructure/baseError.js +22 -0
- package/dist/core/infrastructure/baseFactory.d.ts +21 -0
- package/dist/core/infrastructure/baseFactory.js +54 -0
- package/dist/core/infrastructure/baseRegistry.d.ts +21 -0
- package/dist/core/infrastructure/baseRegistry.js +49 -0
- package/dist/core/infrastructure/index.d.ts +5 -0
- package/dist/core/infrastructure/index.js +5 -0
- package/dist/core/infrastructure/retry.d.ts +7 -0
- package/dist/core/infrastructure/retry.js +20 -0
- package/dist/core/infrastructure/typedEventEmitter.d.ts +8 -0
- package/dist/core/infrastructure/typedEventEmitter.js +23 -0
- package/dist/core/redisConversationMemoryManager.d.ts +1 -6
- package/dist/core/redisConversationMemoryManager.js +7 -19
- package/dist/factories/providerFactory.d.ts +5 -3
- package/dist/factories/providerFactory.js +31 -24
- package/dist/index.d.ts +81 -12
- package/dist/index.js +105 -36
- package/dist/lib/core/baseProvider.d.ts +43 -30
- package/dist/lib/core/baseProvider.js +98 -138
- package/dist/lib/core/conversationMemoryFactory.d.ts +2 -2
- package/dist/lib/core/conversationMemoryFactory.js +2 -2
- package/dist/lib/core/conversationMemoryInitializer.d.ts +1 -2
- package/dist/lib/core/conversationMemoryInitializer.js +2 -2
- package/dist/lib/core/infrastructure/baseError.d.ts +21 -0
- package/dist/lib/core/infrastructure/baseError.js +23 -0
- package/dist/lib/core/infrastructure/baseFactory.d.ts +21 -0
- package/dist/lib/core/infrastructure/baseFactory.js +55 -0
- package/dist/lib/core/infrastructure/baseRegistry.d.ts +21 -0
- package/dist/lib/core/infrastructure/baseRegistry.js +50 -0
- package/dist/lib/core/infrastructure/index.d.ts +5 -0
- package/dist/lib/core/infrastructure/index.js +6 -0
- package/dist/lib/core/infrastructure/retry.d.ts +7 -0
- package/dist/lib/core/infrastructure/retry.js +21 -0
- package/dist/lib/core/infrastructure/typedEventEmitter.d.ts +8 -0
- package/dist/lib/core/infrastructure/typedEventEmitter.js +24 -0
- package/dist/lib/core/redisConversationMemoryManager.d.ts +1 -6
- package/dist/lib/core/redisConversationMemoryManager.js +7 -19
- package/dist/lib/factories/providerFactory.d.ts +5 -3
- package/dist/lib/factories/providerFactory.js +31 -24
- package/dist/lib/index.d.ts +81 -12
- package/dist/lib/index.js +105 -36
- package/dist/lib/mcp/index.d.ts +6 -5
- package/dist/lib/mcp/index.js +7 -5
- package/dist/lib/neurolink.d.ts +22 -13
- package/dist/lib/neurolink.js +358 -31
- package/dist/lib/providers/amazonBedrock.d.ts +15 -2
- package/dist/lib/providers/amazonBedrock.js +65 -8
- package/dist/lib/providers/anthropic.d.ts +3 -3
- package/dist/lib/providers/anthropic.js +10 -7
- package/dist/lib/providers/googleAiStudio.d.ts +5 -5
- package/dist/lib/providers/googleAiStudio.js +10 -7
- package/dist/lib/providers/googleVertex.d.ts +16 -4
- package/dist/lib/providers/googleVertex.js +72 -16
- package/dist/lib/providers/litellm.d.ts +3 -3
- package/dist/lib/providers/litellm.js +10 -10
- package/dist/lib/providers/mistral.d.ts +3 -3
- package/dist/lib/providers/mistral.js +7 -6
- package/dist/lib/providers/ollama.d.ts +3 -4
- package/dist/lib/providers/ollama.js +7 -8
- package/dist/lib/providers/openAI.d.ts +14 -2
- package/dist/lib/providers/openAI.js +60 -6
- package/dist/lib/providers/openRouter.d.ts +2 -2
- package/dist/lib/providers/openRouter.js +10 -6
- package/dist/lib/rag/ChunkerFactory.d.ts +91 -0
- package/dist/lib/rag/ChunkerFactory.js +321 -0
- package/dist/lib/rag/ChunkerRegistry.d.ts +91 -0
- package/dist/lib/rag/ChunkerRegistry.js +422 -0
- package/dist/lib/rag/chunkers/BaseChunker.d.ts +53 -0
- package/dist/lib/rag/chunkers/BaseChunker.js +144 -0
- package/dist/lib/rag/chunkers/CharacterChunker.d.ts +18 -0
- package/dist/lib/rag/chunkers/CharacterChunker.js +29 -0
- package/dist/lib/rag/chunkers/HTMLChunker.d.ts +19 -0
- package/dist/lib/rag/chunkers/HTMLChunker.js +39 -0
- package/dist/lib/rag/chunkers/JSONChunker.d.ts +19 -0
- package/dist/lib/rag/chunkers/JSONChunker.js +69 -0
- package/dist/lib/rag/chunkers/LaTeXChunker.d.ts +15 -0
- package/dist/lib/rag/chunkers/LaTeXChunker.js +64 -0
- package/dist/lib/rag/chunkers/MarkdownChunker.d.ts +15 -0
- package/dist/lib/rag/chunkers/MarkdownChunker.js +103 -0
- package/dist/lib/rag/chunkers/RecursiveChunker.d.ts +27 -0
- package/dist/lib/rag/chunkers/RecursiveChunker.js +140 -0
- package/dist/lib/rag/chunkers/SemanticMarkdownChunker.d.ts +22 -0
- package/dist/lib/rag/chunkers/SemanticMarkdownChunker.js +139 -0
- package/dist/lib/rag/chunkers/SentenceChunker.d.ts +19 -0
- package/dist/lib/rag/chunkers/SentenceChunker.js +67 -0
- package/dist/lib/rag/chunkers/TokenChunker.d.ts +19 -0
- package/dist/lib/rag/chunkers/TokenChunker.js +62 -0
- package/dist/lib/rag/chunkers/index.d.ts +15 -0
- package/dist/lib/rag/chunkers/index.js +16 -0
- package/dist/lib/rag/chunking/characterChunker.d.ts +16 -0
- package/dist/lib/rag/chunking/characterChunker.js +143 -0
- package/dist/lib/rag/chunking/chunkerRegistry.d.ts +67 -0
- package/dist/lib/rag/chunking/chunkerRegistry.js +195 -0
- package/dist/lib/rag/chunking/htmlChunker.d.ts +34 -0
- package/dist/lib/rag/chunking/htmlChunker.js +248 -0
- package/dist/lib/rag/chunking/index.d.ts +15 -0
- package/dist/lib/rag/chunking/index.js +18 -0
- package/dist/lib/rag/chunking/jsonChunker.d.ts +20 -0
- package/dist/lib/rag/chunking/jsonChunker.js +282 -0
- package/dist/lib/rag/chunking/latexChunker.d.ts +26 -0
- package/dist/lib/rag/chunking/latexChunker.js +252 -0
- package/dist/lib/rag/chunking/markdownChunker.d.ts +19 -0
- package/dist/lib/rag/chunking/markdownChunker.js +202 -0
- package/dist/lib/rag/chunking/recursiveChunker.d.ts +19 -0
- package/dist/lib/rag/chunking/recursiveChunker.js +149 -0
- package/dist/lib/rag/chunking/semanticChunker.d.ts +41 -0
- package/dist/lib/rag/chunking/semanticChunker.js +307 -0
- package/dist/lib/rag/chunking/sentenceChunker.d.ts +25 -0
- package/dist/lib/rag/chunking/sentenceChunker.js +231 -0
- package/dist/lib/rag/chunking/tokenChunker.d.ts +36 -0
- package/dist/lib/rag/chunking/tokenChunker.js +184 -0
- package/dist/lib/rag/document/MDocument.d.ts +198 -0
- package/dist/lib/rag/document/MDocument.js +393 -0
- package/dist/lib/rag/document/index.d.ts +5 -0
- package/dist/lib/rag/document/index.js +6 -0
- package/dist/lib/rag/document/loaders.d.ts +201 -0
- package/dist/lib/rag/document/loaders.js +501 -0
- package/dist/lib/rag/errors/RAGError.d.ts +244 -0
- package/dist/lib/rag/errors/RAGError.js +275 -0
- package/dist/lib/rag/errors/index.d.ts +6 -0
- package/dist/lib/rag/errors/index.js +7 -0
- package/dist/lib/rag/graphRag/graphRAG.d.ts +115 -0
- package/dist/lib/rag/graphRag/graphRAG.js +385 -0
- package/dist/lib/rag/graphRag/index.d.ts +4 -0
- package/dist/lib/rag/graphRag/index.js +5 -0
- package/dist/lib/rag/index.d.ts +103 -0
- package/dist/lib/rag/index.js +142 -0
- package/dist/lib/rag/metadata/MetadataExtractorFactory.d.ts +157 -0
- package/dist/lib/rag/metadata/MetadataExtractorFactory.js +419 -0
- package/dist/lib/rag/metadata/MetadataExtractorRegistry.d.ts +99 -0
- package/dist/lib/rag/metadata/MetadataExtractorRegistry.js +363 -0
- package/dist/lib/rag/metadata/index.d.ts +6 -0
- package/dist/lib/rag/metadata/index.js +10 -0
- package/dist/lib/rag/metadata/metadataExtractor.d.ts +69 -0
- package/dist/lib/rag/metadata/metadataExtractor.js +278 -0
- package/dist/lib/rag/pipeline/RAGPipeline.d.ts +235 -0
- package/dist/lib/rag/pipeline/RAGPipeline.js +402 -0
- package/dist/lib/rag/pipeline/contextAssembly.d.ts +126 -0
- package/dist/lib/rag/pipeline/contextAssembly.js +338 -0
- package/dist/lib/rag/pipeline/index.d.ts +5 -0
- package/dist/lib/rag/pipeline/index.js +6 -0
- package/dist/lib/rag/ragIntegration.d.ts +38 -0
- package/dist/lib/rag/ragIntegration.js +212 -0
- package/dist/lib/rag/reranker/RerankerFactory.d.ts +184 -0
- package/dist/lib/rag/reranker/RerankerFactory.js +431 -0
- package/dist/lib/rag/reranker/RerankerRegistry.d.ts +119 -0
- package/dist/lib/rag/reranker/RerankerRegistry.js +403 -0
- package/dist/lib/rag/reranker/index.d.ts +6 -0
- package/dist/lib/rag/reranker/index.js +10 -0
- package/dist/lib/rag/reranker/reranker.d.ts +71 -0
- package/dist/lib/rag/reranker/reranker.js +278 -0
- package/dist/lib/rag/resilience/CircuitBreaker.d.ts +215 -0
- package/dist/lib/rag/resilience/CircuitBreaker.js +432 -0
- package/dist/lib/rag/resilience/RetryHandler.d.ts +115 -0
- package/dist/lib/rag/resilience/RetryHandler.js +301 -0
- package/dist/lib/rag/resilience/index.d.ts +7 -0
- package/dist/lib/rag/resilience/index.js +8 -0
- package/dist/lib/rag/retrieval/hybridSearch.d.ts +94 -0
- package/dist/lib/rag/retrieval/hybridSearch.js +314 -0
- package/dist/lib/rag/retrieval/index.d.ts +5 -0
- package/dist/lib/rag/retrieval/index.js +6 -0
- package/dist/lib/rag/retrieval/vectorQueryTool.d.ts +93 -0
- package/dist/lib/rag/retrieval/vectorQueryTool.js +290 -0
- package/dist/lib/rag/types.d.ts +768 -0
- package/dist/lib/rag/types.js +9 -0
- package/dist/lib/server/index.d.ts +15 -11
- package/dist/lib/server/index.js +55 -51
- package/dist/lib/types/common.d.ts +0 -1
- package/dist/lib/types/generateTypes.d.ts +70 -8
- package/dist/lib/types/generateTypes.js +1 -1
- package/dist/lib/types/index.d.ts +6 -0
- package/dist/lib/types/index.js +12 -0
- package/dist/lib/types/streamTypes.d.ts +63 -8
- package/dist/lib/types/streamTypes.js +1 -1
- package/dist/lib/types/workflowTypes.d.ts +558 -0
- package/dist/lib/types/workflowTypes.js +32 -0
- package/dist/lib/utils/modelRouter.d.ts +4 -4
- package/dist/lib/utils/modelRouter.js +4 -4
- package/dist/lib/workflow/LAYER-EXAMPLES.d.ts +13 -0
- package/dist/lib/workflow/LAYER-EXAMPLES.js +312 -0
- package/dist/lib/workflow/PROMPT-EXAMPLES.d.ts +117 -0
- package/dist/lib/workflow/PROMPT-EXAMPLES.js +246 -0
- package/dist/lib/workflow/config.d.ts +1569 -0
- package/dist/lib/workflow/config.js +399 -0
- package/dist/lib/workflow/core/ensembleExecutor.d.ts +56 -0
- package/dist/lib/workflow/core/ensembleExecutor.js +398 -0
- package/dist/lib/workflow/core/judgeScorer.d.ts +26 -0
- package/dist/lib/workflow/core/judgeScorer.js +527 -0
- package/dist/lib/workflow/core/responseConditioner.d.ts +22 -0
- package/dist/lib/workflow/core/responseConditioner.js +226 -0
- package/dist/lib/workflow/core/types/conditionerTypes.d.ts +7 -0
- package/dist/lib/workflow/core/types/conditionerTypes.js +8 -0
- package/dist/lib/workflow/core/types/ensembleTypes.d.ts +7 -0
- package/dist/lib/workflow/core/types/ensembleTypes.js +8 -0
- package/dist/lib/workflow/core/types/index.d.ts +7 -0
- package/dist/lib/workflow/core/types/index.js +8 -0
- package/dist/lib/workflow/core/types/judgeTypes.d.ts +7 -0
- package/dist/lib/workflow/core/types/judgeTypes.js +8 -0
- package/dist/lib/workflow/core/types/layerTypes.d.ts +7 -0
- package/dist/lib/workflow/core/types/layerTypes.js +8 -0
- package/dist/lib/workflow/core/types/registryTypes.d.ts +7 -0
- package/dist/lib/workflow/core/types/registryTypes.js +8 -0
- package/dist/lib/workflow/core/workflowRegistry.d.ts +73 -0
- package/dist/lib/workflow/core/workflowRegistry.js +305 -0
- package/dist/lib/workflow/core/workflowRunner.d.ts +115 -0
- package/dist/lib/workflow/core/workflowRunner.js +554 -0
- package/dist/lib/workflow/index.d.ts +36 -0
- package/dist/lib/workflow/index.js +51 -0
- package/dist/lib/workflow/types.d.ts +19 -0
- package/dist/lib/workflow/types.js +10 -0
- package/dist/lib/workflow/utils/types/index.d.ts +7 -0
- package/dist/lib/workflow/utils/types/index.js +8 -0
- package/dist/lib/workflow/utils/types/metricsTypes.d.ts +7 -0
- package/dist/lib/workflow/utils/types/metricsTypes.js +8 -0
- package/dist/lib/workflow/utils/types/validationTypes.d.ts +7 -0
- package/dist/lib/workflow/utils/types/validationTypes.js +8 -0
- package/dist/lib/workflow/utils/workflowMetrics.d.ts +76 -0
- package/dist/lib/workflow/utils/workflowMetrics.js +312 -0
- package/dist/lib/workflow/utils/workflowValidation.d.ts +29 -0
- package/dist/lib/workflow/utils/workflowValidation.js +421 -0
- package/dist/lib/workflow/workflows/adaptiveWorkflow.d.ts +72 -0
- package/dist/lib/workflow/workflows/adaptiveWorkflow.js +367 -0
- package/dist/lib/workflow/workflows/consensusWorkflow.d.ts +69 -0
- package/dist/lib/workflow/workflows/consensusWorkflow.js +193 -0
- package/dist/lib/workflow/workflows/fallbackWorkflow.d.ts +49 -0
- package/dist/lib/workflow/workflows/fallbackWorkflow.js +226 -0
- package/dist/lib/workflow/workflows/multiJudgeWorkflow.d.ts +70 -0
- package/dist/lib/workflow/workflows/multiJudgeWorkflow.js +352 -0
- package/dist/mcp/index.d.ts +6 -5
- package/dist/mcp/index.js +7 -5
- package/dist/neurolink.d.ts +22 -13
- package/dist/neurolink.js +358 -31
- package/dist/providers/amazonBedrock.d.ts +15 -2
- package/dist/providers/amazonBedrock.js +65 -8
- package/dist/providers/anthropic.d.ts +3 -3
- package/dist/providers/anthropic.js +10 -7
- package/dist/providers/googleAiStudio.d.ts +5 -5
- package/dist/providers/googleAiStudio.js +10 -7
- package/dist/providers/googleVertex.d.ts +16 -4
- package/dist/providers/googleVertex.js +72 -16
- package/dist/providers/litellm.d.ts +3 -3
- package/dist/providers/litellm.js +10 -10
- package/dist/providers/mistral.d.ts +3 -3
- package/dist/providers/mistral.js +7 -6
- package/dist/providers/ollama.d.ts +3 -4
- package/dist/providers/ollama.js +7 -8
- package/dist/providers/openAI.d.ts +14 -2
- package/dist/providers/openAI.js +60 -6
- package/dist/providers/openRouter.d.ts +2 -2
- package/dist/providers/openRouter.js +10 -6
- package/dist/rag/ChunkerFactory.d.ts +91 -0
- package/dist/rag/ChunkerFactory.js +320 -0
- package/dist/rag/ChunkerRegistry.d.ts +91 -0
- package/dist/rag/ChunkerRegistry.js +421 -0
- package/dist/rag/chunkers/BaseChunker.d.ts +53 -0
- package/dist/rag/chunkers/BaseChunker.js +143 -0
- package/dist/rag/chunkers/CharacterChunker.d.ts +18 -0
- package/dist/rag/chunkers/CharacterChunker.js +28 -0
- package/dist/rag/chunkers/HTMLChunker.d.ts +19 -0
- package/dist/rag/chunkers/HTMLChunker.js +38 -0
- package/dist/rag/chunkers/JSONChunker.d.ts +19 -0
- package/dist/rag/chunkers/JSONChunker.js +68 -0
- package/dist/rag/chunkers/LaTeXChunker.d.ts +15 -0
- package/dist/rag/chunkers/LaTeXChunker.js +63 -0
- package/dist/rag/chunkers/MarkdownChunker.d.ts +15 -0
- package/dist/rag/chunkers/MarkdownChunker.js +102 -0
- package/dist/rag/chunkers/RecursiveChunker.d.ts +27 -0
- package/dist/rag/chunkers/RecursiveChunker.js +139 -0
- package/dist/rag/chunkers/SemanticMarkdownChunker.d.ts +22 -0
- package/dist/rag/chunkers/SemanticMarkdownChunker.js +138 -0
- package/dist/rag/chunkers/SentenceChunker.d.ts +19 -0
- package/dist/rag/chunkers/SentenceChunker.js +66 -0
- package/dist/rag/chunkers/TokenChunker.d.ts +19 -0
- package/dist/rag/chunkers/TokenChunker.js +61 -0
- package/dist/rag/chunkers/index.d.ts +15 -0
- package/dist/rag/chunkers/index.js +15 -0
- package/dist/rag/chunking/characterChunker.d.ts +16 -0
- package/dist/rag/chunking/characterChunker.js +142 -0
- package/dist/rag/chunking/chunkerRegistry.d.ts +67 -0
- package/dist/rag/chunking/chunkerRegistry.js +194 -0
- package/dist/rag/chunking/htmlChunker.d.ts +34 -0
- package/dist/rag/chunking/htmlChunker.js +247 -0
- package/dist/rag/chunking/index.d.ts +15 -0
- package/dist/rag/chunking/index.js +17 -0
- package/dist/rag/chunking/jsonChunker.d.ts +20 -0
- package/dist/rag/chunking/jsonChunker.js +281 -0
- package/dist/rag/chunking/latexChunker.d.ts +26 -0
- package/dist/rag/chunking/latexChunker.js +251 -0
- package/dist/rag/chunking/markdownChunker.d.ts +19 -0
- package/dist/rag/chunking/markdownChunker.js +201 -0
- package/dist/rag/chunking/recursiveChunker.d.ts +19 -0
- package/dist/rag/chunking/recursiveChunker.js +148 -0
- package/dist/rag/chunking/semanticChunker.d.ts +41 -0
- package/dist/rag/chunking/semanticChunker.js +306 -0
- package/dist/rag/chunking/sentenceChunker.d.ts +25 -0
- package/dist/rag/chunking/sentenceChunker.js +230 -0
- package/dist/rag/chunking/tokenChunker.d.ts +36 -0
- package/dist/rag/chunking/tokenChunker.js +183 -0
- package/dist/rag/document/MDocument.d.ts +198 -0
- package/dist/rag/document/MDocument.js +392 -0
- package/dist/rag/document/index.d.ts +5 -0
- package/dist/rag/document/index.js +5 -0
- package/dist/rag/document/loaders.d.ts +201 -0
- package/dist/rag/document/loaders.js +500 -0
- package/dist/rag/errors/RAGError.d.ts +244 -0
- package/dist/rag/errors/RAGError.js +274 -0
- package/dist/rag/errors/index.d.ts +6 -0
- package/dist/rag/errors/index.js +6 -0
- package/dist/rag/graphRag/graphRAG.d.ts +115 -0
- package/dist/rag/graphRag/graphRAG.js +384 -0
- package/dist/rag/graphRag/index.d.ts +4 -0
- package/dist/rag/graphRag/index.js +4 -0
- package/dist/rag/index.d.ts +103 -0
- package/dist/rag/index.js +141 -0
- package/dist/rag/metadata/MetadataExtractorFactory.d.ts +157 -0
- package/dist/rag/metadata/MetadataExtractorFactory.js +418 -0
- package/dist/rag/metadata/MetadataExtractorRegistry.d.ts +99 -0
- package/dist/rag/metadata/MetadataExtractorRegistry.js +362 -0
- package/dist/rag/metadata/index.d.ts +6 -0
- package/dist/rag/metadata/index.js +9 -0
- package/dist/rag/metadata/metadataExtractor.d.ts +69 -0
- package/dist/rag/metadata/metadataExtractor.js +277 -0
- package/dist/rag/pipeline/RAGPipeline.d.ts +235 -0
- package/dist/rag/pipeline/RAGPipeline.js +401 -0
- package/dist/rag/pipeline/contextAssembly.d.ts +126 -0
- package/dist/rag/pipeline/contextAssembly.js +337 -0
- package/dist/rag/pipeline/index.d.ts +5 -0
- package/dist/rag/pipeline/index.js +5 -0
- package/dist/rag/ragIntegration.d.ts +38 -0
- package/dist/rag/ragIntegration.js +211 -0
- package/dist/rag/reranker/RerankerFactory.d.ts +184 -0
- package/dist/rag/reranker/RerankerFactory.js +430 -0
- package/dist/rag/reranker/RerankerRegistry.d.ts +119 -0
- package/dist/rag/reranker/RerankerRegistry.js +402 -0
- package/dist/rag/reranker/index.d.ts +6 -0
- package/dist/rag/reranker/index.js +9 -0
- package/dist/rag/reranker/reranker.d.ts +71 -0
- package/dist/rag/reranker/reranker.js +277 -0
- package/dist/rag/resilience/CircuitBreaker.d.ts +215 -0
- package/dist/rag/resilience/CircuitBreaker.js +431 -0
- package/dist/rag/resilience/RetryHandler.d.ts +115 -0
- package/dist/rag/resilience/RetryHandler.js +300 -0
- package/dist/rag/resilience/index.d.ts +7 -0
- package/dist/rag/resilience/index.js +7 -0
- package/dist/rag/retrieval/hybridSearch.d.ts +94 -0
- package/dist/rag/retrieval/hybridSearch.js +313 -0
- package/dist/rag/retrieval/index.d.ts +5 -0
- package/dist/rag/retrieval/index.js +5 -0
- package/dist/rag/retrieval/vectorQueryTool.d.ts +93 -0
- package/dist/rag/retrieval/vectorQueryTool.js +289 -0
- package/dist/rag/types.d.ts +768 -0
- package/dist/rag/types.js +8 -0
- package/dist/server/index.d.ts +15 -11
- package/dist/server/index.js +55 -51
- package/dist/server/utils/validation.d.ts +2 -2
- package/dist/types/common.d.ts +0 -1
- package/dist/types/generateTypes.d.ts +70 -8
- package/dist/types/generateTypes.js +1 -1
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.js +12 -0
- package/dist/types/modelTypes.d.ts +20 -20
- package/dist/types/streamTypes.d.ts +63 -8
- package/dist/types/streamTypes.js +1 -1
- package/dist/types/workflowTypes.d.ts +558 -0
- package/dist/types/workflowTypes.js +31 -0
- package/dist/utils/modelRouter.d.ts +4 -4
- package/dist/utils/modelRouter.js +4 -4
- package/dist/workflow/LAYER-EXAMPLES.d.ts +13 -0
- package/dist/workflow/LAYER-EXAMPLES.js +311 -0
- package/dist/workflow/PROMPT-EXAMPLES.d.ts +117 -0
- package/dist/workflow/PROMPT-EXAMPLES.js +245 -0
- package/dist/workflow/config.d.ts +1569 -0
- package/dist/workflow/config.js +398 -0
- package/dist/workflow/core/ensembleExecutor.d.ts +56 -0
- package/dist/workflow/core/ensembleExecutor.js +397 -0
- package/dist/workflow/core/judgeScorer.d.ts +26 -0
- package/dist/workflow/core/judgeScorer.js +526 -0
- package/dist/workflow/core/responseConditioner.d.ts +22 -0
- package/dist/workflow/core/responseConditioner.js +225 -0
- package/dist/workflow/core/types/conditionerTypes.d.ts +7 -0
- package/dist/workflow/core/types/conditionerTypes.js +7 -0
- package/dist/workflow/core/types/ensembleTypes.d.ts +7 -0
- package/dist/workflow/core/types/ensembleTypes.js +7 -0
- package/dist/workflow/core/types/index.d.ts +7 -0
- package/dist/workflow/core/types/index.js +7 -0
- package/dist/workflow/core/types/judgeTypes.d.ts +7 -0
- package/dist/workflow/core/types/judgeTypes.js +7 -0
- package/dist/workflow/core/types/layerTypes.d.ts +7 -0
- package/dist/workflow/core/types/layerTypes.js +7 -0
- package/dist/workflow/core/types/registryTypes.d.ts +7 -0
- package/dist/workflow/core/types/registryTypes.js +7 -0
- package/dist/workflow/core/workflowRegistry.d.ts +73 -0
- package/dist/workflow/core/workflowRegistry.js +304 -0
- package/dist/workflow/core/workflowRunner.d.ts +115 -0
- package/dist/workflow/core/workflowRunner.js +553 -0
- package/dist/workflow/index.d.ts +36 -0
- package/dist/workflow/index.js +50 -0
- package/dist/workflow/types.d.ts +19 -0
- package/dist/workflow/types.js +9 -0
- package/dist/workflow/utils/types/index.d.ts +7 -0
- package/dist/workflow/utils/types/index.js +7 -0
- package/dist/workflow/utils/types/metricsTypes.d.ts +7 -0
- package/dist/workflow/utils/types/metricsTypes.js +7 -0
- package/dist/workflow/utils/types/validationTypes.d.ts +7 -0
- package/dist/workflow/utils/types/validationTypes.js +7 -0
- package/dist/workflow/utils/workflowMetrics.d.ts +76 -0
- package/dist/workflow/utils/workflowMetrics.js +311 -0
- package/dist/workflow/utils/workflowValidation.d.ts +29 -0
- package/dist/workflow/utils/workflowValidation.js +420 -0
- package/dist/workflow/workflows/adaptiveWorkflow.d.ts +72 -0
- package/dist/workflow/workflows/adaptiveWorkflow.js +366 -0
- package/dist/workflow/workflows/consensusWorkflow.d.ts +69 -0
- package/dist/workflow/workflows/consensusWorkflow.js +192 -0
- package/dist/workflow/workflows/fallbackWorkflow.d.ts +49 -0
- package/dist/workflow/workflows/fallbackWorkflow.js +225 -0
- package/dist/workflow/workflows/multiJudgeWorkflow.d.ts +70 -0
- package/dist/workflow/workflows/multiJudgeWorkflow.js +351 -0
- package/package.json +3 -2
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* workflow/core/workflowRegistry.ts
|
|
3
|
+
* Registry for managing workflow configurations
|
|
4
|
+
*/
|
|
5
|
+
import { logger } from "../../utils/logger.js";
|
|
6
|
+
import { validateForRegistration } from "../utils/workflowValidation.js";
|
|
7
|
+
const functionTag = "WorkflowRegistry";
|
|
8
|
+
// ============================================================================
|
|
9
|
+
// REGISTRY STORAGE
|
|
10
|
+
// ============================================================================
|
|
11
|
+
/**
|
|
12
|
+
* In-memory workflow registry
|
|
13
|
+
* TODO: Consider persistent storage in future phases
|
|
14
|
+
*/
|
|
15
|
+
const workflowRegistry = new Map();
|
|
16
|
+
// ============================================================================
|
|
17
|
+
// REGISTRY OPERATIONS
|
|
18
|
+
// ============================================================================
|
|
19
|
+
/**
|
|
20
|
+
* Register a new workflow
|
|
21
|
+
* @param config - Workflow configuration to register
|
|
22
|
+
* @param options - Registration options
|
|
23
|
+
* @returns Registration result
|
|
24
|
+
*/
|
|
25
|
+
export function registerWorkflow(config, options = {}) {
|
|
26
|
+
const { validateBeforeRegister = true, allowOverwrite = false } = options;
|
|
27
|
+
logger.info(`[${functionTag}] Registering workflow`, {
|
|
28
|
+
workflowId: config.id,
|
|
29
|
+
name: config.name,
|
|
30
|
+
type: config.type,
|
|
31
|
+
});
|
|
32
|
+
// Validate if requested
|
|
33
|
+
if (validateBeforeRegister) {
|
|
34
|
+
const validation = validateForRegistration(config);
|
|
35
|
+
if (!validation.valid) {
|
|
36
|
+
logger.error(`[${functionTag}] Workflow validation failed`, {
|
|
37
|
+
workflowId: config.id,
|
|
38
|
+
errors: validation.errors,
|
|
39
|
+
});
|
|
40
|
+
return {
|
|
41
|
+
success: false,
|
|
42
|
+
workflowId: config.id,
|
|
43
|
+
validation,
|
|
44
|
+
error: "Workflow validation failed",
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
// Check for existing workflow
|
|
49
|
+
if (workflowRegistry.has(config.id) && !allowOverwrite) {
|
|
50
|
+
logger.warn(`[${functionTag}] Workflow already exists`, {
|
|
51
|
+
workflowId: config.id,
|
|
52
|
+
});
|
|
53
|
+
return {
|
|
54
|
+
success: false,
|
|
55
|
+
workflowId: config.id,
|
|
56
|
+
error: "Workflow already exists. Set allowOverwrite=true to replace.",
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
// Register workflow
|
|
60
|
+
const entry = {
|
|
61
|
+
config: { ...config },
|
|
62
|
+
registeredAt: new Date().toISOString(),
|
|
63
|
+
usageCount: 0,
|
|
64
|
+
};
|
|
65
|
+
workflowRegistry.set(config.id, entry);
|
|
66
|
+
logger.info(`[${functionTag}] Workflow registered successfully`, {
|
|
67
|
+
workflowId: config.id,
|
|
68
|
+
name: config.name,
|
|
69
|
+
});
|
|
70
|
+
return {
|
|
71
|
+
success: true,
|
|
72
|
+
workflowId: config.id,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Unregister a workflow
|
|
77
|
+
* @param workflowId - ID of workflow to unregister
|
|
78
|
+
* @returns True if workflow was unregistered
|
|
79
|
+
*/
|
|
80
|
+
export function unregisterWorkflow(workflowId) {
|
|
81
|
+
const exists = workflowRegistry.has(workflowId);
|
|
82
|
+
if (exists) {
|
|
83
|
+
workflowRegistry.delete(workflowId);
|
|
84
|
+
logger.info(`[${functionTag}] Workflow unregistered`, { workflowId });
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
logger.warn(`[${functionTag}] Workflow not found for unregistration`, {
|
|
88
|
+
workflowId,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return exists;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Get workflow configuration by ID
|
|
95
|
+
* @param workflowId - ID of workflow to retrieve
|
|
96
|
+
* @returns Workflow configuration or undefined
|
|
97
|
+
*/
|
|
98
|
+
export function getWorkflow(workflowId) {
|
|
99
|
+
const entry = workflowRegistry.get(workflowId);
|
|
100
|
+
if (entry) {
|
|
101
|
+
// Update last used timestamp
|
|
102
|
+
entry.lastUsed = new Date().toISOString();
|
|
103
|
+
entry.usageCount++;
|
|
104
|
+
logger.debug(`[${functionTag}] Workflow retrieved`, {
|
|
105
|
+
workflowId,
|
|
106
|
+
usageCount: entry.usageCount,
|
|
107
|
+
});
|
|
108
|
+
return entry.config;
|
|
109
|
+
}
|
|
110
|
+
logger.warn(`[${functionTag}] Workflow not found`, { workflowId });
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Check if workflow exists
|
|
115
|
+
* @param workflowId - ID of workflow to check
|
|
116
|
+
* @returns True if workflow exists
|
|
117
|
+
*/
|
|
118
|
+
export function hasWorkflow(workflowId) {
|
|
119
|
+
return workflowRegistry.has(workflowId);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* List all registered workflows
|
|
123
|
+
* @param options - Listing options for filtering
|
|
124
|
+
* @returns Array of workflow configurations
|
|
125
|
+
*/
|
|
126
|
+
export function listWorkflows(options = {}) {
|
|
127
|
+
const { type, tags, limit, offset = 0 } = options;
|
|
128
|
+
let workflows = Array.from(workflowRegistry.values()).map((entry) => entry.config);
|
|
129
|
+
// Filter by type
|
|
130
|
+
if (type) {
|
|
131
|
+
workflows = workflows.filter((w) => w.type === type);
|
|
132
|
+
}
|
|
133
|
+
// Filter by tags
|
|
134
|
+
if (tags && tags.length > 0) {
|
|
135
|
+
workflows = workflows.filter((w) => {
|
|
136
|
+
if (!w.tags || w.tags.length === 0) {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
return tags.some((tag) => w.tags?.includes(tag));
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
// Apply pagination
|
|
143
|
+
if (limit !== undefined) {
|
|
144
|
+
workflows = workflows.slice(offset, offset + limit);
|
|
145
|
+
}
|
|
146
|
+
logger.debug(`[${functionTag}] Listed workflows`, {
|
|
147
|
+
count: workflows.length,
|
|
148
|
+
type,
|
|
149
|
+
tags,
|
|
150
|
+
});
|
|
151
|
+
return workflows;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Get workflow metadata (usage stats, timestamps)
|
|
155
|
+
* @param workflowId - ID of workflow
|
|
156
|
+
* @returns Metadata or undefined
|
|
157
|
+
*/
|
|
158
|
+
export function getWorkflowMetadata(workflowId) {
|
|
159
|
+
const entry = workflowRegistry.get(workflowId);
|
|
160
|
+
if (!entry) {
|
|
161
|
+
return undefined;
|
|
162
|
+
}
|
|
163
|
+
return {
|
|
164
|
+
registeredAt: entry.registeredAt,
|
|
165
|
+
lastUsed: entry.lastUsed,
|
|
166
|
+
usageCount: entry.usageCount,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Update workflow configuration
|
|
171
|
+
* @param workflowId - ID of workflow to update
|
|
172
|
+
* @param updates - Partial workflow config with updates
|
|
173
|
+
* @param options - Update options
|
|
174
|
+
* @returns Update result
|
|
175
|
+
*/
|
|
176
|
+
export function updateWorkflow(workflowId, updates, options = {}) {
|
|
177
|
+
const existing = workflowRegistry.get(workflowId);
|
|
178
|
+
if (!existing) {
|
|
179
|
+
logger.warn(`[${functionTag}] Workflow not found for update`, {
|
|
180
|
+
workflowId,
|
|
181
|
+
});
|
|
182
|
+
return {
|
|
183
|
+
success: false,
|
|
184
|
+
workflowId,
|
|
185
|
+
error: "Workflow not found",
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
// Merge updates with existing config
|
|
189
|
+
const updatedConfig = {
|
|
190
|
+
...existing.config,
|
|
191
|
+
...updates,
|
|
192
|
+
id: workflowId, // Ensure ID doesn't change
|
|
193
|
+
updatedAt: new Date().toISOString(),
|
|
194
|
+
};
|
|
195
|
+
// Validate if requested
|
|
196
|
+
const { validateBeforeRegister = true } = options;
|
|
197
|
+
if (validateBeforeRegister) {
|
|
198
|
+
const validation = validateForRegistration(updatedConfig);
|
|
199
|
+
if (!validation.valid) {
|
|
200
|
+
logger.error(`[${functionTag}] Updated workflow validation failed`, {
|
|
201
|
+
workflowId,
|
|
202
|
+
errors: validation.errors,
|
|
203
|
+
});
|
|
204
|
+
return {
|
|
205
|
+
success: false,
|
|
206
|
+
workflowId,
|
|
207
|
+
validation,
|
|
208
|
+
error: "Updated workflow validation failed",
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
// Update registry entry
|
|
213
|
+
existing.config = updatedConfig;
|
|
214
|
+
logger.info(`[${functionTag}] Workflow updated successfully`, {
|
|
215
|
+
workflowId,
|
|
216
|
+
});
|
|
217
|
+
return {
|
|
218
|
+
success: true,
|
|
219
|
+
workflowId,
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Clear all workflows from registry
|
|
224
|
+
* WARNING: This will remove all registered workflows
|
|
225
|
+
*/
|
|
226
|
+
export function clearRegistry() {
|
|
227
|
+
const count = workflowRegistry.size;
|
|
228
|
+
workflowRegistry.clear();
|
|
229
|
+
logger.info(`[${functionTag}] Registry cleared`, {
|
|
230
|
+
workflowsRemoved: count,
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Get registry statistics
|
|
235
|
+
* @returns Statistics about registered workflows
|
|
236
|
+
*/
|
|
237
|
+
export function getRegistryStats() {
|
|
238
|
+
const entries = Array.from(workflowRegistry.values());
|
|
239
|
+
const byType = {};
|
|
240
|
+
let totalUsage = 0;
|
|
241
|
+
let mostUsed;
|
|
242
|
+
entries.forEach((entry) => {
|
|
243
|
+
// Count by type
|
|
244
|
+
const type = entry.config.type;
|
|
245
|
+
byType[type] = (byType[type] || 0) + 1;
|
|
246
|
+
// Sum usage
|
|
247
|
+
totalUsage += entry.usageCount;
|
|
248
|
+
// Track most used
|
|
249
|
+
if (!mostUsed || entry.usageCount > mostUsed.count) {
|
|
250
|
+
mostUsed = {
|
|
251
|
+
id: entry.config.id,
|
|
252
|
+
name: entry.config.name,
|
|
253
|
+
count: entry.usageCount,
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
return {
|
|
258
|
+
totalWorkflows: workflowRegistry.size,
|
|
259
|
+
byType,
|
|
260
|
+
totalUsage,
|
|
261
|
+
mostUsed: mostUsed && mostUsed.count > 0 ? mostUsed : undefined,
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Export registry as JSON for backup/sharing
|
|
266
|
+
* @returns JSON string of all workflows
|
|
267
|
+
*/
|
|
268
|
+
export function exportRegistry() {
|
|
269
|
+
const workflows = Array.from(workflowRegistry.values()).map((entry) => entry.config);
|
|
270
|
+
return JSON.stringify(workflows, null, 2);
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Import workflows from JSON
|
|
274
|
+
* @param json - JSON string of workflow configs
|
|
275
|
+
* @param options - Import options
|
|
276
|
+
* @returns Array of registration results
|
|
277
|
+
*/
|
|
278
|
+
export function importRegistry(json, options = {}) {
|
|
279
|
+
try {
|
|
280
|
+
const workflows = JSON.parse(json);
|
|
281
|
+
const results = [];
|
|
282
|
+
workflows.forEach((config) => {
|
|
283
|
+
const result = registerWorkflow(config, options);
|
|
284
|
+
results.push(result);
|
|
285
|
+
});
|
|
286
|
+
logger.info(`[${functionTag}] Registry import completed`, {
|
|
287
|
+
total: workflows.length,
|
|
288
|
+
successful: results.filter((r) => r.success).length,
|
|
289
|
+
});
|
|
290
|
+
return results;
|
|
291
|
+
}
|
|
292
|
+
catch (error) {
|
|
293
|
+
logger.error(`[${functionTag}] Registry import failed`, {
|
|
294
|
+
error: error.message,
|
|
295
|
+
});
|
|
296
|
+
return [
|
|
297
|
+
{
|
|
298
|
+
success: false,
|
|
299
|
+
workflowId: "import-error",
|
|
300
|
+
error: `Import failed: ${error.message}`,
|
|
301
|
+
},
|
|
302
|
+
];
|
|
303
|
+
}
|
|
304
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow Runner - Main Orchestrator
|
|
3
|
+
* ===================================
|
|
4
|
+
*
|
|
5
|
+
* Coordinates the complete workflow execution pipeline:
|
|
6
|
+
* 1. Model execution (layer-based or flat)
|
|
7
|
+
* 2. Judge scoring with hierarchical prompts
|
|
8
|
+
* 3. Response conditioning (stub)
|
|
9
|
+
* 4. Metrics collection
|
|
10
|
+
* 5. Result assembly
|
|
11
|
+
*
|
|
12
|
+
* @module workflow/core/workflowRunner
|
|
13
|
+
*/
|
|
14
|
+
import type { JsonValue } from "../../types/common.js";
|
|
15
|
+
import type { WorkflowConfig, WorkflowResult } from "../types.js";
|
|
16
|
+
/**
|
|
17
|
+
* Progressive workflow response for streaming
|
|
18
|
+
*/
|
|
19
|
+
export type WorkflowStreamChunk = {
|
|
20
|
+
/**
|
|
21
|
+
* Type of response chunk
|
|
22
|
+
*/
|
|
23
|
+
type: "preliminary" | "final";
|
|
24
|
+
/**
|
|
25
|
+
* Response content
|
|
26
|
+
*/
|
|
27
|
+
content: string;
|
|
28
|
+
/**
|
|
29
|
+
* Partial workflow result (only ensemble data for preliminary)
|
|
30
|
+
*/
|
|
31
|
+
partialResult?: Partial<WorkflowResult>;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Options for workflow execution
|
|
35
|
+
*/
|
|
36
|
+
export type RunWorkflowOptions = {
|
|
37
|
+
/**
|
|
38
|
+
* The user's prompt/query to send to models
|
|
39
|
+
*/
|
|
40
|
+
prompt: string;
|
|
41
|
+
/**
|
|
42
|
+
* Optional conversation history for context
|
|
43
|
+
*/
|
|
44
|
+
conversationHistory?: Array<{
|
|
45
|
+
role: "user" | "assistant";
|
|
46
|
+
content: string;
|
|
47
|
+
}>;
|
|
48
|
+
/**
|
|
49
|
+
* Override default timeout (ms) for this execution
|
|
50
|
+
*/
|
|
51
|
+
timeout?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Override default parallelism for this execution
|
|
54
|
+
*/
|
|
55
|
+
parallelism?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Enable verbose logging for debugging
|
|
58
|
+
*/
|
|
59
|
+
verbose?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Optional context/metadata to pass through
|
|
62
|
+
*/
|
|
63
|
+
metadata?: Record<string, JsonValue>;
|
|
64
|
+
/**
|
|
65
|
+
* Enable progressive streaming (yield preliminary response)
|
|
66
|
+
*/
|
|
67
|
+
streaming?: boolean;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Execute a complete workflow
|
|
71
|
+
*
|
|
72
|
+
* This is the main entry point that orchestrates:
|
|
73
|
+
* - Model execution (respects modelGroups or flat models)
|
|
74
|
+
* - Judge scoring (with hierarchical prompt resolution)
|
|
75
|
+
* - Response conditioning (currently stub)
|
|
76
|
+
* - Metrics calculation
|
|
77
|
+
* - Result assembly
|
|
78
|
+
*
|
|
79
|
+
* @param config - Validated workflow configuration
|
|
80
|
+
* @param options - Execution options including prompt
|
|
81
|
+
* @returns Complete workflow result with scores and metrics
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```typescript
|
|
85
|
+
* const result = await runWorkflow(config, {
|
|
86
|
+
* prompt: 'Explain quantum entanglement',
|
|
87
|
+
* timeout: 30000,
|
|
88
|
+
* verbose: true,
|
|
89
|
+
* });
|
|
90
|
+
*
|
|
91
|
+
* console.log('Best response:', result.content);
|
|
92
|
+
* console.log('Score:', result.score);
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
export declare function runWorkflow(config: WorkflowConfig, options: RunWorkflowOptions): Promise<WorkflowResult>;
|
|
96
|
+
/**
|
|
97
|
+
* Execute workflow with progressive streaming support
|
|
98
|
+
* Yields preliminary response (first completed model) and final synthesized response
|
|
99
|
+
*
|
|
100
|
+
* @param config - Validated workflow configuration
|
|
101
|
+
* @param options - Execution options with streaming enabled
|
|
102
|
+
* @returns AsyncGenerator yielding preliminary and final responses
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```typescript
|
|
106
|
+
* for await (const chunk of runWorkflowWithStreaming(config, options)) {
|
|
107
|
+
* if (chunk.type === 'preliminary') {
|
|
108
|
+
* console.log('Fast response:', chunk.content);
|
|
109
|
+
* } else {
|
|
110
|
+
* console.log('Final synthesis:', chunk.content);
|
|
111
|
+
* }
|
|
112
|
+
* }
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
export declare function runWorkflowWithStreaming(config: WorkflowConfig, options: RunWorkflowOptions): AsyncGenerator<WorkflowStreamChunk, void, undefined>;
|