Metadata-Version: 2.1
Name: agent
Version: 0.1.8.2
Summary: Default template for PDM package
Author-Email: jiayongqiang <15936285643@163.com>
License: MIT
Requires-Python: >=3.10
Requires-Dist: fastapi>=0.128.0
Requires-Dist: uvicorn>=0.40.0
Requires-Dist: requests>=2.32.5
Requires-Dist: langchain>=1.2.9
Requires-Dist: langchain-openai>=1.1.7
Requires-Dist: elasticsearch==8.9.0
Requires-Dist: asyncer>=0.0.17
Requires-Dist: psycopg2-binary>=2.9.11
Requires-Dist: loguru>=0.7.3
Requires-Dist: openpyxl>=3.1.5
Requires-Dist: asyncio>=4.0.0
Description-Content-Type: text/markdown

# AI-TAGGING

## 1. 对管理端接口

### 1.1 同步标签接口
- URL：/api/aitag/admin/v1/synchronize_tag
- METHOD: post
- Content-Type: application/json
- BODY:{"tag_ids": [xx,xx]}
  
### 1.2 同步删除标签接口
- URL: /api/aitag/admin/v1/delete_tag
- METHOD:post
- Content-Type: application/json
- Body:{"tag_ids": ["2","3"]}

## 1.3 按体系同步标签
- URL：/api/aitag/admin/v1/synchronize_category
- METHOD: post
- Content-Type: application/json
- BODY:{"category_id": xx}

### 1.3 生成正则表达式接口
- URL: /api/aitag/admin/v1/generate_reg
- METHOD:POST
- Context-Type:application/json
- Body:{
        "tag_name": "智能电网",
        "tag_remark": "指以智能电网技术为核心，建设或改造电力系统，提升电力系统智能化水平和运行效率的项目。"
    }

## 2. 对下游系统接口

### 2.1 智能打标接口
- URL: /api/aitag/v1/tagging
- METHOD:POST
- Content-Type:application/json
- Body:{
  - "business_attr": "test_attr",
  - "phrase": "职业:水产养殖人员 投向:海水养殖 用途:个人经营",
  - "tag_category_id":"xxx" 非必填
  - }

### 2.2 查询接口
- URL：/api/aitag/v1/query
- METHOD:GET
- params:
  - business_attr:d372684dbae64b3dadd33b631480d946 # 申请编号
- response:
```
{
    "code":200,
    "message":"AI Query Endpoint",
    "data":{
        "id":"016e96f4b76e4d1097421e9e055db48e",
        "app_id":null,
        "insert_time":"2026-02-26T18:23:32","business_attr":"d372684dbae64b3dadd33b631480d946",
        "phrase":"职业:水产养殖人员 投向:海水养殖 用途:个人经营",
        "attachment":null,"attachment_url":null,
        "result":"[{\"id\": \"20260200001\", \"tag_code\": \"011\", \"tag_name\": \"海水养殖\", \"desc\": \"贷款用途明确为‘个人经营’，且投向为‘海水养殖’，直接对应标签定义中‘在海水环境中进行人工养殖’的核心语义。尽管未使用‘海水养殖’等术语，但‘投向：海水养殖’已明确表达在
        海水环境中开展养殖活动，符合‘通过人工干预方式培育水生生物’的生产本质。该信息足以支撑在本笔贷款层面命中‘海水养殖’标签，且无任何符合排除情形（如捕捞、服务支持等）的描述。\", \"passr\": true}]",
        "feedback_user_id":null,
        "feedback_user_nm":null,
        "feedback_time":null,
        "feedback":null,
        "feedback_result":null,
        "state":1,
        "consuming_time":null,
        "category_code":null,
        "contract_no":null,
        "reg_result":"['20260200001']",
        "feedback_user_org":null,
        "feedback_user_endpoint":null,
        "is_delete":0
        }
}
```

### 2.3 反馈接口
- URL: /api/aitag/v1/feedback
- METHOD:GET
- BODY:
```
{
    "user_id": "12345",
    "user_nm": "张三",
    "feedback": "agree",
    "contract_no": "HT-2024-001",
    "user_org": "XX公司",
    "user_endpoint": "XX网点",
    "business_attr": "99c1c7bc976c45d0912e914a602d547f"
}
```


