|
1 | | -"""Fetchcraft Admin - Web-based administration interface.""" |
| 1 | +""" |
| 2 | +Fetchcraft Admin - Modular administration framework. |
2 | 3 |
|
3 | | -__version__ = "0.1.0" |
| 4 | +This package provides a framework for building administration interfaces |
| 5 | +with pluggable handler modules. |
| 6 | +
|
| 7 | +Example usage: |
| 8 | + from fetchcraft.admin import ( |
| 9 | + FetchcraftAdminServer, |
| 10 | + FetchcraftIngestionAdminHandler, |
| 11 | + FetchcraftIngestionPipelineFactory, |
| 12 | + IngestionConfig, |
| 13 | + ) |
| 14 | + from fetchcraft.ingestion.pipeline import TrackedIngestionPipeline |
| 15 | + from fetchcraft.ingestion.transformations import ( |
| 16 | + AsyncParsingTransformation, |
| 17 | + ExtractKeywords, |
| 18 | + ChunkingTransformation, |
| 19 | + ) |
| 20 | + from fetchcraft.ingestion.sinks import VectorIndexSink |
| 21 | + |
| 22 | + class MyPipelineFactory(FetchcraftIngestionPipelineFactory): |
| 23 | + def configure_pipeline(self, pipeline: TrackedIngestionPipeline) -> None: |
| 24 | + pipeline.add_transformation(AsyncParsingTransformation(parser_map=self.parser_map)) |
| 25 | + pipeline.add_transformation(ExtractKeywords()) |
| 26 | + pipeline.add_transformation(ChunkingTransformation(chunker=self.chunker)) |
| 27 | + pipeline.add_sink(VectorIndexSink(index_factory=self.index_factory, index_id=self.index_id)) |
| 28 | + |
| 29 | + config = IngestionConfig() |
| 30 | + handler = FetchcraftIngestionAdminHandler(pipeline_factory=MyPipelineFactory()) |
| 31 | + server = FetchcraftAdminServer(handlers=[handler], config=config) |
| 32 | + server.run() |
| 33 | +""" |
| 34 | + |
| 35 | +__version__ = "2.0.0" |
| 36 | + |
| 37 | +# Framework exports |
| 38 | +from fetchcraft.admin.handler import FetchcraftAdminHandler |
| 39 | +from fetchcraft.admin.context import HandlerContext |
| 40 | +from fetchcraft.admin.config import FetchcraftAdminConfig |
| 41 | +from fetchcraft.admin.server import FetchcraftAdminServer |
| 42 | + |
| 43 | +# Ingestion module exports |
| 44 | +from fetchcraft.admin.ingestion import ( |
| 45 | + FetchcraftIngestionAdminHandler, |
| 46 | + FetchcraftIngestionPipelineFactory, |
| 47 | + IngestionConfig, |
| 48 | + DefaultIndexFactory, |
| 49 | +) |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | +__all__ = [ |
| 54 | + # Framework |
| 55 | + "FetchcraftAdminServer", |
| 56 | + "FetchcraftAdminHandler", |
| 57 | + "FetchcraftAdminConfig", |
| 58 | + "HandlerContext", |
| 59 | + # Ingestion |
| 60 | + "FetchcraftIngestionAdminHandler", |
| 61 | + "FetchcraftIngestionPipelineFactory", |
| 62 | + "IngestionConfig", |
| 63 | + "DefaultIndexFactory", |
| 64 | +] |
0 commit comments