feat: add qa_build mode, tests, and region mode support
Router Configuration: - Add mode='qa_build' routing rule in router-config.yml - Priority 8, uses local_qwen3_8b for Q&A generation 2-Stage Q&A Pipeline Tests: - Create test_qa_pipeline.py with comprehensive tests - Test prompt building, JSON parsing, router integration - Mock DAGI Router responses for testing Region Mode (Grounding OCR): - Add region_bbox and region_page parameters to ParseRequest - Support region mode in local_runtime with bbox in prompt - Update endpoints to accept region parameters (x, y, width, height, page) - Validate region parameters and filter pages for region mode - Pass region_bbox through inference pipeline Updates: - Update local_runtime to support region_bbox in prompts - Update inference.py to pass region_bbox to local_runtime - Update endpoints.py to handle region mode parameters
This commit is contained in:
@@ -120,6 +120,9 @@ class ParseRequest(BaseModel):
|
||||
)
|
||||
dao_id: Optional[str] = Field(None, description="DAO ID")
|
||||
doc_id: Optional[str] = Field(None, description="Document ID")
|
||||
# Region mode parameters (for grounding OCR)
|
||||
region_bbox: Optional[BBox] = Field(None, description="Bounding box for region mode (x, y, width, height)")
|
||||
region_page: Optional[int] = Field(None, description="Page number for region mode")
|
||||
|
||||
|
||||
class ParseResponse(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user