-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault-engine-descriptors.ts
More file actions
68 lines (64 loc) · 4.04 KB
/
Copy pathdefault-engine-descriptors.ts
File metadata and controls
68 lines (64 loc) · 4.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/**
* Aggregates the default engine descriptors used by hosted app assembly.
*
* Descriptor bundles are the only source files that collect multiple concrete
* engine built-ins. The engine consumes this record when the host passes it in;
* engine construction never imports this bundle directly.
*/
import { mdreamTransformerDescriptor } from "../builtins/content-transformers/mdream/mdream-transformer-descriptor.js";
import { readabilityTransformerDescriptor } from "../builtins/content-transformers/readability/readability-transformer-descriptor.js";
import { openAiChatProviderDescriptor } from "../builtins/llm-providers/openai-chat/openai-chat-provider-descriptor.js";
import { debugXmlRendererDescriptor } from "../builtins/output-renderers/debug-xml/debug-xml-renderer-descriptor.js";
import { passthroughRendererDescriptor } from "../builtins/output-renderers/passthrough/passthrough-renderer-descriptor.js";
import { captureUrlsStepDescriptor } from "../builtins/pipeline-steps/capture-urls/capture-urls-step-descriptor.js";
import { classifyUrlStepDescriptor } from "../builtins/pipeline-steps/classify-url/classify-url-step-descriptor.js";
import { llmPassStepDescriptor } from "../builtins/pipeline-steps/llm-pass/llm-pass-step-descriptor.js";
import { loadSourceStepDescriptor } from "../builtins/pipeline-steps/load-source/load-source-step-descriptor.js";
import { transformStepDescriptor } from "../builtins/pipeline-steps/transform/transform-step-descriptor.js";
import { truncateStepDescriptor } from "../builtins/pipeline-steps/truncate/truncate-step-descriptor.js";
import { verifyUrlsStepDescriptor } from "../builtins/pipeline-steps/verify-urls/verify-urls-step-descriptor.js";
import { doclingProviderDescriptor } from "../builtins/source-providers/docling/docling-provider-descriptor.js";
import { firecrawlProviderDescriptor } from "../builtins/source-providers/firecrawl/firecrawl-provider-descriptor.js";
import { httpProviderDescriptor } from "../builtins/source-providers/http/http-provider-descriptor.js";
import { createDescriptorRecord } from "../shared/descriptors.js";
import type { ContentTransformerDescriptor } from "../contracts/extensions/content-transformer.js";
import type { LlmProviderDescriptor } from "../contracts/extensions/llm-provider.js";
import type { OutputRendererDescriptor } from "../contracts/extensions/output-renderer.js";
import type { SourceProviderDescriptor } from "../contracts/extensions/source-provider.js";
import type { PipelineStepDescriptor } from "../contracts/pipeline/step.js";
/** Engine-facing descriptor bundle selected by the hosted service by default. */
export interface EngineDescriptorBundle {
readonly sourceProviders: Readonly<Record<string, SourceProviderDescriptor>>;
readonly contentTransformers: Readonly<Record<string, ContentTransformerDescriptor>>;
readonly llmProviders: Readonly<Record<string, LlmProviderDescriptor>>;
readonly outputRenderers: Readonly<Record<string, OutputRendererDescriptor>>;
readonly pipelineSteps: Readonly<Record<string, PipelineStepDescriptor>>;
}
/** Bundles the built-in engine descriptors without HTTP adapter descriptors. */
export const DEFAULT_ENGINE_DESCRIPTOR_BUNDLE: EngineDescriptorBundle = Object.freeze({
sourceProviders: createDescriptorRecord(
[httpProviderDescriptor, firecrawlProviderDescriptor, doclingProviderDescriptor],
descriptor => descriptor.type
),
contentTransformers: createDescriptorRecord(
[mdreamTransformerDescriptor, readabilityTransformerDescriptor],
descriptor => descriptor.type
),
llmProviders: createDescriptorRecord([openAiChatProviderDescriptor], descriptor => descriptor.type),
outputRenderers: createDescriptorRecord(
[debugXmlRendererDescriptor, passthroughRendererDescriptor],
descriptor => descriptor.type
),
pipelineSteps: createDescriptorRecord(
[
captureUrlsStepDescriptor,
classifyUrlStepDescriptor,
loadSourceStepDescriptor,
llmPassStepDescriptor,
transformStepDescriptor,
truncateStepDescriptor,
verifyUrlsStepDescriptor
],
descriptor => descriptor.type
)
});