chatgpt大模型
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

20 lines
5.9 KiB

#coding=utf8
import sys
import requests
import json
import time
data={'metadata': {'output': {'output_type': 'table', 'label_col': ['翻译总结']}, 'input': {'input_type': 'text', 'label': ['3_OCR识别内容']}, 'address': 'http://172.18.1.181:9011/chatGpt/', 'admin': {'authorization': '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', 'top_p': '1', 'user_input': [{'keyname': 'tag', 'keydesc': ''}], 'temperature': '0.2', 'model': 'gpt-3.5-turbo-16k', 'prompt': '将以下内容翻译成中文。@@3_OCR识别内容@@', 'n': '1'}, 'index': 0, 'user': {'tag': ''}}, 'data': {'1_文件上传': '{"resultList":[{"fileUrl":"http://172.16.3.82:38080/group1/default/20230901/09/58/0/1693533453444_yuhu.docx","fileType":"docx","filePath":"/","fileId":1407,"fileName":"外文新闻2.docx","ossPath":"/group1/default/20230901/09/58/0/1693533453444_yuhu.docx"},{"fileUrl":"http://172.16.3.82:38080/group1/default/20230901/09/58/0/1693533455752_6ezg.docx","fileType":"docx","filePath":"/","fileId":1408,"fileName":"外文新闻3.docx","ossPath":"/group1/default/20230901/09/58/0/1693533455752_6ezg.docx"},{"fileUrl":"http://172.16.3.82:38080/group1/default/20230831/10/37/0/1693449374527_cnh9.docx","fileType":"docx","filePath":"/","fileId":1409,"fileName":"外文新闻案例.docx","ossPath":"/group1/default/20230831/10/37/0/1693449374527_cnh9.docx"}]}', '3_OCR识别内容': '{"content":"Factories May Be Leaving China, but Trade Ties Are Stronger Than They Seem\\nThe United States is trying to lessen its dependence on Chinese goods, but research is showing how tough it is to truly alter global supply chains.\\nThe United States has spent the past five years pushing to reduce its reliance on China for computer chips, solar panels and various consumer imports amid growing concern over Beijing’s security threats, human rights record and dominance of critical industries.\\nBut even as policymakers and corporate executives look for ways to cut ties with China, a growing body of evidence suggests that the world’s largest economies remain deeply intertwined as Chinese products make their way to America through other countries. New and forthcoming economic papers call into question whether the United States has actually lessened its reliance on China — and what a recent reshuffling of trade relationships means for the global economy and American consumers.\\nChanges to global manufacturing and supply chains are still unfolding, as both punishing tariffs imposed by the administration of former President Donald J. Trump and\\u00A0tougher restrictions on the sale of technology\\u00A0to China imposed by the Biden administration play out.\\nThe key architect of the latest restrictions — Gina Raimondo, the commerce secretary — is meeting with top Chinese officials in Beijing and Shanghai this week, a visit that underscores the challenge facing the United States as it seeks to reduce how much it depends on China when the countries’ economies share so many ties.\\nThese reworked trade rules, along with other economic changes, have caused China’s share of imports into the United States to fall as the share of imports from other low-cost countries like Vietnam and Mexico have climbed. The Biden administration has also\\u00A0pumped up incentives\\u00A0for producing semiconductors, electric cars and solar panels domestically, and manufacturing construction in the United States has been rising quickly.\\nBut new research discussed at the Federal Reserve Bank of Kansas City’s annual conference at Jackson Hole in Wyoming on Saturday found that while global trade patterns have reshuffled, American supply chains have remained very reliant on Chinese production — just not as directly.\\nIn their paper, the economists Laura Alfaro at Harvard Business School and Davin Chor at the Tuck School of Business at Dartmouth wrote that China’s share of U.S. imports fell to about 17 percent in 2022 after peaking at about 22 percent in 2017, as the country accounted for a smaller share of America’s imports in categories like machinery, footwear and telephone sets. As that happened, places like Vietnam gained ground — supplying the United States with more apparel and textiles — while neighbors like Mexico began sending more car parts, glass, iron and steel.\\n\\n","fileId":1407,"fileName":"外文新闻2.docx","filePath":"/","fileType":"docx","fileUrl":"http://172.16.3.82:38080/group1/default/20230901/09/58/0/1693533453444_yuhu.docx","ossPath":"/group1/default/20230901/09/58/0/1693533453444_yuhu.docx","pageNum":1}', 'businessKey': '090e72fae4c8f6b9', '2_任务提取': '[{"fileId":1407,"fileName":"外文新闻2.docx","filePath":"/","fileType":"docx","fileUrl":"http://172.16.3.82:38080/group1/default/20230901/09/58/0/1693533453444_yuhu.docx","ossPath":"/group1/default/20230901/09/58/0/1693533453444_yuhu.docx"},{"fileId":1408,"fileName":"外文新闻3.docx","filePath":"/","fileType":"docx","fileUrl":"http://172.16.3.82:38080/group1/default/20230901/09/58/0/1693533455752_6ezg.docx","ossPath":"/group1/default/20230901/09/58/0/1693533455752_6ezg.docx"},{"fileId":1409,"fileName":"外文新闻案例.docx","filePath":"/","fileType":"docx","fileUrl":"http://172.16.3.82:38080/group1/default/20230831/10/37/0/1693449374527_cnh9.docx","ossPath":"/group1/default/20230831/10/37/0/1693449374527_cnh9.docx"}]'}, 'created': 1691004265000, 'module': 'ChatGPT', 'start_tag': False, 'multi_branch': 0, 'last_edit': 1693483379000, 'next_app_id': [{'start_id': 155, 'edge_id': 76, 'end_id': 156}], 'transfer_id': 4, 'version': 1, 'blueprint_id': 4, 'scenes_id': 5, 'scenario': {'dataloss': 1, 'autoCommitTriggerLast': 1, 'maxErrors': 3, 'autoCommit': 1, 'freshVariables': 1}, 'wait_condition': [], 'scheduling': {'interval': -1, 'type': 'single'}, 'name': '内容翻译', 'businessKey': '090e72fae4c8f6b9', 'id': 155, 'position': [100, 200], 'describe': '内容翻译'}
url = 'http://127.0.0.1:9011/chatGpt'
data = json.dumps(data)
r = requests.post(url, data=data)
# r = requests.post(url,data=str(data_str))
print(r.text)