1
0

2 Commity c98f48012f ... d2c3ef7f1d

Autor SHA1 Správa Dátum
  997842115 d2c3ef7f1d finish anzhuang 3 dní pred
  997842115 32e9df169f adapt to az 1 týždeň pred
19 zmenil súbory, kde vykonal 2306 pridanie a 35 odobranie
  1. 102 0
      Service.js
  2. 12 0
      anzhuangjsj.py
  3. 0 0
      az_basic_rule
  4. 0 0
      az_name_label
  5. 0 0
      basic_rule
  6. 311 0
      buchong.py
  7. 243 0
      feiyong.py
  8. 25 0
      huansuan.py
  9. 42 0
      huansuan0304.py
  10. 22 0
      huansuan0308.py
  11. 22 0
      huansuan0309.py
  12. 12 0
      postprocess.py
  13. 179 0
      postprocess0304.py
  14. 6 0
      postprocess0307.py
  15. 397 0
      postprocess0308.py
  16. 160 0
      postprocess0310.py
  17. 38 2
      server.js
  18. 164 33
      tasks.py
  19. 571 0
      tihuan_az.py

+ 102 - 0
Service.js

@@ -1846,6 +1846,108 @@ class Service{
 
     }
 
+    azfy_mock(row, dinge, selected) {
+        let res = JSON.parse(dinge);
+        let keys = Object.keys(res['DEBH']);
+        let key = keys[0];
+        let tips = null;
+        if (res['actual_zhuanye'] == 30) {
+            tips = azfy(res['DEBH'][key], res['GCLMC'][key]);
+        }
+        if (res['actual_zhuanye'] == 60) {
+            tips = xsazfy(res['DEBH'][key], res['GCLMC'][key]);
+        }
+        if (res['actual_zhuanye'] == 10) {
+            tips = tjazfy(res['DEBH'][key], res['GCLMC'][key]);
+        }
+
+
+        if (tips != null) {
+            res['rgde'] = tips['rgde'];
+            res['clde'] = tips['clde'];
+            res['jxde'] = tips['jxde'];
+            res['azfytag'] = tips['azfytag'];
+        }
+        let qd = this.cache.filter(x=>x['key'] == row)[0];
+        let dercj = [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地", 
+                "供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志", 'key', 'bc' ]];
+        for(let i = 0; i < selected.length; i++) {
+            let rgf = selected[i]['人工费'];
+            let clf = selected[i]['材料费'];
+            let jxf = selected[i]['机械费'];
+            let sl = selected[i]['数量'];
+            if (res['azfytag'][0] == '人工费') {
+                let sum = Number(sl) * Number(rgf) * Number(res['azfytag'][1]) / Number(100);
+                dercj.push(['', res['rgde'][0]['CLBH'], res['rgde'][0]['CLMC'], '', '元', 
+                    '1', '', '', '1', '', Number(sum) * Number(res['azfytag'][2]) / Number(100), Number(sum) * Number(res['azfytag'][2]) / Number(100),
+                    '', '', '', '', uuidv4(), '' ]);
+                dercj.push(['', res['clde'][0]['CLBH'], res['clde'][0]['CLMC'], '', '元', 
+                    '1', '', '', '2', '', Number(sum) * Number(res['azfytag'][3]) / Number(100), Number(sum) * Number(res['azfytag'][3]) / Number(100),
+                    '', '', '', '', uuidv4(), '' ]);
+                dercj.push(['', res['jxde'][0]['jxbh'], res['jxde'][0]['jxmc'], '', '元', 
+                    '1', '', '', '3', '', Number(sum) * Number(res['azfytag'][4]) / Number(100), Number(sum) * Number(res['azfytag'][4]) / Number(100),
+                    '', '', '', '', uuidv4(), '' ]);
+            } else if (res['azfytag'][0] == '人工费+机械费') {
+                let sum = Number(sl) * (Number(jxf) + Number(rgf)) * Number(res['azfytag'][1]) / Number(100);
+                dercj.push(['', res['rgde'][0]['CLBH'], res['rgde'][0]['CLMC'], '', '元', 
+                    '1', '', '', '1', '', Number(sum) * Number(res['azfytag'][2]) / Number(100), Number(sum) * Number(res['azfytag'][2]) / Number(100),
+                    '', '', '', '', uuidv4(), '' ]);
+                dercj.push(['', res['clde'][0]['CLBH'], res['clde'][0]['CLMC'], '', '元', 
+                    '1', '', '', '2', '', Number(sum) * Number(res['azfytag'][3]) / Number(100), Number(sum) * Number(res['azfytag'][3]) / Number(100),
+                    '', '', '', '', uuidv4(), '' ]);
+                dercj.push(['', res['jxde'][0]['jxbh'], res['jxde'][0]['jxmc'], '', '元', 
+                    '1', '', '', '3', '', Number(sum) * Number(res['azfytag'][4]) / Number(100), Number(sum) * Number(res['azfytag'][4]) / Number(100),
+                    '', '', '', '', uuidv4(), '' ]);
+
+            }
+        }
+
+        let newKey = uuidv4();
+        if (!qd.hasOwnProperty('_children')) {
+            qd["_children"] = [];
+        }
+        qd["_children"].push({
+                    '操作': '',
+                    '序号': null,
+                    '清单编码': res['DEBH'][key],
+                    '名称': res['GCLMC'][key],
+                    '项目特征': null,
+                    '计算规则': tips != null ? tips['sm'] : '',
+                    '单位': res['DW'][key],
+                    '数量': '1',
+                    '综合单价': '0',
+                    '合价': '0',
+                    '人工费': '0',
+                    '主材费': '0',
+                    '设备费': '0',
+                    '辅材费': '0',
+                    '材料费': '0',
+                    '机械费': '0',
+                    '管理费': '0',
+                    '利润': '0',
+                    '暂估价': null,
+                    '综合人工工日': null,
+                    '备注': null,
+                    "dercj": dercj,
+                    'rcjdg': dercj.map(x=>[x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10], x[11], x[12], x[13], x[14], x[15], x[16], x[17]]),
+                    'key' :   newKey,
+                    "fuzhuEnable": false,
+                    'yuban': [],
+                    'rcjbc': [],
+                    'azfytag': []
+    
+                    
+        });
+
+        this.updateDercj_(newKey, dercj, [], [], [], 1);
+        //this.updateDercj_(newKey, dercj, []);
+        let summarized = this.summarize(this.cache);
+        this.push_op(copy(summarized));
+        this.cache = copy(summarized);
+                
+        return [true, copy(this.cache), newKey];
+
+    }
     azfy_djcs(row, dinge, selected) {
         let res = JSON.parse(dinge);
         let keys = Object.keys(res['DEBH']);

+ 12 - 0
anzhuangjsj.py

@@ -0,0 +1,12 @@
+def anzhuangjsj(name, bh, collection):
+    print("anzhuangjsj")
+    query = {'biao_id': name, 'Dwgcbh': bh}
+    projection={'__children': 0, 'rcj': 0, '计算规则': 0, '管理费': 0, '利润': 0, '暂估价': 0, '备注': 0, '综合人工工日': 0, '操作': 0, '设备费': 0, '序号': 0, '综合单价': 0, '合价': 0, '主材费': 0 ,'辅材费': 0, 'DogNum': 0, 'user': 0}
+    matching = collection.find(query, projection)
+    result = []
+    for entry in matching:
+        del entry['_id']
+        result.append(entry)
+    return result
+        
+

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
az_basic_rule


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
az_name_label


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
basic_rule


+ 311 - 0
buchong.py

@@ -0,0 +1,311 @@
+import json
+def only(tz, aiclient):
+    completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+        {"role": "user", "content": "给定一段文字,其中描述了一项安装工作的工作内容。这段文字可能会注明,该项工作不用考虑安装的设备本身的费用,只需考虑安装费。这段文字也可能不做任何注明。"+'''
+              例如,给定文字如下:
+              1、名称:高真空焊烟净化机组控制箱(箱随设备提供计安装费)
+              这段文字注明了仅计安装费
+              再例如,给定文字如下:
+              1、名称:母线槽始端箱(超高)
+              2、型号:15C
+              3、容量(A):1800A
+              这段文字没有注明
+
+        ''' + '现在给定文字如下:'+tz+"\n请判断是否注明了仅计安装费,请直接回答是或者否"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+        )
+    mc = completion.choices[0].message.content
+    if '是' in mc:
+        return True
+    return False
+
+def need_buchong(debm, tz, aiclient):
+    if debm == '4-266' or debm == '4-267' or debm =='4-268' or debm=='4-269' or debm=='4-270':
+        return not only(tz, aiclient)
+    if debm == '4-265':
+        return not only(tz, aiclient)
+    if debm == '4-203' or debm =='4-204' or debm=='4-205' or debm=='4-206':
+        return not only(tz, aiclient)
+    if debm == '4-918' or debm =='4-919':
+        return not only(tz, aiclient)
+    if debm in ['1-'+str(x) for x in range(684,702)]:
+        return not only(tz, aiclient)
+    if debm in ['9-'+str(x) for x in range(153,163)]:
+        return not only(tz, aiclient)
+    if debm in ['9-'+str(x) for x in range(200,206)]:
+        return not only(tz, aiclient)
+    if debm in ['6-'+str(x) for x in range(23,36)]:
+        return not only(tz, aiclient)
+    if debm in ['6-'+str(x) for x in range(64,92)]:
+        return not only(tz, aiclient)
+    if debm in ['7-'+str(x) for x in range(298,324)]:
+        return not only(tz, aiclient)
+    if debm in ['7-'+str(x) for x in range(378,420)]:
+        return not only(tz, aiclient)
+    return False
+def buchong_cailiao(aiclient, debm, tz):
+    if debm in ['7-'+str(x) for x in range(378,420)]:
+        bh = '710000F'
+        completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+        {"role": "user", "content": "给定一段文字,请抽取出风口的关键信息并返回。"+'''
+              例如,给定文字如下:
+              1、名称:防雨百叶风口
+              2、规格:400*400
+              你应该返回 "防雨百叶风口400*400"
+
+        ''' + '现在给定文字如下:'+tz+"\n请返回结果"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+        )
+        mc = completion.choices[0].message.content
+        print(mc)
+    if debm in ['7-'+str(x) for x in range(298,324)]:
+        bh = '710000F'
+        completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+        {"role": "user", "content": "给定一段文字,请抽取出阀门的关键信息并返回。"+'''
+              例如,给定文字如下:
+              1、名称:对开多叶调节阀
+              2、规格:320*320
+              你应该返回    "对开多叶调节阀320*320"
+
+        ''' + '现在给定文字如下:'+tz+"\n请返回结果"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+        )
+        mc = completion.choices[0].message.content
+        print(mc)
+    if debm in ['6-'+str(x) for x in range(64,92)]:
+        bh = '610000F'
+        completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+        {"role": "user", "content": "给定一段文字,请抽取出流量表的关键信息并返回。"+'''
+              例如,给定文字如下:
+              1、名称:热式动力气体质量流量计
+              2、型号:50-5000Nm,141/h,PN1.6MPa
+              你应该返回    "热式动力气体质量流量计50-5000Nm,141/h,PN1.6MPa"
+
+        ''' + '现在给定文字如下:'+tz+"\n请返回结果"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+        )
+        mc = completion.choices[0].message.content
+        print(mc)
+    if debm in ['6-'+str(x) for x in range(23,36)]:
+        bh = '610000F'
+        completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+        {"role": "user", "content": "给定一段文字,请抽取出压力表的关键信息并返回。"+'''
+              例如,给定文字如下:
+              1、名称:压力表
+              2、型号:含表阀及弯管
+              3、规格:Y-100型,0-1.6MPa
+              你应该返回    "压力表Y-100型 含表阀及弯管"
+
+        ''' + '现在给定文字如下:'+tz+"\n请返回结果"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+        )
+        mc = completion.choices[0].message.content
+        print(mc)
+    if debm in ['9-'+str(x) for x in range(200,206)]:
+        bh = '910000F'
+        completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+        {"role": "user", "content": "给定一段文字,请抽取出显示器、报警器、控制器的关键信息并返回。"+'''
+              例如,给定文字如下:
+              名称: 燃气声光报警器
+              你应该返回    "燃气声光报警器"
+
+        ''' + '现在给定文字如下:'+tz+"\n请返回结果"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+        )
+        mc = completion.choices[0].message.content
+        print(mc)
+    if debm in ['9-'+str(x) for x in range(153,163)]:
+        bh = '910000F'
+        completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+        {"role": "user", "content": "给定一段文字,请抽取出探测器的关键信息并返回。"+'''
+              例如,给定文字如下:
+              名称:可燃气体探测器
+              你应该返回    "可燃气体探测器"
+
+        ''' + '现在给定文字如下:'+tz+"\n请返回结果"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+        )
+        mc = completion.choices[0].message.content
+        print(mc)
+    if debm in ['1-'+str(x) for x in range(684,702)]:
+        bh = '110000F'
+        completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+        {"role": "user", "content": "给定一段文字,请抽取出轴流通风机的关键信息并返回。"+'''
+              例如,给定文字如下:
+              名称:侧墙轴流风机
+              你应该返回    "侧墙轴流风机"
+
+        ''' + '现在给定文字如下:'+tz+"\n请返回结果"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+        )
+        mc = completion.choices[0].message.content
+        print(mc)
+    if debm.startswith('4-918') or debm.startswith('4-919'):
+        bh = '410000F'
+        completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+        {"role": "user", "content": "给定一段文字,请抽取出避雷网的关键信息并返回。"+'''
+              例如,给定文字如下:
+              1、名称:防雷网
+              2、材质:镀锌扁钢
+              3、规格:25*4
+              你应该返回    "镀锌扁钢 25*4"
+
+        ''' + '现在给定文字如下:'+tz+"\n请返回结果"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+        )
+        mc = completion.choices[0].message.content
+        print(mc)
+    if debm.startswith('4-203') or debm.startswith('4-204') or debm.startswith('4-205') or debm.startswith('4-206'):
+        bh = '410000F'
+        completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+        {"role": "user", "content": "给定一段文字,请抽取出始端箱(分线箱)的关键信息(电流容量)并返回。"+'''
+              例如,给定文字如下:
+              1、名称:母线槽始端箱(超高)
+              2. 型号2D
+              3. 容量(A):800A
+              你应该返回    "母线槽始端箱800A"
+
+        ''' + '现在给定文字如下:'+tz+"\n请返回结果"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+        )
+        mc = completion.choices[0].message.content
+        print(mc)
+    if debm.startswith('4-265'):
+        bh = '410000F'
+        completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+        {"role": "user", "content": "给定一段文字,请抽取出控制箱的关键信息并返回。"+'''
+              例如,给定文字如下:
+              1、名称:照明按钮控制箱
+              你应该返回    "照明按钮控制箱"
+
+        ''' + '现在给定文字如下:'+tz+"\n请返回结果"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+        )
+        mc = completion.choices[0].message.content
+        print(mc)
+    if debm.startswith('4-266') or debm.startswith('4-267') or debm.startswith('4-268') or debm.startswith('4-269') or debm.startswith('4-230'):
+        bh = '410000F'
+        completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+        {"role": "user", "content": "给定一段文字,请抽取出配电箱的关键信息并返回。"+'''
+              例如,给定文字如下:
+              1、名称:配电箱
+              2、型号:L5A
+              3、规格:600*1500*400
+              4、基础形式、材质、规格:10#槽钢
+              5、安装方式:落地安装
+              6、电气元器件,模块按设计配置齐全
+              7、详见设计图纸,满足设计及规范要求
+              你应该返回    "配电箱L5A"
+              再例如,给定文字如下:
+              1、名称:消火栓泵配电柜XFX
+              2、型号:600*1500*400
+              4、基础形式、材质、规格:10#槽钢
+              5、安装方式:落地安装
+              6、电气元器件,模块按设计配置齐全
+              7、详见设计图纸,满足设计及规范要求
+              你应该返回    "消火栓泵配电柜XFX"
+              再例如,给定文字如下:
+              1、名称:配电箱C-AT
+              2、型号:非标,详见系统图
+              4、基础形式、材质、规格:10#槽钢
+              5、安装方式:落地安装
+              6、电气元器件,模块按设计配置齐全
+              7、详见设计图纸,满足设计及规范要求
+              你应该返回    "配电箱C-AT"
+
+        ''' + '现在给定文字如下:'+tz+"\n请返回结果"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+        )
+        mc = completion.choices[0].message.content
+        print(mc)
+    return {'CLBH': bh, 'CLMC': mc, 'JLDW': '台', 'YSJG': 0, 'SL': 1, 'HJ': 0}
+def tihuan(aiclient, old_name, tz):
+    completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+        {"role": "user", "content": "给定一段文字,再给定一个材料,请抽取出该材料的关键信息并返回。"+'''
+              例如,给定文字如下:
+              1、名称:密集型铜母线(超高)
+              2、型号:XL-M-63A/5P
+              3、容量(A):63A
+              4、含配套支架
+              给定材料为 “母线槽 每相400A以下”,
+              你应该返回 “密集型铜母线XL-M-63A/5P”
+              再例如,给定文字如下:
+              1、名称:接地母线
+              2、材质:镀锌扁钢
+              3、规格:-40*4
+              给定材料为 “接地母线”,
+              你应该返回 “镀锌扁钢 40*4”
+              再例如,给定文字如下:
+              1、名称:消防电源通讯管理机
+              2、型号:配DPD信号
+              3、安装方式:落地安装
+              给定材料为 “槽钢”,
+              因为文字没有提及槽钢,所以你原封不动返回材料名,这里你应该返回“槽钢”
+        ''' + '现在给定文字如下:'+tz+"\n给定材料为 "+old_name+"\n请返回结果"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+        )
+    mc = completion.choices[0].message.content
+    print(mc)
+    return mc
+
+def buchong(aiclient, json_string, debm, tz):
+    obj = json.loads(json_string)
+    print(debm)
+    if need_buchong(debm, tz, aiclient):
+        obj['clde'].append(buchong_cailiao(aiclient, debm, tz))
+    for entry in obj['clde']:
+        if entry['CLBH'].startswith('CL'):
+            entry['CLMC']=tihuan(aiclient, entry['CLMC'], tz)
+    return json.dumps(obj, ensure_ascii=False)

+ 243 - 0
feiyong.py

@@ -0,0 +1,243 @@
+import time
+from fallback import fallback
+from config import simplemodel
+from template import xuanxiang
+from fallback import fallback
+chaogao9=['5m以上到8m以内', '8-12m', '12-16m', '16-20m']
+chaogao10=['3.6m以上到8m以内', '8-12m', '12-16m', '16-20m']
+chaogao11=['6到20m以内', '20-30m', '30-40m', '40-50m', '50-60m', '60-70m', '70-80m','80m以上']
+def select_chaogao_11(
+       B, #data
+       aiclient,
+             qwclient,
+              sfclient
+             ):
+    options=[]
+    letters = "ABCDEFGHIJKLMN"
+    for i in range(len(chaogao11)):
+        options.append("给定选项" + letters[i]+",内容为"+chaogao11[i] )
+
+    completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        #model="THUDM/GLM-Z1-9B-0414",
+        #model="ernie-speed-128k",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+            {"role": "user", "content": "超高指的是操作物高度距离楼地面6m以上的工程."},
+            {"role": "user", "content": "问题描述: 给定一段含有超高工作的内容: " + B['label'] + " " +  B['mc'] + " " + B['tz'] +  ",".join(options) + "。请选择最合适的选项,并返回字母代号,例如,返回 A。如果内容中没有明确高度,请返回A"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+        #extra_body={"enable_thinking": True},
+        #stream=True
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    if len([x for x in json_string if x != ',' and x != '[' and x != ']' and x != ' ' and (x < 'A' or x > 'M')]) < 5:
+        answer=[]
+        if 'A' in json_string and len(chaogao11) > 0:
+            answer.append('A')
+        if 'B' in json_string and len(chaogao11) > 1:
+            answer.append('B')
+        if 'C' in json_string and len(chaogao11) > 2:
+            answer.append('C')
+        if 'D' in json_string and len(chaogao11) > 3:
+            answer.append('D')
+        if 'E' in json_string and len(chaogao11) > 4:
+            answer.append('E')
+        if 'F' in json_string and len(chaogao11) > 5:
+            answer.append('F')
+        if 'G' in json_string and len(chaogao11) > 6:
+            answer.append('G')
+        if 'H' in json_string and len(chaogao11) > 7:
+            answer.append('H')
+        return answer
+    completion = sfclient.chat.completions.create(
+        #model="glm-4.5-flash",
+        model=simplemodel(),
+        messages=xuanxiang(json_string),
+        extra_body={"thinking": {"type": "disabled"}},
+        #extra_body={"enable_thinking": False},
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    answer=[]
+    if 'A' in json_string and len(chaogao11) > 0:
+        answer.append('A')
+    if 'B' in json_string and len(chaogao11) > 1:
+        answer.append('B')
+    if 'C' in json_string and len(chaogao11) > 2:
+        answer.append('C')
+    if 'D' in json_string and len(chaogao11) > 3:
+        answer.append('D')
+    if 'E' in json_string and len(chaogao11) > 4:
+        answer.append('E')
+    if 'F' in json_string and len(chaogao11) > 5:
+        answer.append('F')
+    if 'G' in json_string and len(chaogao11) > 6:
+        answer.append('G')
+    if 'H' in json_string and len(chaogao11) > 7:
+        answer.append('H')
+    
+    return answer
+def select_chaogao_10(
+       B, #data
+       aiclient,
+             qwclient,
+              sfclient
+             ):
+    options=[]
+    letters = "ABCDEFGHIJKLMN"
+    for i in range(len(chaogao10)):
+        options.append("给定选项" + letters[i]+",内容为"+chaogao10[i] )
+
+    completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        #model="THUDM/GLM-Z1-9B-0414",
+        #model="ernie-speed-128k",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+            {"role": "user", "content": "超高指的是操作物高度距离楼地面3.6m以上的工程."},
+            {"role": "user", "content": "问题描述: 给定一段含有超高工作的内容: " + B['label'] + " " +  B['mc'] + " " + B['tz'] +  ",".join(options) + "。请选择最合适的选项,并返回字母代号,例如,返回 A。如果内容中没有明确高度,请返回A"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+        #extra_body={"enable_thinking": True},
+        #stream=True
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    if len([x for x in json_string if x != ',' and x != '[' and x != ']' and x != ' ' and (x < 'A' or x > 'M')]) < 5:
+        answer=[]
+        if 'A' in json_string and len(chaogao10) > 0:
+            answer.append('A')
+        if 'B' in json_string and len(chaogao10) > 1:
+            answer.append('B')
+        if 'C' in json_string and len(chaogao10) > 2:
+            answer.append('C')
+        if 'D' in json_string and len(chaogao10) > 3:
+            answer.append('D')
+        return answer
+    completion = sfclient.chat.completions.create(
+        #model="glm-4.5-flash",
+        model=simplemodel(),
+        messages=xuanxiang(json_string),
+        extra_body={"thinking": {"type": "disabled"}},
+        #extra_body={"enable_thinking": False},
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    answer=[]
+    if 'A' in json_string and len(chaogao10) > 0:
+        answer.append('A')
+    if 'B' in json_string and len(chaogao10) > 1:
+        answer.append('B')
+    if 'C' in json_string and len(chaogao10) > 2:
+        answer.append('C')
+    if 'D' in json_string and len(chaogao10) > 3:
+        answer.append('D')
+    
+    return answer
+def select_chaogao_9(
+       B, #data
+       aiclient,
+             qwclient,
+              sfclient
+             ):
+    options=[]
+    letters = "ABCDEFGHIJKLMN"
+    for i in range(len(chaogao9)):
+        options.append("给定选项" + letters[i]+",内容为"+chaogao9[i] )
+
+    completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        #model="THUDM/GLM-Z1-9B-0414",
+        #model="ernie-speed-128k",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+            {"role": "user", "content": "超高指的是操作物高度距离楼地面5m以上的工程."},
+            {"role": "user", "content": "问题描述: 给定一段含有超高工作的内容: " + B['label'] + " " +  B['mc'] + " " + B['tz'] +  ",".join(options) + "。请选择最合适的选项,并返回字母代号,例如,返回 A。如果内容中没有明确高度,请返回A"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+        #extra_body={"enable_thinking": True},
+        #stream=True
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    if len([x for x in json_string if x != ',' and x != '[' and x != ']' and x != ' ' and (x < 'A' or x > 'M')]) < 5:
+        answer=[]
+        if 'A' in json_string and len(chaogao9) > 0:
+            answer.append('A')
+        if 'B' in json_string and len(chaogao9) > 1:
+            answer.append('B')
+        if 'C' in json_string and len(chaogao9) > 2:
+            answer.append('C')
+        if 'D' in json_string and len(chaogao9) > 3:
+            answer.append('D')
+        return answer
+    completion = sfclient.chat.completions.create(
+        #model="glm-4.5-flash",
+        model=simplemodel(),
+        messages=xuanxiang(json_string),
+        extra_body={"thinking": {"type": "disabled"}},
+        #extra_body={"enable_thinking": False},
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    answer=[]
+    if 'A' in json_string and len(chaogao9) > 0:
+        answer.append('A')
+    if 'B' in json_string and len(chaogao9) > 1:
+        answer.append('B')
+    if 'C' in json_string and len(chaogao9) > 2:
+        answer.append('C')
+    if 'D' in json_string and len(chaogao9) > 3:
+        answer.append('D')
+    
+    return answer
+
+def feiyong_chaogao(data, selected, aiclient, qwclient, sfclient):
+    a = [x for x in selected if x.startswith('4-')]
+    if len(a) > 0:
+        return ['4-F2!第四册']
+    a = [x for x in selected if x.startswith('9-')]
+    if len(a) > 0:
+        t = select_chaogao_9(data, aiclient, qwclient, sfclient)
+        if 'A' in t:
+            return ['9-F2!第九册5m以上到8m以内']
+        elif 'B' in t:
+            return ['9-F2!第九册8-12m']
+        elif 'C' in t:
+            return ['9-F2!第九册12-16m']
+        elif 'D' in t:
+            return ['9-F2!第九册16-20m']
+    a = [x for x in selected if x.startswith('10-')]
+    if len(a) > 0:
+        t = select_chaogao_10(data, aiclient, qwclient, sfclient)
+        if 'A' in t:
+            return ['10-F2!第十册3.6-8m以内']
+        elif 'B' in t:
+            return ['10-F2!第十册8-12m']
+        elif 'C' in t:
+            return ['10-F2!第十册12-16m']
+        elif 'D' in t:
+            return ['10-F2!第十册16-20m']
+    a = [x for x in selected if x.startswith('11-')]
+    if len(a) > 0:
+        t = select_chaogao_11(data, aiclient, qwclient, sfclient)
+        if 'A' in t:
+            return ['11-F2!第十一册6-20m']
+        elif 'B' in t:
+            return ['11-F2!第十一册20-30m']
+        elif 'C' in t:
+            return ['11-F2!第十一册30-40m']
+        elif 'D' in t:
+            return ['11-F2!第十一册40-50m']
+        elif 'E' in t:
+            return ['11-F2!第十一册50-60m']
+        elif 'F' in t:
+            return ['11-F2!第十一册60-70m']
+        elif 'G' in t:
+            return ['11-F2!第十一册70-80m']
+        elif 'H' in t:
+            return ['11-F2!第十一册80m以上']
+    return []
+

+ 25 - 0
huansuan.py

@@ -12,6 +12,10 @@ from huansuan0111 import callzaihuansuan0111_1
 from huansuan0111 import callzaihuansuan0111_2
 from huansuan0111 import callzaihuansuan0111_3
 from huansuan0112 import callzaihuansuan0112_1
+from huansuan0304 import callzaihuansuan030404017
+from huansuan0304 import callzaihuansuan030411001
+from huansuan0309 import callzaihuansuan030901013
+from huansuan0308 import callzaihuansuan030801
 import time
 def callzaihuansuan(bianma, label, A,B,C, aiclient, qwclient, sfclient):
     time.sleep(1)
@@ -78,6 +82,27 @@ def callzaihuansuan(bianma, label, A,B,C, aiclient, qwclient, sfclient):
         if bianma.startswith("0108"):
             if '樘' in A and 'm2' in B:
                 return callzaihuansuan0108_1(bianma, label, A, B, C, aiclient, qwclient, sfclient)
+    if bianma.startswith("030404017"):##配电箱
+        print(A)
+        print(B)
+        if '基础槽钢' in label:
+            return callzaihuansuan030404017(bianma, label, A, B, C, aiclient, qwclient, sfclient)
+    if bianma.startswith("030411001"):##配管
+        print(A)
+        print(B)
+        if '刚性防水套管' in label:
+            return callzaihuansuan030411001(bianma, label, A, B, C, aiclient, qwclient, sfclient)
+    if bianma.startswith("030901013"):##灭火器
+        print(A)
+        print(B)
+        if '灭火器' in label:
+            return callzaihuansuan030901013(bianma, label, A, B, C, aiclient, qwclient, sfclient)
+    if bianma.startswith("030801"):##工业管道
+        print(A)
+        print(B)
+        if '管道刷油' in label or '手工除锈' in label:
+            return callzaihuansuan030801(bianma, label, A, B, C, aiclient, qwclient, sfclient)
+
 
     return """
        {"answer": "0"}

+ 42 - 0
huansuan0304.py

@@ -0,0 +1,42 @@
+from template import expression
+from config import simplemodel
+def callzaihuansuan030404017(bianma, label, A,B,C, aiclient, qwclient, sfclient ):
+    completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+        {"role": "user", "content": "问题描述:  计量单位可以用名称或者符号表示,常用的符号包括表示米的符号m,表示千米的符号km,表示吨的符号t,表示千克的符号kg,表示平方米的符号m2,表示立方米的符号m3。给定一段工作内容描述,内容为" + C + ",给定其工作量计量单位,内容为" + A + ",记作A,再给定一个工作量计量单位,内容为" + B + ",记作B。若A表示数量'个',B表长度10米,且工作内容涉及配电箱,则可以计算配电箱占地的周长,作为换算系数coefficient, 最终返回A=coefficient*B。例如,工作内容描述配电箱尺寸为800*1500*600,三个数字代表长、宽、高,最大的数字1500代表高,剩下的两个数字800(mm)跟600(mm)代表占地的长方形的两条边,则周长为(800+600)*2=2800mm=2.8m。因为单位是10m,所以换算成0.28,最终你应该返回A=0.28*B。若工作内容中没有配电箱的具体尺寸,请返回A=0.2*B。"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    completion = sfclient.chat.completions.create(
+        model=simplemodel(),
+        messages=expression(json_string),
+        extra_body={"thinking": {"type": "disabled"}},
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    return json_string
+
+def callzaihuansuan030411001(bianma, label, A,B,C, aiclient, qwclient, sfclient ):
+    completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+        {"role": "user", "content": "问题描述:  计量单位可以用名称或者符号表示,常用的符号包括表示米的符号m,表示千米的符号km,表示吨的符号t,表示千克的符号kg,表示平方米的符号m2,表示立方米的符号m3。给定一段工作内容描述,内容为" + C + ",给定其工作量计量单位,内容为" + A + ",记作A,再给定一个工作量计量单位,内容为" + B + ",记作B。若A表示长度'm',B表示数量‘10个’,且工作内容涉及刚性防水套管(翼环),则应该考虑每米管道配置的翼环数目,作为换算系数coefficient, 最终返回A=coefficient*B。例如,工作内容描述翼环配置42个(默认表示每100米管道),则换算成每米为0.42个,再换算成单位‘10个’,所以换算成0.042,最终你应该返回A=0.042*B。若工作内容中没有提及具体配置,请返回A=0.1*B。"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    completion = sfclient.chat.completions.create(
+        model=simplemodel(),
+        messages=expression(json_string),
+        extra_body={"thinking": {"type": "disabled"}},
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    return json_string
+

+ 22 - 0
huansuan0308.py

@@ -0,0 +1,22 @@
+from template import expression
+from config import simplemodel
+def callzaihuansuan030801(bianma, label, A,B,C, aiclient, qwclient, sfclient ):
+    completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+        {"role": "user", "content": "问题描述:  计量单位可以用名称或者符号表示,常用的符号包括表示米的符号m,表示千米的符号km,表示吨的符号t,表示千克的符号kg,表示平方米的符号m2,表示立方米的符号m3。给定一段工作内容描述,内容为" + C + ",给定其工作量计量单位,内容为" + A + ",记作A,再给定一个工作量计量单位,内容为" + B + ",记作B。若A表示长度m,B表示面积10m2,且工作内容涉及管道,则可以分析管道直径,由直径计算圆周长,作为换算系数coefficient, 最终返回A=coefficient*B。例如,工作内容描述管道规格为D273*8,则管道外径为273mm,圆周长273*3.14=857mm,则每米管道面积为0.857m2, 因为单位是10m2,所以换算成0.0857,最终你应该返回A=0.0857*B。若工作内容中没有明确含管道外径,请返回A=0*B。"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    completion = sfclient.chat.completions.create(
+        model=simplemodel(),
+        messages=expression(json_string),
+        extra_body={"thinking": {"type": "disabled"}},
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    return json_string
+

+ 22 - 0
huansuan0309.py

@@ -0,0 +1,22 @@
+from template import expression
+from config import simplemodel
+def callzaihuansuan030901013(bianma, label, A,B,C, aiclient, qwclient, sfclient ):
+    completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+        {"role": "user", "content": "问题描述:  计量单位可以用名称或者符号表示,常用的符号包括表示米的符号m,表示千米的符号km,表示吨的符号t,表示千克的符号kg,表示平方米的符号m2,表示立方米的符号m3。给定一段工作内容描述,内容为" + C + ",给定其工作量计量单位,内容为" + A + ",记作A,再给定一个工作量计量单位,内容为" + B + ",记作B。若A表示数量'套',B表数量10具,且工作内容涉及灭火器,则可以分析每套设施含有几具灭火器,作为换算系数coefficient, 最终返回A=coefficient*B。例如,工作内容描述每套含两具灭火器,则系数为2具,因为单位是10具,所以换算成0.2,最终你应该返回A=0.2*B。若工作内容中没有明确含多少具灭火器,请返回A=0.1*B。"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    completion = sfclient.chat.completions.create(
+        model=simplemodel(),
+        messages=expression(json_string),
+        extra_body={"thinking": {"type": "disabled"}},
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    return json_string
+

+ 12 - 0
postprocess.py

@@ -12,6 +12,10 @@ from postprocess0112 import postprocess0112
 from postprocess0113 import postprocess0113
 from postprocess0114 import postprocess0114
 from postprocess0115 import postprocess0115
+from postprocess0304 import postprocess0304
+from postprocess0310 import postprocess0310
+from postprocess0308 import postprocess0308
+from postprocess0307 import postprocess0307
 from mianji import adjust
 def postprocess(selected, data, aiclient, qwclient, sfclient, label_name, name_dw, candidates,yqspecial):
     l = postprocess_(selected,data,aiclient,qwclient,sfclient,label_name,name_dw,candidates,yqspecial)
@@ -47,5 +51,13 @@ def postprocess_(selected, data, aiclient, qwclient, sfclient, label_name, name_
         return postprocess0114(selected, data, aiclient, qwclient, sfclient, label_name, name_dw, candidates)
     elif data['bianma'].startswith("0115"):
         return postprocess0115(selected, data, aiclient, qwclient, sfclient, label_name, name_dw, candidates)
+    elif data['bianma'].startswith("0304"):
+        return postprocess0304(selected, data, aiclient, qwclient, sfclient, label_name, name_dw, candidates)
+    elif data['bianma'].startswith("0310"):
+        return postprocess0310(selected, data, aiclient, qwclient, sfclient, label_name, name_dw, candidates)
+    elif data['bianma'].startswith("0308"):
+        return postprocess0308(selected, data, aiclient, qwclient, sfclient, label_name, name_dw, candidates)
+    elif data['bianma'].startswith("0307"):
+        return postprocess0307(selected, data, aiclient, qwclient, sfclient, label_name, name_dw, candidates)
     else: 
         return selected

+ 179 - 0
postprocess0304.py

@@ -0,0 +1,179 @@
+import time
+from fallback import fallback
+from config import simplemodel
+from template import xuanxiang
+from fallback import fallback
+zhijing=['公称直径(mm以内)50', '公称直径(mm以内)80', '公称直径(mm以内)100', '公称直径(mm以内)150' , '公称直径(mm以内)200', '公称直径(mm以内)250', '公称直径(mm以内)300']
+def select_zhijing(
+       B, #data
+       aiclient,
+             qwclient,
+              sfclient,
+             dw):
+    options=[]
+    letters = "ABCDEFGHIJKLMN"
+    for i in range(len(zhijing)):
+        options.append("给定选项" + letters[i]+",内容为"+zhijing[i] )
+
+    completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        #model="THUDM/GLM-Z1-9B-0414",
+        #model="ernie-speed-128k",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+            {"role": "user", "content": "问题描述: 给定一段工作内容: " + B['label'] + " " +  B['mc'] + " " + B['tz'] +  ",".join(options) + "。请选择最合适的选项,并返回字母代号,例如,返回 A"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+        #extra_body={"enable_thinking": True},
+        #stream=True
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    if len([x for x in json_string if x != ',' and x != '[' and x != ']' and x != ' ' and (x < 'A' or x > 'M')]) < 5:
+        answer=[]
+        if 'A' in json_string and len(zhijing) > 0:
+            answer.append('A')
+        if 'B' in json_string and len(zhijing) > 1:
+            answer.append('B')
+        if 'C' in json_string and len(zhijing) > 2:
+            answer.append('C')
+        if 'D' in json_string and len(zhijing) > 3:
+            answer.append('D')
+        if 'E' in json_string and len(zhijing) > 4:
+            answer.append('E')
+        if 'F' in json_string and len(zhijing) > 5:
+            answer.append('F')
+        if 'G' in json_string and len(zhijing) > 6:
+            answer.append('G')
+        return answer
+    completion = sfclient.chat.completions.create(
+        #model="glm-4.5-flash",
+        model=simplemodel(),
+        messages=xuanxiang(json_string),
+        extra_body={"thinking": {"type": "disabled"}},
+        #extra_body={"enable_thinking": False},
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    answer=[]
+    if 'A' in json_string and len(zhijing) > 0:
+        answer.append('A')
+    if 'B' in json_string and len(zhijing) > 1:
+        answer.append('B')
+    if 'C' in json_string and len(zhijing) > 2:
+        answer.append('C')
+    if 'D' in json_string and len(zhijing) > 3:
+        answer.append('D')
+    if 'E' in json_string and len(zhijing) > 4:
+        answer.append('E')
+    if 'F' in json_string and len(zhijing) > 5:
+        answer.append('F')
+    if 'G' in json_string and len(zhijing) > 6:
+        answer.append('G')
+    
+    return answer
+def aifilter1(A, #options
+       B, #data
+       aiclient,
+             qwclient,
+              sfclient,
+             dw):
+    options=[]
+    letters = "ABCDEFGHIJKLMN"
+    for i in range(len(A)):
+        options.append("给定选项" + letters[i]+",内容为"+A[i] )
+
+    completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        #model="THUDM/GLM-Z1-9B-0414",
+        #model="ernie-speed-128k",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+            {"role": "user", "content": " 特殊处理要求一:如果工作内容描述是配电箱安装,并且安装方式是悬挂而非落地式,则去掉所有基础槽钢、角钢的选项"},
+            {"role": "user", "content": " 重要提示:选项指的是给定的A、B、C之类的选项,不是指的工作内容中的可能的1、2、3这样罗列的特征"},
+            {"role": "user", "content": " 重要提示:除特殊处理要求提及的内容外,不需考虑选项内容与工作内容是否符合,只需要根据特殊处理要求做出处理"},
+            {"role": "user", "content": "问题描述: 给定一段工作内容: " + B['label'] + " " +  B['mc'] + " " + B['tz'] +  ",".join(options) + "。请根据处理要求做出处理,并返回结果, 删除选项必须对应到明确的特殊处理要求,不要擅自删除选项。例如,如果处理完后剩余A,B,C三个选项,请返回[A,B,C]"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+        #extra_body={"enable_thinking": True},
+        #stream=True
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    if len([x for x in json_string if x != ',' and x != '[' and x != ']' and x != ' ' and (x < 'A' or x > 'M')]) < 5:
+        answer=[]
+        if 'A' in json_string and len(A) > 0:
+            answer.append(A[0])
+        if 'B' in json_string and len(A) > 1:
+            answer.append(A[1])
+        if 'C' in json_string and len(A) > 2:
+            answer.append(A[2])
+        if 'D' in json_string and len(A) > 3:
+            answer.append(A[3])
+        if 'E' in json_string and len(A) > 4:
+            answer.append(A[4])
+        if 'F' in json_string and len(A) > 5:
+            answer.append(A[5])
+        if 'G' in json_string and len(A) > 6:
+            answer.append(A[6])
+        if 'H' in json_string and len(A) > 7:
+            answer.append(A[7])
+        if 'I' in json_string and len(A) > 8:
+            answer.append(A[8])
+        if 'J' in json_string and len(A) > 9:
+            answer.append(A[9])
+        return answer
+    completion = sfclient.chat.completions.create(
+        #model="glm-4.5-flash",
+        model=simplemodel(),
+        messages=xuanxiang(json_string),
+        extra_body={"thinking": {"type": "disabled"}},
+        #extra_body={"enable_thinking": False},
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    answer=[]
+    if 'A' in json_string and len(A) > 0:
+        answer.append(A[0])
+    if 'B' in json_string and len(A) > 1:
+        answer.append(A[1])
+    if 'C' in json_string and len(A) > 2:
+        answer.append(A[2])
+    if 'D' in json_string and len(A) > 3:
+        answer.append(A[3])
+    if 'E' in json_string and len(A) > 4:
+        answer.append(A[4])
+    if 'F' in json_string and len(A) > 5:
+        answer.append(A[5])
+    if 'G' in json_string and len(A) > 6:
+        answer.append(A[6])
+    if 'H' in json_string and len(A) > 7:
+        answer.append(A[7])
+    if 'I' in json_string and len(A) > 8:
+        answer.append(A[8])
+    if 'J' in json_string and len(A) > 9:
+        answer.append(A[9])
+    return answer
+
+def postprocess0304(selected, data, aiclient, qwclient, sfclient, label_name, name_dw, candidates):
+    prime = aifilter1(selected, data, aiclient, qwclient, sfclient, name_dw)
+    if data['bianma'].startswith('030411001'):#配管
+        if '翼环' in data['tz']:
+            if len([x for x in prime if '刚性防水套管' in x]) == 0:
+                t = select_zhijing(data, aiclient, qwclient, sfclient, name_dw)
+                if 'A' in t:
+                    prime.append('第十册 给排水、采暖、燃气工程 第二章 支架及其它 2.3 刚性防水套管制作、安装 刚性防水套管制作、安装 公称直径(mm以内) 50')
+                elif 'B' in t:
+                    prime.append('第十册 给排水、采暖、燃气工程 第二章 支架及其它 2.3 刚性防水套管制作、安装 刚性防水套管制作、安装 公称直径(mm以内) 80')
+                elif 'C' in t:
+                    prime.append('第十册 给排水、采暖、燃气工程 第二章 支架及其它 2.3 刚性防水套管制作、安装 刚性防水套管制作、安装 公称直径(mm以内) 100')
+                elif 'D' in t:
+                    prime.append('第十册 给排水、采暖、燃气工程 第二章 支架及其它 2.3 刚性防水套管制作、安装 刚性防水套管制作、安装 公称直径(mm以内) 150')
+                elif 'E' in t:
+                    prime.append('第十册 给排水、采暖、燃气工程 第二章 支架及其它 2.3 刚性防水套管制作、安装 刚性防水套管制作、安装 公称直径(mm以内) 200')
+                elif 'F' in t:
+                    prime.append('第十册 给排水、采暖、燃气工程 第二章 支架及其它 2.3 刚性防水套管制作、安装 刚性防水套管制作、安装 公称直径(mm以内) 250')
+                elif 'G' in t:
+                    prime.append('第十册 给排水、采暖、燃气工程 第二章 支架及其它 2.3 刚性防水套管制作、安装 刚性防水套管制作、安装 公称直径(mm以内) 300')
+
+    return prime

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 6 - 0
postprocess0307.py


+ 397 - 0
postprocess0308.py

@@ -0,0 +1,397 @@
+import time
+from fallback import fallback
+from config import simplemodel
+from template import xuanxiang
+from fallback import fallback
+zhijing=['公称直径(mm以内)15', '公称直径(mm以内)20', '公称直径(mm以内)25', '公称直径(mm以内)32' , '公称直径(mm以内)40', '公称直径(mm以内)50', '公称直径(mm以内)65',  '公称直径(mm以内)80',  '公称直径(mm以内)100',  '公称直径(mm以内)125',  '公称直径(mm以内)150',  '公称直径(mm以内)200',  '公称直径(mm以内)250',  '公称直径(mm以内)300',  '公称直径(mm以内)350',  '公称直径(mm以内)400',  '公称直径(mm以内)450',  '公称直径(mm以内)500']
+kqcs=['公称直径(mm以内)50', '公称直径(mm以内)100', '公称直径(mm以内)200', '公称直径(mm以内)300', '公称直径(mm以内)400', '公称直径(mm以内)500', '公称直径(mm以内)600']
+def select_chuisao(
+       B, #data
+       aiclient,
+             qwclient,
+              sfclient,
+             dw):
+    options=[]
+    letters = "ABCDEFGHIJKLMNOPQR"
+    for i in range(len(kqcs)):
+        options.append("给定选项" + letters[i]+",内容为"+kqcs[i] )
+
+    completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        #model="THUDM/GLM-Z1-9B-0414",
+        #model="ernie-speed-128k",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+            {"role": "user", "content": "背景知识:管道规格D273*8表示管径273mm,壁厚8mm"},
+            {"role": "user", "content": "问题描述: 给定一段工作内容: " + B['label'] + " " +  B['mc'] + " " + B['tz'] +  ",".join(options) + "。请选择最合适的选项,并返回字母代号,例如,返回 A"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+        #extra_body={"enable_thinking": True},
+        #stream=True
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    if len([x for x in json_string if x != ',' and x != '[' and x != ']' and x != ' ' and (x < 'A' or x > 'R')]) < 5:
+        answer=[]
+        if 'A' in json_string and len(kqcs) > 0:
+            answer.append('A')
+        if 'B' in json_string and len(kqcs) > 1:
+            answer.append('B')
+        if 'C' in json_string and len(kqcs) > 2:
+            answer.append('C')
+        if 'D' in json_string and len(kqcs) > 3:
+            answer.append('D')
+        if 'E' in json_string and len(kqcs) > 4:
+            answer.append('E')
+        if 'F' in json_string and len(kqcs) > 5:
+            answer.append('F')
+        if 'G' in json_string and len(kqcs) > 6:
+            answer.append('G')
+        return answer
+    completion = sfclient.chat.completions.create(
+        #model="glm-4.5-flash",
+        model=simplemodel(),
+        messages=xuanxiang(json_string),
+        extra_body={"thinking": {"type": "disabled"}},
+        #extra_body={"enable_thinking": False},
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    answer=[]
+    if 'A' in json_string and len(kqcs) > 0:
+        answer.append('A')
+    if 'B' in json_string and len(kqcs) > 1:
+        answer.append('B')
+    if 'C' in json_string and len(kqcs) > 2:
+        answer.append('C')
+    if 'D' in json_string and len(kqcs) > 3:
+        answer.append('D')
+    if 'E' in json_string and len(kqcs) > 4:
+        answer.append('E')
+    if 'F' in json_string and len(kqcs) > 5:
+        answer.append('F')
+    if 'G' in json_string and len(kqcs) > 6:
+        answer.append('G')
+    
+    return answer
+def youqi(
+       B, #data
+       aiclient,
+             qwclient,
+              sfclient,
+             dw):
+
+    completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        #model="THUDM/GLM-Z1-9B-0414",
+        #model="ernie-speed-128k",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+            {"role": "user", "content": "问题描述: 给定一段工作内容: " + B['label'] + " " +  B['mc'] + " " + B['tz'] +  '\n请问,工作内容是否要求管道刷油漆?请回答是或者否'},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+        #extra_body={"enable_thinking": True},
+        #stream=True
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    if '否' in json_string:
+        return False
+    return True
+def kongqichuisao(
+       B, #data
+       aiclient,
+             qwclient,
+              sfclient,
+             dw):
+    if B['bianma'].startswith('030804'):
+        return False
+    options=[]
+    letters = "ABCDEFG"
+    for i in range(len(kqcs)):
+        options.append("给定选项" + letters[i]+",内容为"+kqcs[i] )
+    print('判断空气吹扫')
+    completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        #model="THUDM/GLM-Z1-9B-0414",
+        #model="ernie-speed-128k",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+            {"role": "user", "content": "背景知识:管道规格D273*8表示管径273mm,壁厚8mm"},
+            {"role": "user", "content": "问题描述: 给定一段工作内容: " + B['label'] + " " +  B['mc'] + " " + B['tz'] +  '\n请问,工作内容是否明确要求空气吹扫?请回答是或者否'},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+        #extra_body={"enable_thinking": True},
+        #stream=True
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    if '否' in json_string:
+        return False
+    return True
+def select_zhijing(
+       B, #data
+       aiclient,
+             qwclient,
+              sfclient,
+             dw):
+    options=[]
+    letters = "ABCDEFGHIJKLMNOPQR"
+    for i in range(len(zhijing)):
+        options.append("给定选项" + letters[i]+",内容为"+zhijing[i] )
+
+    completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        #model="THUDM/GLM-Z1-9B-0414",
+        #model="ernie-speed-128k",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+            {"role": "user", "content": "背景知识:管道规格D273*8表示管径273mm,壁厚8mm"},
+            {"role": "user", "content": "问题描述: 给定一段工作内容: " + B['label'] + " " +  B['mc'] + " " + B['tz'] +  ",".join(options) + "。请选择最合适的选项,并返回字母代号,例如,返回 A"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+        #extra_body={"enable_thinking": True},
+        #stream=True
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    if len([x for x in json_string if x != ',' and x != '[' and x != ']' and x != ' ' and (x < 'A' or x > 'R')]) < 5:
+        answer=[]
+        if 'A' in json_string and len(zhijing) > 0:
+            answer.append('A')
+        if 'B' in json_string and len(zhijing) > 1:
+            answer.append('B')
+        if 'C' in json_string and len(zhijing) > 2:
+            answer.append('C')
+        if 'D' in json_string and len(zhijing) > 3:
+            answer.append('D')
+        if 'E' in json_string and len(zhijing) > 4:
+            answer.append('E')
+        if 'F' in json_string and len(zhijing) > 5:
+            answer.append('F')
+        if 'G' in json_string and len(zhijing) > 6:
+            answer.append('G')
+        if 'H' in json_string and len(zhijing) > 7:
+            answer.append('H')
+        if 'I' in json_string and len(zhijing) > 8:
+            answer.append('I')
+        if 'J' in json_string and len(zhijing) > 9:
+            answer.append('J')
+        if 'K' in json_string and len(zhijing) > 10:
+            answer.append('K')
+        if 'L' in json_string and len(zhijing) > 11:
+            answer.append('L')
+        if 'M' in json_string and len(zhijing) > 12:
+            answer.append('M')
+        if 'N' in json_string and len(zhijing) > 13:
+            answer.append('N')
+        if 'O' in json_string and len(zhijing) > 14:
+            answer.append('O')
+        if 'P' in json_string and len(zhijing) > 15:
+            answer.append('P')
+        if 'Q' in json_string and len(zhijing) > 16:
+            answer.append('Q')
+        if 'R' in json_string and len(zhijing) > 17:
+            answer.append('R')
+        return answer
+    completion = sfclient.chat.completions.create(
+        #model="glm-4.5-flash",
+        model=simplemodel(),
+        messages=xuanxiang(json_string),
+        extra_body={"thinking": {"type": "disabled"}},
+        #extra_body={"enable_thinking": False},
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    answer=[]
+    if 'A' in json_string and len(zhijing) > 0:
+        answer.append('A')
+    if 'B' in json_string and len(zhijing) > 1:
+        answer.append('B')
+    if 'C' in json_string and len(zhijing) > 2:
+        answer.append('C')
+    if 'D' in json_string and len(zhijing) > 3:
+        answer.append('D')
+    if 'E' in json_string and len(zhijing) > 4:
+        answer.append('E')
+    if 'F' in json_string and len(zhijing) > 5:
+        answer.append('F')
+    if 'G' in json_string and len(zhijing) > 6:
+        answer.append('G')
+    if 'H' in json_string and len(zhijing) > 7:
+        answer.append('H')
+    if 'I' in json_string and len(zhijing) > 8:
+        answer.append('I')
+    if 'J' in json_string and len(zhijing) > 9:
+        answer.append('J')
+    if 'K' in json_string and len(zhijing) > 10:
+        answer.append('K')
+    if 'L' in json_string and len(zhijing) > 11:
+        answer.append('L')
+    if 'M' in json_string and len(zhijing) > 12:
+        answer.append('M')
+    if 'N' in json_string and len(zhijing) > 13:
+        answer.append('N')
+    if 'O' in json_string and len(zhijing) > 14:
+        answer.append('O')
+    if 'P' in json_string and len(zhijing) > 15:
+        answer.append('P')
+    if 'Q' in json_string and len(zhijing) > 16:
+        answer.append('Q')
+    if 'R' in json_string and len(zhijing) > 17:
+        answer.append('R')
+    
+    return answer
+def aifilter1(A, #options
+       B, #data
+       aiclient,
+             qwclient,
+              sfclient,
+             dw):
+    options=[]
+    letters = "ABCDEFGHIJKLMN"
+    for i in range(len(A)):
+        options.append("给定选项" + letters[i]+",内容为"+A[i] )
+
+    completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        #model="THUDM/GLM-Z1-9B-0414",
+        #model="ernie-speed-128k",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+            {"role": "user", "content": " 特殊处理要求一:如果工作内容描述没有提及管道冲洗,则去掉所有管道冲洗的选项"},
+            {"role": "user", "content": " 重要提示:选项指的是给定的A、B、C之类的选项,不是指的工作内容中的可能的1、2、3这样罗列的特征"},
+            {"role": "user", "content": " 重要提示:除特殊处理要求提及的内容外,不需考虑选项内容与工作内容是否符合,只需要根据特殊处理要求做出处理"},
+            {"role": "user", "content": "问题描述: 给定一段工作内容: " + B['label'] + " " +  B['mc'] + " " + B['tz'] +  ",".join(options) + "。请根据处理要求做出处理,并返回结果, 删除选项必须对应到明确的特殊处理要求,不要擅自删除选项。例如,如果处理完后剩余A,B,C三个选项,请返回[A,B,C]"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+        #extra_body={"enable_thinking": True},
+        #stream=True
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    if len([x for x in json_string if x != ',' and x != '[' and x != ']' and x != ' ' and (x < 'A' or x > 'M')]) < 5:
+        answer=[]
+        if 'A' in json_string and len(A) > 0:
+            answer.append(A[0])
+        if 'B' in json_string and len(A) > 1:
+            answer.append(A[1])
+        if 'C' in json_string and len(A) > 2:
+            answer.append(A[2])
+        if 'D' in json_string and len(A) > 3:
+            answer.append(A[3])
+        if 'E' in json_string and len(A) > 4:
+            answer.append(A[4])
+        if 'F' in json_string and len(A) > 5:
+            answer.append(A[5])
+        if 'G' in json_string and len(A) > 6:
+            answer.append(A[6])
+        if 'H' in json_string and len(A) > 7:
+            answer.append(A[7])
+        if 'I' in json_string and len(A) > 8:
+            answer.append(A[8])
+        if 'J' in json_string and len(A) > 9:
+            answer.append(A[9])
+        return answer
+    completion = sfclient.chat.completions.create(
+        #model="glm-4.5-flash",
+        model=simplemodel(),
+        messages=xuanxiang(json_string),
+        extra_body={"thinking": {"type": "disabled"}},
+        #extra_body={"enable_thinking": False},
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    answer=[]
+    if 'A' in json_string and len(A) > 0:
+        answer.append(A[0])
+    if 'B' in json_string and len(A) > 1:
+        answer.append(A[1])
+    if 'C' in json_string and len(A) > 2:
+        answer.append(A[2])
+    if 'D' in json_string and len(A) > 3:
+        answer.append(A[3])
+    if 'E' in json_string and len(A) > 4:
+        answer.append(A[4])
+    if 'F' in json_string and len(A) > 5:
+        answer.append(A[5])
+    if 'G' in json_string and len(A) > 6:
+        answer.append(A[6])
+    if 'H' in json_string and len(A) > 7:
+        answer.append(A[7])
+    if 'I' in json_string and len(A) > 8:
+        answer.append(A[8])
+    if 'J' in json_string and len(A) > 9:
+        answer.append(A[9])
+    return answer
+
+def postprocess0308(selected, data, aiclient, qwclient, sfclient, label_name, name_dw, candidates):
+    prime = selected
+    if len([x for x in selected if ' 低压碳钢管(电弧焊)' in x]) > 0:
+        prime = [x for x in prime if ' 低压碳钢管(电弧焊)' not in x]
+        option = select_zhijing(data, aiclient, qwclient, sfclient, name_dw)
+        if 'A' in option:
+            prime.append('第八册 工业管道工程 第一章 管道安装 1.1 低压管道 1.1.5 碳钢管(电弧焊) 低压碳钢管(电弧焊) 公称直径(mm以内) 15')
+        elif 'B' in option:
+            prime.append('第八册 工业管道工程 第一章 管道安装 1.1 低压管道 1.1.5 碳钢管(电弧焊) 低压碳钢管(电弧焊) 公称直径(mm以内) 20')
+        elif 'C' in option:
+            prime.append('第八册 工业管道工程 第一章 管道安装 1.1 低压管道 1.1.5 碳钢管(电弧焊) 低压碳钢管(电弧焊) 公称直径(mm以内) 25')
+        elif 'D' in option:
+            prime.append('第八册 工业管道工程 第一章 管道安装 1.1 低压管道 1.1.5 碳钢管(电弧焊) 低压碳钢管(电弧焊) 公称直径(mm以内) 32')
+        elif 'E' in option:
+            prime.append('第八册 工业管道工程 第一章 管道安装 1.1 低压管道 1.1.5 碳钢管(电弧焊) 低压碳钢管(电弧焊) 公称直径(mm以内) 40')
+        elif 'F' in option:
+            prime.append('第八册 工业管道工程 第一章 管道安装 1.1 低压管道 1.1.5 碳钢管(电弧焊) 低压碳钢管(电弧焊) 公称直径(mm以内) 50')
+        elif 'G' in option:
+            prime.append('第八册 工业管道工程 第一章 管道安装 1.1 低压管道 1.1.5 碳钢管(电弧焊) 低压碳钢管(电弧焊) 公称直径(mm以内) 65')
+        elif 'H' in option:
+            prime.append('第八册 工业管道工程 第一章 管道安装 1.1 低压管道 1.1.5 碳钢管(电弧焊) 低压碳钢管(电弧焊) 公称直径(mm以内) 80')
+        elif 'I' in option:
+            prime.append('第八册 工业管道工程 第一章 管道安装 1.1 低压管道 1.1.5 碳钢管(电弧焊) 低压碳钢管(电弧焊) 公称直径(mm以内) 100')
+        elif 'J' in option:
+            prime.append('第八册 工业管道工程 第一章 管道安装 1.1 低压管道 1.1.5 碳钢管(电弧焊) 低压碳钢管(电弧焊) 公称直径(mm以内) 125')
+        elif 'K' in option:
+            prime.append('第八册 工业管道工程 第一章 管道安装 1.1 低压管道 1.1.5 碳钢管(电弧焊) 低压碳钢管(电弧焊) 公称直径(mm以内) 150')
+        elif 'L' in option:
+            prime.append('第八册 工业管道工程 第一章 管道安装 1.1 低压管道 1.1.5 碳钢管(电弧焊) 低压碳钢管(电弧焊) 公称直径(mm以内) 200')
+        elif 'M' in option:
+            prime.append('第八册 工业管道工程 第一章 管道安装 1.1 低压管道 1.1.5 碳钢管(电弧焊) 低压碳钢管(电弧焊) 公称直径(mm以内) 250')
+        elif 'N' in option:
+            prime.append('第八册 工业管道工程 第一章 管道安装 1.1 低压管道 1.1.5 碳钢管(电弧焊) 低压碳钢管(电弧焊) 公称直径(mm以内) 300')
+        elif 'O' in option:
+            prime.append('第八册 工业管道工程 第一章 管道安装 1.1 低压管道 1.1.5 碳钢管(电弧焊) 低压碳钢管(电弧焊) 公称直径(mm以内) 350')
+        elif 'P' in option:
+            prime.append('第八册 工业管道工程 第一章 管道安装 1.1 低压管道 1.1.5 碳钢管(电弧焊) 低压碳钢管(电弧焊) 公称直径(mm以内) 400')
+        elif 'Q' in option:
+            prime.append('第八册 工业管道工程 第一章 管道安装 1.1 低压管道 1.1.5 碳钢管(电弧焊) 低压碳钢管(电弧焊) 公称直径(mm以内) 450')
+        elif 'R' in option:
+            prime.append('第八册 工业管道工程 第一章 管道安装 1.1 低压管道 1.1.5 碳钢管(电弧焊) 低压碳钢管(电弧焊) 公称直径(mm以内) 500')
+
+    if data['bianma'].startswith('030801'):
+        prime = [x for x in prime if '管件' not in x]
+    if kongqichuisao(data, aiclient, qwclient, sfclient, name_dw):
+        prime = [x for x in prime if '空气吹扫' not in x]
+        t = select_chuisao(data, aiclient, qwclient, sfclient, name_dw)
+        if 'A' in t:
+            prime.append('第八册 工业管道工程 第六章 管道压力试验、吹扫与清洗 6.2 管道系统吹扫 6.2.2 空气吹扫 管道系统空气吹扫 公称直径(mm以内) 50')
+        elif 'B' in t:
+            prime.append('第八册 工业管道工程 第六章 管道压力试验、吹扫与清洗 6.2 管道系统吹扫 6.2.2 空气吹扫 管道系统空气吹扫 公称直径(mm以内) 100')
+        elif 'C' in t:
+            prime.append('第八册 工业管道工程 第六章 管道压力试验、吹扫与清洗 6.2 管道系统吹扫 6.2.2 空气吹扫 管道系统空气吹扫 公称直径(mm以内) 200')
+        elif 'D' in t:
+            prime.append('第八册 工业管道工程 第六章 管道压力试验、吹扫与清洗 6.2 管道系统吹扫 6.2.2 空气吹扫 管道系统空气吹扫 公称直径(mm以内) 300')
+        elif 'E' in t:
+            prime.append('第八册 工业管道工程 第六章 管道压力试验、吹扫与清洗 6.2 管道系统吹扫 6.2.2 空气吹扫 管道系统空气吹扫 公称直径(mm以内) 400')
+        elif 'F' in t:
+            prime.append('第八册 工业管道工程 第六章 管道压力试验、吹扫与清洗 6.2 管道系统吹扫 6.2.2 空气吹扫 管道系统空气吹扫 公称直径(mm以内) 500')
+        elif 'G' in t:
+            prime.append('第八册 工业管道工程 第六章 管道压力试验、吹扫与清洗 6.2 管道系统吹扫 6.2.2 空气吹扫 管道系统空气吹扫 公称直径(mm以内) 600')
+
+    
+    else:
+        print(prime)
+        print('clear chuisao')
+        prime = [x for x in prime if '空气吹扫' not in x]
+    if youqi(data, aiclient, qwclient, sfclient, name_dw):
+        prime = prime + ['第十一册 刷油、防腐蚀、绝热工程 第二章 刷油工程 2.1 管道刷油 管道刷油 防锈漆 第一遍', '第十一册 刷油、防腐蚀、绝热工程 第二章 刷油工程 2.1 管道刷油 管道刷油 防锈漆 第二遍', '第十一册 刷油、防腐蚀、绝热工程 第二章 刷油工程 2.1 管道刷油 管道刷油 调和漆 第一遍', '第十一册 刷油、防腐蚀、绝热工程 第二章 刷油工程 2.1 管道刷油 管道刷油 调和漆 第二遍']
+    return list(set(prime))

+ 160 - 0
postprocess0310.py

@@ -0,0 +1,160 @@
+import time
+from fallback import fallback
+from config import simplemodel
+from template import xuanxiang
+from fallback import fallback
+zhijing=['公称直径(mm以内)50', '公称直径(mm以内)80', '公称直径(mm以内)100', '公称直径(mm以内)150' , '公称直径(mm以内)200', '公称直径(mm以内)250', '公称直径(mm以内)300']
+def select_zhijing(
+       B, #data
+       aiclient,
+             qwclient,
+              sfclient,
+             dw):
+    options=[]
+    letters = "ABCDEFGHIJKLMN"
+    for i in range(len(zhijing)):
+        options.append("给定选项" + letters[i]+",内容为"+zhijing[i] )
+
+    completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        #model="THUDM/GLM-Z1-9B-0414",
+        #model="ernie-speed-128k",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+            {"role": "user", "content": "问题描述: 给定一段工作内容: " + B['label'] + " " +  B['mc'] + " " + B['tz'] +  ",".join(options) + "。请选择最合适的选项,并返回字母代号,例如,返回 A"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+        #extra_body={"enable_thinking": True},
+        #stream=True
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    if len([x for x in json_string if x != ',' and x != '[' and x != ']' and x != ' ' and (x < 'A' or x > 'M')]) < 5:
+        answer=[]
+        if 'A' in json_string and len(zhijing) > 0:
+            answer.append('A')
+        if 'B' in json_string and len(zhijing) > 1:
+            answer.append('B')
+        if 'C' in json_string and len(zhijing) > 2:
+            answer.append('C')
+        if 'D' in json_string and len(zhijing) > 3:
+            answer.append('D')
+        if 'E' in json_string and len(zhijing) > 4:
+            answer.append('E')
+        if 'F' in json_string and len(zhijing) > 5:
+            answer.append('F')
+        if 'G' in json_string and len(zhijing) > 6:
+            answer.append('G')
+        return answer
+    completion = sfclient.chat.completions.create(
+        #model="glm-4.5-flash",
+        model=simplemodel(),
+        messages=xuanxiang(json_string),
+        extra_body={"thinking": {"type": "disabled"}},
+        #extra_body={"enable_thinking": False},
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    answer=[]
+    if 'A' in json_string and len(zhijing) > 0:
+        answer.append('A')
+    if 'B' in json_string and len(zhijing) > 1:
+        answer.append('B')
+    if 'C' in json_string and len(zhijing) > 2:
+        answer.append('C')
+    if 'D' in json_string and len(zhijing) > 3:
+        answer.append('D')
+    if 'E' in json_string and len(zhijing) > 4:
+        answer.append('E')
+    if 'F' in json_string and len(zhijing) > 5:
+        answer.append('F')
+    if 'G' in json_string and len(zhijing) > 6:
+        answer.append('G')
+    
+    return answer
+def aifilter1(A, #options
+       B, #data
+       aiclient,
+             qwclient,
+              sfclient,
+             dw):
+    options=[]
+    letters = "ABCDEFGHIJKLMN"
+    for i in range(len(A)):
+        options.append("给定选项" + letters[i]+",内容为"+A[i] )
+
+    completion = aiclient.chat.completions.create(
+        model="glm-4.5-air",
+        #model="THUDM/GLM-Z1-9B-0414",
+        #model="ernie-speed-128k",
+        messages=[
+            {"role": "system", "content": "You are a helpful assistant."},
+            {"role": "user", "content": " 特殊处理要求一:如果工作内容描述没有提及管道冲洗,则去掉所有管道冲洗的选项"},
+            {"role": "user", "content": " 重要提示:选项指的是给定的A、B、C之类的选项,不是指的工作内容中的可能的1、2、3这样罗列的特征"},
+            {"role": "user", "content": " 重要提示:除特殊处理要求提及的内容外,不需考虑选项内容与工作内容是否符合,只需要根据特殊处理要求做出处理"},
+            {"role": "user", "content": "问题描述: 给定一段工作内容: " + B['label'] + " " +  B['mc'] + " " + B['tz'] +  ",".join(options) + "。请根据处理要求做出处理,并返回结果, 删除选项必须对应到明确的特殊处理要求,不要擅自删除选项。例如,如果处理完后剩余A,B,C三个选项,请返回[A,B,C]"},
+        ],
+        extra_body={"thinking": {"type": "disabled"}},
+        #extra_body={"enable_thinking": True},
+        #stream=True
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    if len([x for x in json_string if x != ',' and x != '[' and x != ']' and x != ' ' and (x < 'A' or x > 'M')]) < 5:
+        answer=[]
+        if 'A' in json_string and len(A) > 0:
+            answer.append(A[0])
+        if 'B' in json_string and len(A) > 1:
+            answer.append(A[1])
+        if 'C' in json_string and len(A) > 2:
+            answer.append(A[2])
+        if 'D' in json_string and len(A) > 3:
+            answer.append(A[3])
+        if 'E' in json_string and len(A) > 4:
+            answer.append(A[4])
+        if 'F' in json_string and len(A) > 5:
+            answer.append(A[5])
+        if 'G' in json_string and len(A) > 6:
+            answer.append(A[6])
+        if 'H' in json_string and len(A) > 7:
+            answer.append(A[7])
+        if 'I' in json_string and len(A) > 8:
+            answer.append(A[8])
+        if 'J' in json_string and len(A) > 9:
+            answer.append(A[9])
+        return answer
+    completion = sfclient.chat.completions.create(
+        #model="glm-4.5-flash",
+        model=simplemodel(),
+        messages=xuanxiang(json_string),
+        extra_body={"thinking": {"type": "disabled"}},
+        #extra_body={"enable_thinking": False},
+    )
+    json_string = completion.choices[0].message.content
+    print(json_string)
+    answer=[]
+    if 'A' in json_string and len(A) > 0:
+        answer.append(A[0])
+    if 'B' in json_string and len(A) > 1:
+        answer.append(A[1])
+    if 'C' in json_string and len(A) > 2:
+        answer.append(A[2])
+    if 'D' in json_string and len(A) > 3:
+        answer.append(A[3])
+    if 'E' in json_string and len(A) > 4:
+        answer.append(A[4])
+    if 'F' in json_string and len(A) > 5:
+        answer.append(A[5])
+    if 'G' in json_string and len(A) > 6:
+        answer.append(A[6])
+    if 'H' in json_string and len(A) > 7:
+        answer.append(A[7])
+    if 'I' in json_string and len(A) > 8:
+        answer.append(A[8])
+    if 'J' in json_string and len(A) > 9:
+        answer.append(A[9])
+    return answer
+
+def postprocess0310(selected, data, aiclient, qwclient, sfclient, label_name, name_dw, candidates):
+    prime = aifilter1(selected, data, aiclient, qwclient, sfclient, name_dw)
+    return prime

+ 38 - 2
server.js

@@ -45,7 +45,41 @@ app.post('/api/transform', (req, res) => {
    }])
    let result = copy(data['result'])
    delete data.result
-   for (let i = 0; i < result.length; i++) {
+   if (data['bianma'].startsWith('031301017')){
+      console.log('安装脚手架');
+      let de04=result.filter(x=>x['清单编码'].startsWith('0304'));
+      let json_ = "{\"reverse\": \"2076\", \"DEBH\": {\"111\": \"4-F1\"}, \"GCLMC\": {\"111\": \"第四册\"}, \"DW\": {\"111\": \"项\"}, \"rgde\": [], \"jxde\": [], \"clde\": [], \"actual_zhuanye\": 30, \"bz_selected\": {\"BZBH\": {}}, \"bz_selected2\": {\"BZBH\": {}}}"
+      Service.azfy_mock("1", json_, de04)
+      let de05=result.filter(x=>x['清单编码'].startsWith('0305'));
+      json_ = "{\"reverse\": \"2076\", \"DEBH\": {\"111\": \"5-F1\"}, \"GCLMC\": {\"111\": \"第五册\"}, \"DW\": {\"111\": \"项\"}, \"rgde\": [], \"jxde\": [], \"clde\": [], \"actual_zhuanye\": 30, \"bz_selected\": {\"BZBH\": {}}, \"bz_selected2\": {\"BZBH\": {}}}"
+      Service.azfy_mock("1", json_, de05)
+      let de06=result.filter(x=>x['清单编码'].startsWith('0306'));
+      json_ = "{\"reverse\": \"2076\", \"DEBH\": {\"111\": \"6-F1\"}, \"GCLMC\": {\"111\": \"第六册\"}, \"DW\": {\"111\": \"项\"}, \"rgde\": [], \"jxde\": [], \"clde\": [], \"actual_zhuanye\": 30, \"bz_selected\": {\"BZBH\": {}}, \"bz_selected2\": {\"BZBH\": {}}}"
+      Service.azfy_mock("1", json_, de06)
+      let de07=result.filter(x=>x['清单编码'].startsWith('0307'));
+      json_ = "{\"reverse\": \"2076\", \"DEBH\": {\"111\": \"7-F1\"}, \"GCLMC\": {\"111\": \"第七册\"}, \"DW\": {\"111\": \"项\"}, \"rgde\": [], \"jxde\": [], \"clde\": [], \"actual_zhuanye\": 30, \"bz_selected\": {\"BZBH\": {}}, \"bz_selected2\": {\"BZBH\": {}}}"
+      Service.azfy_mock("1", json_, de07)
+      let de08=result.filter(x=>x['清单编码'].startsWith('0308'));
+      json_ = "{\"reverse\": \"2076\", \"DEBH\": {\"111\": \"8-F1\"}, \"GCLMC\": {\"111\": \"第八册\"}, \"DW\": {\"111\": \"项\"}, \"rgde\": [], \"jxde\": [], \"clde\": [], \"actual_zhuanye\": 30, \"bz_selected\": {\"BZBH\": {}}, \"bz_selected2\": {\"BZBH\": {}}}"
+      Service.azfy_mock("1", json_, de08)
+      let de09=result.filter(x=>x['清单编码'].startsWith('0309'));
+      json_ = "{\"reverse\": \"2076\", \"DEBH\": {\"111\": \"9-F1\"}, \"GCLMC\": {\"111\": \"第九册\"}, \"DW\": {\"111\": \"项\"}, \"rgde\": [], \"jxde\": [], \"clde\": [], \"actual_zhuanye\": 30, \"bz_selected\": {\"BZBH\": {}}, \"bz_selected2\": {\"BZBH\": {}}}"
+      Service.azfy_mock("1", json_, de09)
+      let de10=result.filter(x=>x['清单编码'].startsWith('0310'));
+      json_ = "{\"reverse\": \"2076\", \"DEBH\": {\"111\": \"10-F1\"}, \"GCLMC\": {\"111\": \"第十册\"}, \"DW\": {\"111\": \"项\"}, \"rgde\": [], \"jxde\": [], \"clde\": [], \"actual_zhuanye\": 30, \"bz_selected\": {\"BZBH\": {}}, \"bz_selected2\": {\"BZBH\": {}}}"
+      Service.azfy_mock("1", json_, de10)
+      let de111=result.filter(x=>x['清单编码'].startsWith('031201'));
+      json_ = "{\"reverse\": \"2076\", \"DEBH\": {\"111\": \"11-F1\"}, \"GCLMC\": {\"111\": \"第十一册刷油工程(定额11-51~11-329)\"}, \"DW\": {\"111\": \"项\"}, \"rgde\": [], \"jxde\": [], \"clde\": [], \"actual_zhuanye\": 30, \"bz_selected\": {\"BZBH\": {}}, \"bz_selected2\": {\"BZBH\": {}}}"
+      Service.azfy_mock("1", json_, de111)
+      let de112=result.filter(x=>x['清单编码'].startsWith('031202') || x['清单编码'].startsWith('031203') || x['清单编码'].startsWith('031204') || x['清单编码'].startsWith('031205') || x['清单编码'].startsWith('031206') || x['清单编码'].startsWith('031207'));
+      json_ = "{\"reverse\": \"2076\", \"DEBH\": {\"111\": \"11-F1\"}, \"GCLMC\": {\"111\": \"第十一册防腐蚀工程(定额11-330~11-1689)\"}, \"DW\": {\"111\": \"项\"}, \"rgde\": [], \"jxde\": [], \"clde\": [], \"actual_zhuanye\": 30, \"bz_selected\": {\"BZBH\": {}}, \"bz_selected2\": {\"BZBH\": {}}}"
+      Service.azfy_mock("1", json_, de112)
+      let de113=result.filter(x=>x['清单编码'].startsWith('031208'));
+      json_ = "{\"reverse\": \"2076\", \"DEBH\": {\"111\": \"11-F1\"}, \"GCLMC\": {\"111\": \"第十一册绝热工程(定额11-1690~11-2327)\"}, \"DW\": {\"111\": \"项\"}, \"rgde\": [], \"jxde\": [], \"clde\": [], \"actual_zhuanye\": 30, \"bz_selected\": {\"BZBH\": {}}, \"bz_selected2\": {\"BZBH\": {}}}"
+      Service.azfy_mock("1", json_, de113)
+   }
+   else{
+	for (let i = 0; i < result.length; i++) {
        console.log(result[i][0])
        console.log(result[i][1])
        console.log((result[i][2]))
@@ -111,7 +145,9 @@ app.post('/api/transform', (req, res) => {
    if (data['extra'].length >= 4) {
         Service.danxiangdinge("1", data['n'], data['extra'])
    }
-   //console.log(Service.cache)
+   if (data['fy']=='{}'){}
+   else Service.changguidinge(JSON.parse(data['fy']), "1")
+   }
    res.status(200).send(Service.cache);
 });
 app.listen(3000, () => {

+ 164 - 33
tasks.py

@@ -1,5 +1,7 @@
 import time
 from tihuan import tihuan
+from tihuan_az import tihuan_az
+from buchong import buchong
 from fuzhu_util import fuzhu_util
 from f_youqi import f_youqi
 import re
@@ -17,6 +19,13 @@ from huansuan import callzaihuansuan
 import json
 import dedata
 import chromadb
+from feiyong import feiyong_chaogao
+from pymongo import MongoClient
+from anzhuangjsj import anzhuangjsj
+uri="mongodb://owner:Pheecian1@47.101.198.30:27017/baojia"
+mongoclient=MongoClient(uri)
+db = mongoclient['baojia']
+dbcollection=db['qdxm']
 print("chroma")
 client = chromadb.HttpClient(host='47.101.198.30',port=8000)
 collection = client.get_or_create_collection(name="tj_de_bge", metadata={'hnsw:search_ef':15})
@@ -27,12 +36,12 @@ qita_collection = client.get_or_create_collection(name="tj_qita_bge")
 from FlagEmbedding import FlagModel
 print("model")
 azmodel = FlagModel('/mnt/d/Develop/az/az_encoder_only_base_bge-large-zh-v1.5')
-model = None # FlagModel('/mnt/d/Develop/az/az_encoder_only_base_bge-large-zh-v1.5')
-cuoshi_model = None  #FlagModel('cuoshi_encoder_only_base_bge-large-zh-v1.5/cuoshi_encoder_only_base_bge-large-zh-v1.5')
+model = FlagModel('/mnt/d/Develop/bge/test2_encoder_only_base_bge-large-zh-v1.5')
+cuoshi_model = FlagModel('cuoshi_encoder_only_base_bge-large-zh-v1.5/cuoshi_encoder_only_base_bge-large-zh-v1.5')
 from sentence_transformers import CrossEncoder
-azce = CrossEncoder('/mnt/d/Develop/az/models/reranker-chinese-macbert-large-gooaq-bce-3/final')
-ce = None #CrossEncoder('/mnt/d/Develop/az/models/reranker-chinese-macbert-large-gooaq-bce/final')
-cuoshi_ce = None #CrossEncoder('cuoshi_reranker/final')
+azce = CrossEncoder('/mnt/d/Develop/az/models/reranker-chinese-macbert-large-gooaq-bce-4/final')
+ce = CrossEncoder('/mnt/d/Develop/celery/final/final')
+cuoshi_ce = CrossEncoder('cuoshi_reranker/cuoshi_reranker/final')
 with open("hunningtu_rule", "r") as f:
     content = f.read()
 obj = json.loads(content)
@@ -295,34 +304,17 @@ def callzaiclarify(data):
     return json_string
 def callzaidw(A,B):
     time.sleep(1)
-    completion = dsclient.chat.completions.create(
-        # 模型列表:https://help.aliyun.com/zh/model-studio/getting-started/models
+    completion = aiclient.chat.completions.create(
         model='glm-4.5-air',
-        #model="modelscope.cn/unsloth/GLM-Z1-32B-0414-GGUF",
-        stream=True,
+        ##stream=True,
         messages=[
             {"role": "system", "content": "You are a helpful assistant."},
         {"role": "user", "content": "  计量单位可以用名称或者符号表示,常用的符号包括表示米的符号m,表示千米的符号km,表示吨的符号t,表示千克的符号kg,表示平方米的符号m2,表示立方米的符号m3。也有计量单位很宽泛,比如“项”、“次”. 给定一个工作量计量单位,内容为" + A + ",记作A,再给定一个工作量计量单位,内容为" + B + ",记作B。若两个单位相等,请返回A=B。例如,“项”跟“次”是等价的,应返回A=B。若两个单位不相等,但是存在比例换算关系,请返回比例换算关系,例如A单位是m,B单位是10m, 则返回A=0.1*B。再例如,A单位是10m2,B单位是m2,则返回A=10*B。再例如,A单位是m3, B单位是1000m3,则返回A=0.001*B。若两个单位不相等,且不存在比例换算关系,请返回A<>B,例如A单位是m,B单位是m2,一个表示长度,一个表示面积,不存在比例关系,则返回A<>B。 "},
         ],
-        # Qwen3模型通过enable_thinking参数控制思考过程(开源版默认True,商业版默认False)
-        # 使用Qwen3开源版模型时,若未启用流式输出,请将下行取消注释,否则会报错
-        extra_body={"enable_thinking": False},
-        #extra_body={"thinking": {"type": "disabled"}},
+        #extra_body={"enable_thinking": False},
+        extra_body={"thinking": {"type": "disabled"}},
     )
-    is_answering = False  # 是否进入回复阶段
-    print("\n" + "=" * 20 + "思考过程" + "=" * 20)
-    json_string = ""
-    for chunk in completion:
-        delta = chunk.choices[0].delta
-        if hasattr(delta, "reasoning_content") and delta.reasoning_content is not None:
-            if not is_answering:
-                print(delta.reasoning_content, end="", flush=True)
-        if hasattr(delta, "content") and delta.content:
-            if not is_answering:
-                print("\n" + "=" * 20 + "完整回复" + "=" * 20)
-                is_answering = True
-            json_string = json_string + delta.content#, end="", flush=True)
-    #json_string = completion.choices[0].message.content
+    json_string = completion.choices[0].message.content
     print(json_string)
     time.sleep(1)
     completion = simpleclient.chat.completions.create(
@@ -413,7 +405,7 @@ def zuhe(input, content, bianma):
 def huansuan_highlevel(bianma, label, input,dw, tz):
     time.sleep(1)
     t = huansuan(input, dw, label)
-    if t == 0:
+    if t == 0 or bianma.startswith('030901013'):## 灭火器
         dw1 = input
         dw1 = dw1.lower()
         dw1 = dw1.replace("水平投影面积", "")
@@ -492,6 +484,24 @@ def huansuan(input, dw, label):
         return 1
     if dw1 == '个' and dw2 == '10套':
         return 0.1
+    if dw1 == '个' and dw2 == '台':
+        return 1
+    if dw1 == '个' and dw2 == '10台':
+        return 0.1
+    if dw1 == '台' and dw2 == '个':
+        return 1
+    if dw1 == '台' and dw2 == '10个':
+        return 0.1
+    if dw1 == '台' and dw2 == '套':
+        return 1
+    if dw1 == '台' and dw2 == '10套':
+        return 0.1
+    if dw1 == '组' and dw2 == '10组':
+        return 0.1
+    if dw1 == '组' and dw2 == '套':
+        return 1
+    if dw1 == '组' and dw2 == '10套':
+        return 0.1
     if dw1 == 'm' and dw2 == '100m单线':
         return 0.01
 
@@ -616,7 +626,9 @@ def clarify(data):
         data['mc']=data['mc'].replace('线条','檐沟')
         data['tz']=data['tz'].replace('线条','檐沟')
         return data, False
-
+    elif data['bianma'].startswith('0308'):
+        data['tz'] = data['tz'].replace('增强柔性石墨板', '增强柔性石墨板制作三通补强圈')
+        return data, False
     else:
         return data, False
 
@@ -636,6 +648,14 @@ def process_data(data:dict)-> dict:
         embeddings = model.encode(sentences)
     if data['bianma'].startswith("0117"):
         result = cuoshi_collection.query(query_embeddings=embeddings,n_results=25)      
+    elif data['bianma'].startswith('030810'):
+        result = azcollection.query(query_embeddings=embeddings, n_results=10, where_document={"$contains": "低压法兰"})      
+    elif data['bianma'].startswith('030412'):
+        result = azcollection.query(query_embeddings=embeddings, n_results=10, where_document={"$contains": "照明器具"})      
+    elif data['bianma'].startswith('030108'):
+        result = azcollection.query(query_embeddings=embeddings, n_results=10, where_document={"$contains": "风机"})      
+    elif data['bianma'].startswith('030502007') or data['bianma'].startswith('030502008'):
+        result = azcollection.query(query_embeddings=embeddings, n_results=10, where_document={"$contains": "布放光缆"})      
     elif data['bianma'].startswith('03'):
         result = azcollection.query(query_embeddings=embeddings,n_results=25)      
     else:
@@ -791,6 +811,97 @@ def process_data(data:dict)-> dict:
             cutoff = score - 0.01
             if cutoff < 0.3:
                 cutoff = 0.3
+    #if data['bianma'].startswith('030408001'):##电力电缆
+    #    score = -1
+    #    for rank in ranks:
+    #        if '电缆' in d[rank['corpus_id']]:
+    #            score = rank['score']
+    #            break
+    #    if score > -1 and score < cutoff:
+    #        cutoff = score - 0.01
+    #        if cutoff < 0.3:
+    #            cutoff = 0.3
+    if data['bianma'].startswith('030408006'):##电力电缆头
+        score = -1
+        for rank in ranks:
+            if '电缆头' in d[rank['corpus_id']]:
+                score = rank['score']
+                break
+        if score > -1 and score < cutoff:
+            cutoff = score - 0.01
+            if cutoff < 0.3:
+                cutoff = 0.3
+            ranks = [x for x in ranks if '电缆头' in d[x['corpus_id']]]
+    #if data['bianma'].startswith('030108'):##风机安装
+    #    score = -1
+    #    for rank in ranks:
+    #        if '风机' in d[rank['corpus_id']]:
+    #            score = rank['score']
+    #            break
+    #    if score > -1 and score < cutoff:
+    #        cutoff = score - 0.01
+    #        if cutoff < 0.3:
+    #            cutoff = 0.3
+    #if data['bianma'].startswith('030411'):##配管
+    #    score = -1
+    #    for rank in ranks:
+    #        if '第四册' in d[rank['corpus_id']]:
+    #            score = rank['score']
+    #            break
+    #    if score > -1 and score < cutoff:
+    #        cutoff = score - 0.01
+    #        if cutoff < 0.3:
+    #            cutoff = 0.3
+    #if data['bianma'].startswith('031001006'):##水管
+    #    score = -1
+    #    for rank in ranks:
+    #        if '水管' in d[rank['corpus_id']]:
+    #            score = rank['score']
+    #            break
+    #    if score > -1 and score < cutoff:
+    #        cutoff = score - 0.01
+    #        if cutoff < 0.3:
+    #            cutoff = 0.3
+    #if data['bianma'].startswith('030502007') or data['bianma'].startswith('030502008'):##光缆
+    #    score = -1
+    #    for rank in ranks:
+    #        if '敷设光缆' in d[rank['corpus_id']]:
+    #            score = rank['score']
+    #            break
+    #    if score > -1 and score < cutoff:
+    #        cutoff = score - 0.01
+    #        if cutoff < 0.3:
+    #            cutoff = 0.3
+    #if data['bianma'].startswith('030801'):##低压管道
+    #    score = -1
+    #    for rank in ranks:
+    #        if '低压管道' in d[rank['corpus_id']]:
+    #            score = rank['score']
+    #            break
+    #    if score > -1 and score < cutoff:
+    #        cutoff = score - 0.01
+    #        if cutoff < 0.3:
+    #            cutoff = 0.3
+    #if data['bianma'].startswith('030804'):##低压管件 
+    #    score = -1
+    #    for rank in ranks:
+    #        if '低压管件' in d[rank['corpus_id']]:
+    #            score = rank['score']
+    #            break
+    #    if score > -1 and score < cutoff:
+    #        cutoff = score - 0.01
+    #        if cutoff < 0.3:
+    #            cutoff = 0.3
+    #if '三通补强圈' in data['tz']:##三通补强圈
+    #    score = -1
+    #    for rank in ranks:
+    #        if '三通补强圈' in d[rank['corpus_id']]:
+    #            score = rank['score']
+    #            break
+    #    if score > -1 and score < cutoff:
+    #        cutoff = score - 0.01
+    #        if cutoff < 0.3:
+    #            cutoff = 0.3
     print("cutoff=" + str(cutoff))
     for entry in incremental:
         notselected = notselected + incremental[entry]
@@ -841,8 +952,15 @@ def process_data(data:dict)-> dict:
         notselected = [x for x in notselected if x not in selected]
     selected = list(set(selected))
     candidates=[]
+    notselected=[]
     for rank in ranks:
+        if d[rank['corpus_id']] in notselected:
+            continue
         candidates.append(d[rank['corpus_id']])
+        for entry in basic:
+            if d[rank['corpus_id']] in basic[entry]:
+                notselected = notselected + basic[entry]
+        notselected = [x for x in notselected if x not in candidates]
     if len(selected) == 0 and not data['bianma'].startswith('0115'):
         selected = fallback(candidates, data, aiclient, qwclient, simpleclient, menchuang_collection, model)
     selected = postprocess(selected, data, aiclient, qwclient,simpleclient, label_name, name_dw, candidates,yqspecial)
@@ -858,8 +976,8 @@ def process_data(data:dict)-> dict:
         result = [(x[0], x[1], dedata.read_singledexilie2(10, x[0])) for x in result]
         result = [(x[0], x[1], x[2], tihuan(x[0], x[2], label, aiclient, qwclient, simpleclient, data)) for x in result]
     else:
-        result = [(x[0], x[1], dedata.read_singledexilie2(30, x[0])) for x in result]
-        result = [(x[0], x[1], x[2], []) for x in result]
+        result = [(x[0], x[1], buchong(aiclient, dedata.read_singledexilie2(30, x[0]), x[0], data['tz'])) for x in result]
+        result = [(x[0], x[1], x[2], tihuan_az(x[0], x[2], label, aiclient, qwclient, simpleclient, data)) for x in result]
     fuzhu = [analyze(x[2]) for x in result]
     fuzhu = zip(selected, fuzhu)
     fuzhu = [x for x in fuzhu]
@@ -876,10 +994,23 @@ def process_data(data:dict)-> dict:
         replace['04290303']=extra_info
     else:
         extra_info = "无"
+    fy=[]
+    if data['bianma'].startswith('03') and '超高' in data['tz']:
+        fy=feiyong_chaogao(data, [label_name[x] for x in selected], aiclient, qwclient, simpleclient)
+    if len(fy) > 0:
+        fy = dedata.read_singledexilie2(30, fy[0])
+    else:
+        fy = '{}'
+    if data['bianma'].startswith('031301017'):##安装脚手架搭拆
+        print(data['bh'])
+        print(data['name'])
+        qd=anzhuangjsj(data['name'], data['bh'], dbcollection)
+        response = requests.post("http://localhost:3000/api/transform", json={'bianma': data['bianma'], 'mc': data['mc'], 'tz': data['tz'], 'dw': data['dw'], 'sl': data['sl'], 'n': data['n'], "extra": extra_info, 'result':qd, 'fuzhu': [], 'replace': replace, 'fy': fy})
+        return {"result": response.json()}
     if '高强螺栓' in extra_info:
-        response = requests.post("http://localhost:3000/api/transform", json={'bianma': data['bianma'], 'mc': data['mc'], 'tz': data['tz'], 'dw': data['dw'], 'sl': data['sl'], 'n': data['n'], "extra": extra_info, 'result': [], 'fuzhu': fuzhu_selected, 'replace': replace})
+        response = requests.post("http://localhost:3000/api/transform", json={'bianma': data['bianma'], 'mc': data['mc'], 'tz': data['tz'], 'dw': data['dw'], 'sl': data['sl'], 'n': data['n'], "extra": extra_info, 'result': [], 'fuzhu': fuzhu_selected, 'replace': replace, 'fy': '{}'})
         return {"result": response.json()}
     else:
-        response = requests.post("http://localhost:3000/api/transform", json={'bianma': data['bianma'], 'mc': data['mc'], 'tz': data['tz'], 'dw': data['dw'], 'sl': data['sl'], 'n': data['n'], "extra": extra_info, 'result': result, 'fuzhu': fuzhu_selected, 'replace': replace})
+        response = requests.post("http://localhost:3000/api/transform", json={'bianma': data['bianma'], 'mc': data['mc'], 'tz': data['tz'], 'dw': data['dw'], 'sl': data['sl'], 'n': data['n'], "extra": extra_info, 'result': result, 'fuzhu': fuzhu_selected, 'replace': replace, 'fy': fy})
         return {"result": response.json()}
         

+ 571 - 0
tihuan_az.py

@@ -0,0 +1,571 @@
+import json
+from config import simplemodel
+with open('az_name_label', 'r') as f:
+    content = f.read()
+name_label = json.loads(content)
+def tihuan_az(
+       name,
+       dercj,
+       label,
+       aiclient,
+       qwclient,
+       sfclient,
+       data
+       ):
+    result=[]
+    index = name.find('+')
+    if index > -1:
+        name = name[:index]
+    pos=[]
+    for i in range(len(name)):
+        if name[i] == '-':
+            pos.append(i)
+    if len(pos) > 1:
+        name = name[:pos[1]]
+    name_label_ = name_label[name] 
+    rcjobj = json.loads(dercj)
+    clde = rcjobj['clde']
+    for i in range(len(clde)):
+        bh = clde[i]['CLBH']
+        sl = clde[i]['SL']
+        if float(sl) < 1e-6:
+            continue
+        if bh.startswith("26012501"):
+            ##桥架
+            completion = aiclient.chat.completions.create(
+            model="glm-4.5-air",
+            messages=[
+                {"role": "system", "content": "You are a helpful assistant."},
+                {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出桥架的具体品种型号等信息。"+'''
+                      例如,给定文字如下:
+                      1、名称:电线电缆桥架(超高)
+                      2、型号:QJ
+                      3、规格:800*200
+                      4、材质:热镀锌
+                      你应该返回 “热镀锌桥架800*200”
+                      现在给定文字如下:
+                    ''' + label +'\n请给出答案'
+                },
+            ],
+            extra_body={"thinking": {"type": "disabled"}},
+        )
+            json_string = completion.choices[0].message.content
+            print(json_string)
+            
+            result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
+        if (bh.startswith("1401") or bh.startswith('1403')) and  '卫生器具' not in name_label_:
+            ##钢管
+            completion = aiclient.chat.completions.create(
+            model="glm-4.5-air",
+            messages=[
+                {"role": "system", "content": "You are a helpful assistant."},
+                {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出钢管的具体品种型号等信息。"+'''
+                      例如,给定文字如下:
+                      1、名称:穿线管
+                      2、材质:镀锌钢管
+                      3、规格:SC150
+                      4、配置形式:明配/超高
+                      你应该返回 “镀锌钢管DN150”
+                      现在给定文字如下:
+                    ''' + label +'\n请给出答案'
+                },
+            ],
+            extra_body={"thinking": {"type": "disabled"}},
+        )
+            json_string = completion.choices[0].message.content
+            print(json_string)
+            
+            result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
+        if bh.startswith("25430311") or bh.startswith('25430314') or bh.startswith('254305'):
+            ##绝缘导线
+            completion = aiclient.chat.completions.create(
+            model="glm-4.5-air",
+            messages=[
+                {"role": "system", "content": "You are a helpful assistant."},
+                {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出绝缘导线、网线的具体品种型号等信息。"+'''
+                      例如,给定文字如下:
+                      1、名称:配线
+                      2、配线形式:管内穿线
+                      3、规格:RS485
+                      4、材质:铜芯
+                      你应该返回 “绝缘导线RS485”
+                      再例如,给定文字如下:
+                      1、名称:六类非屏蔽网线
+                      2、规格:CAT6.UTP
+                      3、敷设方式:管内穿线/桥架配线
+                      你应该返回 “六类非屏蔽网线CAT6.UTP”
+                      现在给定文字如下:
+                    ''' + label +'\n请给出答案'
+                },
+            ],
+            extra_body={"thinking": {"type": "disabled"}},
+        )
+            json_string = completion.choices[0].message.content
+            print(json_string)
+            
+            result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
+        if bh.startswith("5029"):
+            ##通风机、通风器
+            completion = aiclient.chat.completions.create(
+            model="glm-4.5-air",
+            messages=[
+                {"role": "system", "content": "You are a helpful assistant."},
+                {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出通风机、通风器的具体品种型号等信息。"+'''
+                      例如,给定文字如下:
+                      1、名称:壁式边墙排风机
+                      2、 380V 0.55KW,50KG
+                      3、规格:带防雨消声弯头10*10不锈钢防虫网
+                      你应该返回 “壁式边墙排风机”
+                      现在给定文字如下:
+                    ''' + label +'\n请给出答案'
+                },
+            ],
+            extra_body={"thinking": {"type": "disabled"}},
+        )
+            json_string = completion.choices[0].message.content
+            print(json_string)
+            
+            result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
+        if bh.startswith("22470111"):
+            ##灯
+            completion = aiclient.chat.completions.create(
+            model="glm-4.5-air",
+            messages=[
+                {"role": "system", "content": "You are a helpful assistant."},
+                {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出灯具的具体品种型号等信息。"+'''
+                      例如,给定文字如下:
+                      1、名称:LED深照型工厂灯
+                      2、型号:SL-T2608-300W
+                      3、规格: 220V 300W
+                      4、安装形式:超高
+                      你应该返回 “LED深照型工厂灯SL-T2608-300W”
+                      现在给定文字如下:
+                    ''' + label +'\n请给出答案'
+                },
+            ],
+            extra_body={"thinking": {"type": "disabled"}},
+        )
+            json_string = completion.choices[0].message.content
+            print(json_string)
+            
+            result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
+        if bh.startswith("26110101"):
+            ##接线盒
+            completion = aiclient.chat.completions.create(
+            model="glm-4.5-air",
+            messages=[
+                {"role": "system", "content": "You are a helpful assistant."},
+                {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出接线盒的具体品种型号等信息。"+'''
+                      例如,给定文字如下:
+                      1、名称:接线盒
+                      2、材质:钢制
+                      3、规格:86型
+                      4、安装形式:明装,超高
+                      你应该返回 “钢制接线盒”
+                      现在给定文字如下:
+                    ''' + label +'\n请给出答案'
+                },
+            ],
+            extra_body={"thinking": {"type": "disabled"}},
+        )
+            json_string = completion.choices[0].message.content
+            print(json_string)
+            
+            result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
+        if bh.startswith("23412504"):
+            ##插座
+            completion = aiclient.chat.completions.create(
+            model="glm-4.5-air",
+            messages=[
+                {"role": "system", "content": "You are a helpful assistant."},
+                {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出插座的具体品种型号等信息。"+'''
+                      例如,给定文字如下:
+                      1、名称:单相二三孔安全插座
+                      2、材质:塑料
+                      3、规格:86Z223-10A
+                      你应该返回 “单相二三孔安全插座86Z223-10A”
+                      现在给定文字如下:
+                    ''' + label +'\n请给出答案'
+                },
+            ],
+            extra_body={"thinking": {"type": "disabled"}},
+        )
+            json_string = completion.choices[0].message.content
+            print(json_string)
+            
+            result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
+        if bh.startswith("23230131"):
+            ##开关
+            completion = aiclient.chat.completions.create(
+            model="glm-4.5-air",
+            messages=[
+                {"role": "system", "content": "You are a helpful assistant."},
+                {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出开关的具体品种型号等信息。"+'''
+                      例如,给定文字如下:
+                      1、名称:三联单控开关
+                      2、材质:塑料
+                      3、规格:86型
+                      你应该返回 “三联单控开关”
+                      现在给定文字如下:
+                    ''' + label +'\n请给出答案'
+                },
+            ],
+            extra_body={"thinking": {"type": "disabled"}},
+        )
+            json_string = completion.choices[0].message.content
+            print(json_string)
+            
+            result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
+        if bh.startswith("260935"):
+            ##端子箱(板)
+            completion = aiclient.chat.completions.create(
+            model="glm-4.5-air",
+            messages=[
+                {"role": "system", "content": "You are a helpful assistant."},
+                {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出端子箱、板的具体品种型号等信息。"+'''
+                      例如,给定文字如下:
+                      1、名称:接地预埋端子板
+                      2、材质:镀锌钢板
+                      3、规格:100*100*10
+                      你应该返回 “接地预埋端子板100*100*10”
+                      现在给定文字如下:
+                    ''' + label +'\n请给出答案'
+                },
+            ],
+            extra_body={"thinking": {"type": "disabled"}},
+        )
+            json_string = completion.choices[0].message.content
+            print(json_string)
+            
+            result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
+        if bh.startswith("145509"):
+            ##复合管
+            completion = aiclient.chat.completions.create(
+            model="glm-4.5-air",
+            messages=[
+                {"role": "system", "content": "You are a helpful assistant."},
+                {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出管道的具体品种型号等信息。"+'''
+                      例如,给定文字如下:
+                      1、安装部位:室内
+                      2、介质:给水
+                      3、材质、规格:涂塑钢管DN20
+                      4、连接形式:丝扣连接
+                      5、压力试验及吹、洗设计要求:吹洗
+                      你应该返回 “涂塑钢管DN20”
+                      现在给定文字如下:
+                    ''' + label +'\n请给出答案'
+                },
+            ],
+            extra_body={"thinking": {"type": "disabled"}},
+        )
+            json_string = completion.choices[0].message.content
+            print(json_string)
+            
+            result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
+        if bh.startswith("143103") or bh.startswith('143115'):
+            ##塑料管
+            completion = aiclient.chat.completions.create(
+            model="glm-4.5-air",
+            messages=[
+                {"role": "system", "content": "You are a helpful assistant."},
+                {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出管道的具体品种型号等信息。"+'''
+                      例如,给定文字如下:
+                      1、安装部位:室内
+                      2、介质:排水
+                      3、材质、规格:U-PVC110
+                      4、连接形式:粘接
+                      你应该返回 “U-PVC110”
+                      现在给定文字如下:
+                    ''' + label +'\n请给出答案'
+                },
+            ],
+            extra_body={"thinking": {"type": "disabled"}},
+        )
+            json_string = completion.choices[0].message.content
+            print(json_string)
+            
+            result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
+        if bh.startswith("1639"):
+            ##阀门
+            completion = aiclient.chat.completions.create(
+            model="glm-4.5-air",
+            messages=[
+                {"role": "system", "content": "You are a helpful assistant."},
+                {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出阀门的具体品种型号等信息。"+'''
+                      例如,给定文字如下:
+                      1、类型:截止阀
+                      2、材质:不锈钢
+                      3、规格、压力等级:DN32
+                      4、连接形式:丝接
+                      你应该返回 “不锈钢截止阀DN32”
+                      现在给定文字如下:
+                    ''' + label +'\n请给出答案'
+                },
+            ],
+            extra_body={"thinking": {"type": "disabled"}},
+        )
+            json_string = completion.choices[0].message.content
+            print(json_string)
+            
+            result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
+        if bh.startswith("1631") and '排气阀' not in label:
+            ##阀门
+            completion = aiclient.chat.completions.create(
+            model="glm-4.5-air",
+            messages=[
+                {"role": "system", "content": "You are a helpful assistant."},
+                {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出阀门的具体品种型号等信息。"+'''
+                      例如,给定文字如下:
+                      1、类型:截止阀
+                      2、材质:不锈钢
+                      3、规格、压力等级:DN32
+                      4、连接形式:丝接
+                      你应该返回 “不锈钢截止阀DN32”
+                      现在给定文字如下:
+                    ''' + label +'\n请给出答案'
+                },
+            ],
+            extra_body={"thinking": {"type": "disabled"}},
+        )
+            json_string = completion.choices[0].message.content
+            print(json_string)
+            
+            result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
+        if bh.startswith("1841") and '龙头' in name_label_:
+            ##水龙头
+            completion = aiclient.chat.completions.create(
+            model="glm-4.5-air",
+            messages=[
+                {"role": "system", "content": "You are a helpful assistant."},
+                {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出水龙头的具体品种型号等信息。"+'''
+                      例如,给定文字如下:
+                      1、材质:带真空破坏器组合水龙头
+                      2、型号、规格:DN20
+                      你应该返回 “带真空破坏器组合水龙头DN20”
+                      现在给定文字如下:
+                    ''' + label +'\n请给出答案'
+                },
+            ],
+            extra_body={"thinking": {"type": "disabled"}},
+        )
+            json_string = completion.choices[0].message.content
+            print(json_string)
+            
+            result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
+        if bh.startswith("1813"):
+            ##洗涤盆
+            completion = aiclient.chat.completions.create(
+            model="glm-4.5-air",
+            messages=[
+                {"role": "system", "content": "You are a helpful assistant."},
+                {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出洗涤盆(槽)的具体品种型号等信息。"+'''
+                      例如,给定文字如下:
+                      1、材质:不锈钢水槽
+                      2、规格、类型:1500*500*300
+                      你应该返回 “不锈钢水槽1500*500*300”
+                      现在给定文字如下:
+                    ''' + label +'\n请给出答案'
+                },
+            ],
+            extra_body={"thinking": {"type": "disabled"}},
+        )
+            json_string = completion.choices[0].message.content
+            print(json_string)
+            
+            result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
+        if bh.startswith("2001"):
+            ##灭火器
+            completion = aiclient.chat.completions.create(
+            model="glm-4.5-air",
+            messages=[
+                {"role": "system", "content": "You are a helpful assistant."},
+                {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出灭火器的具体品种型号等信息。"+'''
+                      例如,给定文字如下:
+                      1、形式:手提式灭火器
+                      2、规格、型号:MF/ABC5
+                      3、每套含两具灭火器及配套灭火器箱
+                      你应该返回 “手提式灭火器MF/ABC5”
+                      现在给定文字如下:
+                    ''' + label +'\n请给出答案'
+                },
+            ],
+            extra_body={"thinking": {"type": "disabled"}},
+        )
+            json_string = completion.choices[0].message.content
+            print(json_string)
+            
+            result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
+        if bh.startswith("261103"):
+            ##接线箱
+            completion = aiclient.chat.completions.create(
+            model="glm-4.5-air",
+            messages=[
+                {"role": "system", "content": "You are a helpful assistant."},
+                {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出接线箱的具体品种型号等信息。"+'''
+                      例如,给定文字如下:
+                      1、名称:可燃气体报警控制箱
+                      2、材质:钢制
+                      你应该返回 “可燃气体报警控制箱”
+                      现在给定文字如下:
+                    ''' + label +'\n请给出答案'
+                },
+            ],
+            extra_body={"thinking": {"type": "disabled"}},
+        )
+            json_string = completion.choices[0].message.content
+            print(json_string)
+            
+            result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
+        if bh.startswith("34130226"):
+            ##机柜
+            completion = aiclient.chat.completions.create(
+            model="glm-4.5-air",
+            messages=[
+                {"role": "system", "content": "You are a helpful assistant."},
+                {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出机柜的具体品种型号等信息。"+'''
+                      例如,给定文字如下:
+                      1、名称:能耗计量通讯管理机
+                      2、安装方式:落地
+                      你应该返回 “能耗计量通讯管理机”
+                      现在给定文字如下:
+                    ''' + label +'\n请给出答案'
+                },
+            ],
+            extra_body={"thinking": {"type": "disabled"}},
+        )
+            json_string = completion.choices[0].message.content
+            print(json_string)
+            
+            result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
+        if bh.startswith("34130264"):
+            ##光缆
+            completion = aiclient.chat.completions.create(
+            model="glm-4.5-air",
+            messages=[
+                {"role": "system", "content": "You are a helpful assistant."},
+                {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出光缆的具体品种型号等信息。"+'''
+                      例如,给定文字如下:
+                      1、名称:光纤
+                      2、安装方式:4芯光纤
+                      你应该返回 “4芯光纤”
+                      现在给定文字如下:
+                    ''' + label +'\n请给出答案'
+                },
+            ],
+            extra_body={"thinking": {"type": "disabled"}},
+        )
+            json_string = completion.choices[0].message.content
+            print(json_string)
+            
+            result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
+        if bh.startswith("151309"):
+            ##管件
+            completion = aiclient.chat.completions.create(
+            model="glm-4.5-air",
+            messages=[
+                {"role": "system", "content": "You are a helpful assistant."},
+                {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出管件(连接件)的具体品种型号等信息。"+'''
+                      例如,给定文字如下:
+                      1、材质:室内压缩空气接头箱
+                      2、规格:12接头(配带DN50不锈钢阀门及法兰)
+                      你应该返回 “室内压缩空气接头箱12接头(配带DN50不锈钢阀门及法兰)”
+                      现在给定文字如下:
+                    ''' + label +'\n请给出答案'
+                },
+            ],
+            extra_body={"thinking": {"type": "disabled"}},
+        )
+            json_string = completion.choices[0].message.content
+            print(json_string)
+            
+            result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
+        if bh.startswith("1625"):
+            ##法兰阀门(水表)
+            completion = aiclient.chat.completions.create(
+            model="glm-4.5-air",
+            messages=[
+                {"role": "system", "content": "You are a helpful assistant."},
+                {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出法兰阀门(水表)的具体品种型号等信息。"+'''
+                      例如,给定文字如下:
+                      1、名称:法兰不锈钢蝶阀
+                      2、型号、规格:D341F-16C型 DN250
+                      3、连接形式:法兰连接
+                      你应该返回 “法兰不锈钢蝶阀D341F-16C型 DN250”
+                      现在给定文字如下:
+                    ''' + label +'\n请给出答案'
+                },
+            ],
+            extra_body={"thinking": {"type": "disabled"}},
+        )
+            json_string = completion.choices[0].message.content
+            print(json_string)
+            
+            result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
+        if bh.startswith("2109030"):
+            ##水表
+            completion = aiclient.chat.completions.create(
+            model="glm-4.5-air",
+            messages=[
+                {"role": "system", "content": "You are a helpful assistant."},
+                {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出水表的具体品种型号等信息。"+'''
+                      例如,给定文字如下:
+                      1、安装部位(室内外):水表
+                      2、型号、规格:DN65
+                      3、连接形式:丝接
+                      你应该返回 “水表DN65”
+                      现在给定文字如下:
+                    ''' + label +'\n请给出答案'
+                },
+            ],
+            extra_body={"thinking": {"type": "disabled"}},
+        )
+            json_string = completion.choices[0].message.content
+            print(json_string)
+            
+            result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
+        if bh.startswith("170101"):
+            ##法兰
+            completion = aiclient.chat.completions.create(
+            model="glm-4.5-air",
+            messages=[
+                {"role": "system", "content": "You are a helpful assistant."},
+                {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出法兰的具体品种型号等信息。"+'''
+                      例如,给定文字如下:
+                      1、材质:板式平焊钢制管法兰
+                      2、型号、规格:20#-PL250(B)-16
+                      3、连接形式:焊接
+                      你应该返回 “板式平焊钢制管法兰20#-PL250(B)-16”
+                      现在给定文字如下:
+                    ''' + label +'\n请给出答案'
+                },
+            ],
+            extra_body={"thinking": {"type": "disabled"}},
+        )
+            json_string = completion.choices[0].message.content
+            print(json_string)
+            
+            result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
+        if '三通补强圈' in name_label_:
+            if bh.startswith('01290'):#钢板
+
+                completion = aiclient.chat.completions.create(
+            model="glm-4.5-air",
+            messages=[
+                {"role": "system", "content": "You are a helpful assistant."},
+                {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出板材的具体品种型号等信息。"+'''
+                      例如,给定文字如下:
+                      1、材质:增强柔性石墨板
+                      2、规格:RSB/304,RF200-16
+                      你应该返回 “增强柔性石墨板”
+                      如果没有提及具体板材,请直接回答“钢板”
+                      现在给定文字如下:
+                    ''' + label +'\n请给出答案'
+                },
+            ],
+            extra_body={"thinking": {"type": "disabled"}},
+            )
+                json_string = completion.choices[0].message.content
+                print(json_string)
+            
+                result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
+    return result

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov