tihuan_az.py 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  1. import json
  2. from config import simplemodel
  3. with open('az_name_label', 'r') as f:
  4. content = f.read()
  5. name_label = json.loads(content)
  6. def tihuan_az(
  7. name,
  8. dercj,
  9. label,
  10. aiclient,
  11. qwclient,
  12. sfclient,
  13. data
  14. ):
  15. result=[]
  16. index = name.find('+')
  17. if index > -1:
  18. name = name[:index]
  19. pos=[]
  20. for i in range(len(name)):
  21. if name[i] == '-':
  22. pos.append(i)
  23. if len(pos) > 1:
  24. name = name[:pos[1]]
  25. name_label_ = name_label[name]
  26. rcjobj = json.loads(dercj)
  27. clde = rcjobj['clde']
  28. for i in range(len(clde)):
  29. bh = clde[i]['CLBH']
  30. sl = clde[i]['SL']
  31. if float(sl) < 1e-6:
  32. continue
  33. if bh.startswith("26012501"):
  34. ##桥架
  35. completion = aiclient.chat.completions.create(
  36. model="glm-4.5-air",
  37. messages=[
  38. {"role": "system", "content": "You are a helpful assistant."},
  39. {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出桥架的具体品种型号等信息。"+'''
  40. 例如,给定文字如下:
  41. 1、名称:电线电缆桥架(超高)
  42. 2、型号:QJ
  43. 3、规格:800*200
  44. 4、材质:热镀锌
  45. 你应该返回 “热镀锌桥架800*200”
  46. 现在给定文字如下:
  47. ''' + label +'\n请给出答案'
  48. },
  49. ],
  50. extra_body={"thinking": {"type": "disabled"}},
  51. )
  52. json_string = completion.choices[0].message.content
  53. print(json_string)
  54. result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
  55. if (bh.startswith("1401") or bh.startswith('1403')) and '卫生器具' not in name_label_:
  56. ##钢管
  57. completion = aiclient.chat.completions.create(
  58. model="glm-4.5-air",
  59. messages=[
  60. {"role": "system", "content": "You are a helpful assistant."},
  61. {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出钢管的具体品种型号等信息。"+'''
  62. 例如,给定文字如下:
  63. 1、名称:穿线管
  64. 2、材质:镀锌钢管
  65. 3、规格:SC150
  66. 4、配置形式:明配/超高
  67. 你应该返回 “镀锌钢管DN150”
  68. 现在给定文字如下:
  69. ''' + label +'\n请给出答案'
  70. },
  71. ],
  72. extra_body={"thinking": {"type": "disabled"}},
  73. )
  74. json_string = completion.choices[0].message.content
  75. print(json_string)
  76. result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
  77. if bh.startswith("25430311") or bh.startswith('25430314') or bh.startswith('254305'):
  78. ##绝缘导线
  79. completion = aiclient.chat.completions.create(
  80. model="glm-4.5-air",
  81. messages=[
  82. {"role": "system", "content": "You are a helpful assistant."},
  83. {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出绝缘导线、网线的具体品种型号等信息。"+'''
  84. 例如,给定文字如下:
  85. 1、名称:配线
  86. 2、配线形式:管内穿线
  87. 3、规格:RS485
  88. 4、材质:铜芯
  89. 你应该返回 “绝缘导线RS485”
  90. 再例如,给定文字如下:
  91. 1、名称:六类非屏蔽网线
  92. 2、规格:CAT6.UTP
  93. 3、敷设方式:管内穿线/桥架配线
  94. 你应该返回 “六类非屏蔽网线CAT6.UTP”
  95. 现在给定文字如下:
  96. ''' + label +'\n请给出答案'
  97. },
  98. ],
  99. extra_body={"thinking": {"type": "disabled"}},
  100. )
  101. json_string = completion.choices[0].message.content
  102. print(json_string)
  103. result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
  104. if bh.startswith("5029"):
  105. ##通风机、通风器
  106. completion = aiclient.chat.completions.create(
  107. model="glm-4.5-air",
  108. messages=[
  109. {"role": "system", "content": "You are a helpful assistant."},
  110. {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出通风机、通风器的具体品种型号等信息。"+'''
  111. 例如,给定文字如下:
  112. 1、名称:壁式边墙排风机
  113. 2、 380V 0.55KW,50KG
  114. 3、规格:带防雨消声弯头10*10不锈钢防虫网
  115. 你应该返回 “壁式边墙排风机”
  116. 现在给定文字如下:
  117. ''' + label +'\n请给出答案'
  118. },
  119. ],
  120. extra_body={"thinking": {"type": "disabled"}},
  121. )
  122. json_string = completion.choices[0].message.content
  123. print(json_string)
  124. result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
  125. if bh.startswith("22470111"):
  126. ##灯
  127. completion = aiclient.chat.completions.create(
  128. model="glm-4.5-air",
  129. messages=[
  130. {"role": "system", "content": "You are a helpful assistant."},
  131. {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出灯具的具体品种型号等信息。"+'''
  132. 例如,给定文字如下:
  133. 1、名称:LED深照型工厂灯
  134. 2、型号:SL-T2608-300W
  135. 3、规格: 220V 300W
  136. 4、安装形式:超高
  137. 你应该返回 “LED深照型工厂灯SL-T2608-300W”
  138. 现在给定文字如下:
  139. ''' + label +'\n请给出答案'
  140. },
  141. ],
  142. extra_body={"thinking": {"type": "disabled"}},
  143. )
  144. json_string = completion.choices[0].message.content
  145. print(json_string)
  146. result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
  147. if bh.startswith("26110101"):
  148. ##接线盒
  149. completion = aiclient.chat.completions.create(
  150. model="glm-4.5-air",
  151. messages=[
  152. {"role": "system", "content": "You are a helpful assistant."},
  153. {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出接线盒的具体品种型号等信息。"+'''
  154. 例如,给定文字如下:
  155. 1、名称:接线盒
  156. 2、材质:钢制
  157. 3、规格:86型
  158. 4、安装形式:明装,超高
  159. 你应该返回 “钢制接线盒”
  160. 现在给定文字如下:
  161. ''' + label +'\n请给出答案'
  162. },
  163. ],
  164. extra_body={"thinking": {"type": "disabled"}},
  165. )
  166. json_string = completion.choices[0].message.content
  167. print(json_string)
  168. result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
  169. if bh.startswith("23412504"):
  170. ##插座
  171. completion = aiclient.chat.completions.create(
  172. model="glm-4.5-air",
  173. messages=[
  174. {"role": "system", "content": "You are a helpful assistant."},
  175. {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出插座的具体品种型号等信息。"+'''
  176. 例如,给定文字如下:
  177. 1、名称:单相二三孔安全插座
  178. 2、材质:塑料
  179. 3、规格:86Z223-10A
  180. 你应该返回 “单相二三孔安全插座86Z223-10A”
  181. 现在给定文字如下:
  182. ''' + label +'\n请给出答案'
  183. },
  184. ],
  185. extra_body={"thinking": {"type": "disabled"}},
  186. )
  187. json_string = completion.choices[0].message.content
  188. print(json_string)
  189. result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
  190. if bh.startswith("23230131"):
  191. ##开关
  192. completion = aiclient.chat.completions.create(
  193. model="glm-4.5-air",
  194. messages=[
  195. {"role": "system", "content": "You are a helpful assistant."},
  196. {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出开关的具体品种型号等信息。"+'''
  197. 例如,给定文字如下:
  198. 1、名称:三联单控开关
  199. 2、材质:塑料
  200. 3、规格:86型
  201. 你应该返回 “三联单控开关”
  202. 现在给定文字如下:
  203. ''' + label +'\n请给出答案'
  204. },
  205. ],
  206. extra_body={"thinking": {"type": "disabled"}},
  207. )
  208. json_string = completion.choices[0].message.content
  209. print(json_string)
  210. result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
  211. if bh.startswith("260935"):
  212. ##端子箱(板)
  213. completion = aiclient.chat.completions.create(
  214. model="glm-4.5-air",
  215. messages=[
  216. {"role": "system", "content": "You are a helpful assistant."},
  217. {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出端子箱、板的具体品种型号等信息。"+'''
  218. 例如,给定文字如下:
  219. 1、名称:接地预埋端子板
  220. 2、材质:镀锌钢板
  221. 3、规格:100*100*10
  222. 你应该返回 “接地预埋端子板100*100*10”
  223. 现在给定文字如下:
  224. ''' + label +'\n请给出答案'
  225. },
  226. ],
  227. extra_body={"thinking": {"type": "disabled"}},
  228. )
  229. json_string = completion.choices[0].message.content
  230. print(json_string)
  231. result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
  232. if bh.startswith("145509"):
  233. ##复合管
  234. completion = aiclient.chat.completions.create(
  235. model="glm-4.5-air",
  236. messages=[
  237. {"role": "system", "content": "You are a helpful assistant."},
  238. {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出管道的具体品种型号等信息。"+'''
  239. 例如,给定文字如下:
  240. 1、安装部位:室内
  241. 2、介质:给水
  242. 3、材质、规格:涂塑钢管DN20
  243. 4、连接形式:丝扣连接
  244. 5、压力试验及吹、洗设计要求:吹洗
  245. 你应该返回 “涂塑钢管DN20”
  246. 现在给定文字如下:
  247. ''' + label +'\n请给出答案'
  248. },
  249. ],
  250. extra_body={"thinking": {"type": "disabled"}},
  251. )
  252. json_string = completion.choices[0].message.content
  253. print(json_string)
  254. result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
  255. if bh.startswith("143103") or bh.startswith('143115'):
  256. ##塑料管
  257. completion = aiclient.chat.completions.create(
  258. model="glm-4.5-air",
  259. messages=[
  260. {"role": "system", "content": "You are a helpful assistant."},
  261. {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出管道的具体品种型号等信息。"+'''
  262. 例如,给定文字如下:
  263. 1、安装部位:室内
  264. 2、介质:排水
  265. 3、材质、规格:U-PVC110
  266. 4、连接形式:粘接
  267. 你应该返回 “U-PVC110”
  268. 现在给定文字如下:
  269. ''' + label +'\n请给出答案'
  270. },
  271. ],
  272. extra_body={"thinking": {"type": "disabled"}},
  273. )
  274. json_string = completion.choices[0].message.content
  275. print(json_string)
  276. result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
  277. if bh.startswith("1639"):
  278. ##阀门
  279. completion = aiclient.chat.completions.create(
  280. model="glm-4.5-air",
  281. messages=[
  282. {"role": "system", "content": "You are a helpful assistant."},
  283. {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出阀门的具体品种型号等信息。"+'''
  284. 例如,给定文字如下:
  285. 1、类型:截止阀
  286. 2、材质:不锈钢
  287. 3、规格、压力等级:DN32
  288. 4、连接形式:丝接
  289. 你应该返回 “不锈钢截止阀DN32”
  290. 现在给定文字如下:
  291. ''' + label +'\n请给出答案'
  292. },
  293. ],
  294. extra_body={"thinking": {"type": "disabled"}},
  295. )
  296. json_string = completion.choices[0].message.content
  297. print(json_string)
  298. result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
  299. if bh.startswith("1631") and '排气阀' not in label:
  300. ##阀门
  301. completion = aiclient.chat.completions.create(
  302. model="glm-4.5-air",
  303. messages=[
  304. {"role": "system", "content": "You are a helpful assistant."},
  305. {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出阀门的具体品种型号等信息。"+'''
  306. 例如,给定文字如下:
  307. 1、类型:截止阀
  308. 2、材质:不锈钢
  309. 3、规格、压力等级:DN32
  310. 4、连接形式:丝接
  311. 你应该返回 “不锈钢截止阀DN32”
  312. 现在给定文字如下:
  313. ''' + label +'\n请给出答案'
  314. },
  315. ],
  316. extra_body={"thinking": {"type": "disabled"}},
  317. )
  318. json_string = completion.choices[0].message.content
  319. print(json_string)
  320. result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
  321. if bh.startswith("1841") and '龙头' in name_label_:
  322. ##水龙头
  323. completion = aiclient.chat.completions.create(
  324. model="glm-4.5-air",
  325. messages=[
  326. {"role": "system", "content": "You are a helpful assistant."},
  327. {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出水龙头的具体品种型号等信息。"+'''
  328. 例如,给定文字如下:
  329. 1、材质:带真空破坏器组合水龙头
  330. 2、型号、规格:DN20
  331. 你应该返回 “带真空破坏器组合水龙头DN20”
  332. 现在给定文字如下:
  333. ''' + label +'\n请给出答案'
  334. },
  335. ],
  336. extra_body={"thinking": {"type": "disabled"}},
  337. )
  338. json_string = completion.choices[0].message.content
  339. print(json_string)
  340. result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
  341. if bh.startswith("1813"):
  342. ##洗涤盆
  343. completion = aiclient.chat.completions.create(
  344. model="glm-4.5-air",
  345. messages=[
  346. {"role": "system", "content": "You are a helpful assistant."},
  347. {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出洗涤盆(槽)的具体品种型号等信息。"+'''
  348. 例如,给定文字如下:
  349. 1、材质:不锈钢水槽
  350. 2、规格、类型:1500*500*300
  351. 你应该返回 “不锈钢水槽1500*500*300”
  352. 现在给定文字如下:
  353. ''' + label +'\n请给出答案'
  354. },
  355. ],
  356. extra_body={"thinking": {"type": "disabled"}},
  357. )
  358. json_string = completion.choices[0].message.content
  359. print(json_string)
  360. result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
  361. if bh.startswith("2001"):
  362. ##灭火器
  363. completion = aiclient.chat.completions.create(
  364. model="glm-4.5-air",
  365. messages=[
  366. {"role": "system", "content": "You are a helpful assistant."},
  367. {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出灭火器的具体品种型号等信息。"+'''
  368. 例如,给定文字如下:
  369. 1、形式:手提式灭火器
  370. 2、规格、型号:MF/ABC5
  371. 3、每套含两具灭火器及配套灭火器箱
  372. 你应该返回 “手提式灭火器MF/ABC5”
  373. 现在给定文字如下:
  374. ''' + label +'\n请给出答案'
  375. },
  376. ],
  377. extra_body={"thinking": {"type": "disabled"}},
  378. )
  379. json_string = completion.choices[0].message.content
  380. print(json_string)
  381. result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
  382. if bh.startswith("261103"):
  383. ##接线箱
  384. completion = aiclient.chat.completions.create(
  385. model="glm-4.5-air",
  386. messages=[
  387. {"role": "system", "content": "You are a helpful assistant."},
  388. {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出接线箱的具体品种型号等信息。"+'''
  389. 例如,给定文字如下:
  390. 1、名称:可燃气体报警控制箱
  391. 2、材质:钢制
  392. 你应该返回 “可燃气体报警控制箱”
  393. 现在给定文字如下:
  394. ''' + label +'\n请给出答案'
  395. },
  396. ],
  397. extra_body={"thinking": {"type": "disabled"}},
  398. )
  399. json_string = completion.choices[0].message.content
  400. print(json_string)
  401. result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
  402. if bh.startswith("34130226"):
  403. ##机柜
  404. completion = aiclient.chat.completions.create(
  405. model="glm-4.5-air",
  406. messages=[
  407. {"role": "system", "content": "You are a helpful assistant."},
  408. {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出机柜的具体品种型号等信息。"+'''
  409. 例如,给定文字如下:
  410. 1、名称:能耗计量通讯管理机
  411. 2、安装方式:落地
  412. 你应该返回 “能耗计量通讯管理机”
  413. 现在给定文字如下:
  414. ''' + label +'\n请给出答案'
  415. },
  416. ],
  417. extra_body={"thinking": {"type": "disabled"}},
  418. )
  419. json_string = completion.choices[0].message.content
  420. print(json_string)
  421. result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
  422. if bh.startswith("34130264"):
  423. ##光缆
  424. completion = aiclient.chat.completions.create(
  425. model="glm-4.5-air",
  426. messages=[
  427. {"role": "system", "content": "You are a helpful assistant."},
  428. {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出光缆的具体品种型号等信息。"+'''
  429. 例如,给定文字如下:
  430. 1、名称:光纤
  431. 2、安装方式:4芯光纤
  432. 你应该返回 “4芯光纤”
  433. 现在给定文字如下:
  434. ''' + label +'\n请给出答案'
  435. },
  436. ],
  437. extra_body={"thinking": {"type": "disabled"}},
  438. )
  439. json_string = completion.choices[0].message.content
  440. print(json_string)
  441. result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
  442. if bh.startswith("151309"):
  443. ##管件
  444. completion = aiclient.chat.completions.create(
  445. model="glm-4.5-air",
  446. messages=[
  447. {"role": "system", "content": "You are a helpful assistant."},
  448. {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出管件(连接件)的具体品种型号等信息。"+'''
  449. 例如,给定文字如下:
  450. 1、材质:室内压缩空气接头箱
  451. 2、规格:12接头(配带DN50不锈钢阀门及法兰)
  452. 你应该返回 “室内压缩空气接头箱12接头(配带DN50不锈钢阀门及法兰)”
  453. 现在给定文字如下:
  454. ''' + label +'\n请给出答案'
  455. },
  456. ],
  457. extra_body={"thinking": {"type": "disabled"}},
  458. )
  459. json_string = completion.choices[0].message.content
  460. print(json_string)
  461. result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
  462. if bh.startswith("1625"):
  463. ##法兰阀门(水表)
  464. completion = aiclient.chat.completions.create(
  465. model="glm-4.5-air",
  466. messages=[
  467. {"role": "system", "content": "You are a helpful assistant."},
  468. {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出法兰阀门(水表)的具体品种型号等信息。"+'''
  469. 例如,给定文字如下:
  470. 1、名称:法兰不锈钢蝶阀
  471. 2、型号、规格:D341F-16C型 DN250
  472. 3、连接形式:法兰连接
  473. 你应该返回 “法兰不锈钢蝶阀D341F-16C型 DN250”
  474. 现在给定文字如下:
  475. ''' + label +'\n请给出答案'
  476. },
  477. ],
  478. extra_body={"thinking": {"type": "disabled"}},
  479. )
  480. json_string = completion.choices[0].message.content
  481. print(json_string)
  482. result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
  483. if bh.startswith("2109030"):
  484. ##水表
  485. completion = aiclient.chat.completions.create(
  486. model="glm-4.5-air",
  487. messages=[
  488. {"role": "system", "content": "You are a helpful assistant."},
  489. {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出水表的具体品种型号等信息。"+'''
  490. 例如,给定文字如下:
  491. 1、安装部位(室内外):水表
  492. 2、型号、规格:DN65
  493. 3、连接形式:丝接
  494. 你应该返回 “水表DN65”
  495. 现在给定文字如下:
  496. ''' + label +'\n请给出答案'
  497. },
  498. ],
  499. extra_body={"thinking": {"type": "disabled"}},
  500. )
  501. json_string = completion.choices[0].message.content
  502. print(json_string)
  503. result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
  504. if bh.startswith("170101"):
  505. ##法兰
  506. completion = aiclient.chat.completions.create(
  507. model="glm-4.5-air",
  508. messages=[
  509. {"role": "system", "content": "You are a helpful assistant."},
  510. {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出法兰的具体品种型号等信息。"+'''
  511. 例如,给定文字如下:
  512. 1、材质:板式平焊钢制管法兰
  513. 2、型号、规格:20#-PL250(B)-16
  514. 3、连接形式:焊接
  515. 你应该返回 “板式平焊钢制管法兰20#-PL250(B)-16”
  516. 现在给定文字如下:
  517. ''' + label +'\n请给出答案'
  518. },
  519. ],
  520. extra_body={"thinking": {"type": "disabled"}},
  521. )
  522. json_string = completion.choices[0].message.content
  523. print(json_string)
  524. result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
  525. if '三通补强圈' in name_label_:
  526. if bh.startswith('01290'):#钢板
  527. completion = aiclient.chat.completions.create(
  528. model="glm-4.5-air",
  529. messages=[
  530. {"role": "system", "content": "You are a helpful assistant."},
  531. {"role": "user", "content": "给定一段工作内容的描述,请从工作内容中抽取出板材的具体品种型号等信息。"+'''
  532. 例如,给定文字如下:
  533. 1、材质:增强柔性石墨板
  534. 2、规格:RSB/304,RF200-16
  535. 你应该返回 “增强柔性石墨板”
  536. 如果没有提及具体板材,请直接回答“钢板”
  537. 现在给定文字如下:
  538. ''' + label +'\n请给出答案'
  539. },
  540. ],
  541. extra_body={"thinking": {"type": "disabled"}},
  542. )
  543. json_string = completion.choices[0].message.content
  544. print(json_string)
  545. result.append( {'bianma': bh, 'new_bianma': bh, 'mc': json_string, 'jg': 0})
  546. return result