fix(application-form-fill): 代理人字段暂用生产企业信息
This commit is contained in:
@@ -84,6 +84,25 @@ def test_rule_extracts_bracket_sections_from_instructions():
|
||||
assert "-20±5℃" in values["storage_condition_and_validity"]
|
||||
|
||||
|
||||
def test_rule_maps_agent_fields_to_manufacturer_company_for_now():
|
||||
texts = {
|
||||
"目标产品说明书.docx": "\n".join(
|
||||
[
|
||||
"生产企业名称:卡尤迪生物科技宜兴有限公司",
|
||||
"生产企业住所:江苏省宜兴经济技术开发区杏里路10号",
|
||||
"生产地址:江苏省宜兴经济技术开发区杏里路10号宜兴光电产业园4幢102室",
|
||||
]
|
||||
)
|
||||
}
|
||||
|
||||
result = extract_by_rules(texts, _registration_specs())
|
||||
|
||||
values = {field["key"]: field["value"] for field in result["fields"]}
|
||||
assert values["agent_name"] == "卡尤迪生物科技宜兴有限公司"
|
||||
assert values["agent_address"] == "江苏省宜兴经济技术开发区杏里路10号"
|
||||
assert values["manufacturer_address"] == "江苏省宜兴经济技术开发区杏里路10号宜兴光电产业园4幢102室"
|
||||
|
||||
|
||||
def test_llm_extract_parses_structured_json(monkeypatch):
|
||||
monkeypatch.setattr(
|
||||
"review_agent.application_form_fill.services.field_extract.generate_completion",
|
||||
|
||||
@@ -77,3 +77,35 @@ def test_merge_fields_combines_consistent_values_without_conflict():
|
||||
assert merged["product_name"].value == "甲胎蛋白检测试剂盒"
|
||||
assert merged["product_name"].has_conflict is False
|
||||
assert conflicts == []
|
||||
|
||||
|
||||
def test_merge_fields_fills_agent_from_applicant_for_now():
|
||||
regex_results = {
|
||||
"fields": [
|
||||
{
|
||||
"key": "applicant_name",
|
||||
"label": "注册人名称",
|
||||
"value": "卡尤迪生物科技宜兴有限公司",
|
||||
"source_file": "目标产品说明书.docx",
|
||||
"source_role": "说明书",
|
||||
"evidence": "生产企业名称:卡尤迪生物科技宜兴有限公司",
|
||||
"confidence": 0.75,
|
||||
},
|
||||
{
|
||||
"key": "applicant_address",
|
||||
"label": "注册人住所",
|
||||
"value": "江苏省宜兴经济技术开发区杏里路10号",
|
||||
"source_file": "目标产品说明书.docx",
|
||||
"source_role": "说明书",
|
||||
"evidence": "生产企业住所:江苏省宜兴经济技术开发区杏里路10号",
|
||||
"confidence": 0.75,
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
merged, conflicts = merge_fields(regex_results, {"fields": []})
|
||||
|
||||
assert merged["agent_name"].value == "卡尤迪生物科技宜兴有限公司"
|
||||
assert merged["agent_name"].label == "代理人名称"
|
||||
assert merged["agent_address"].value == "江苏省宜兴经济技术开发区杏里路10号"
|
||||
assert conflicts == []
|
||||
|
||||
Reference in New Issue
Block a user