From 1345f253a0ddfbe625c3f47093a928d69eadb418 Mon Sep 17 00:00:00 2001 From: mxr612 Date: Wed, 21 Aug 2024 14:46:12 +0800 Subject: [PATCH] fix variable name problem, upd stringize --- fastgpt_uploader.py | 4 ++-- main.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fastgpt_uploader.py b/fastgpt_uploader.py index 4c3f2a4..1f61034 100644 --- a/fastgpt_uploader.py +++ b/fastgpt_uploader.py @@ -24,13 +24,13 @@ def __new_set(): ).json() return result["data"] -__CONFIG__['colId'] = __new_set() +__CONFIG__['fastgpt_colId'] = __new_set() def upload2fastgpt(data): try: headers = {"Authorization": f"Bearer {key}", "Content-Type": "application/json"} payload = { - "collectionId": __CONFIG__['colId'], + "collectionId": __CONFIG__['fastgpt_colId'], "trainingMode": "chunk", "data": data } diff --git a/main.py b/main.py index 1c50b43..b867cde 100644 --- a/main.py +++ b/main.py @@ -11,7 +11,7 @@ def query(query:str): res = [] list = search_paper(query) for i in list: - res.append({'id':'','datasetId':__CONFIG__['setId'], 'collectionId':__CONFIG__['colId'], 'sourceName':'Semantic Scholar','sourceId?':'', 'q':i['title'], 'a':i['abstract']}) + res.append({'id':'','datasetId':__CONFIG__['fastgpt_setId'], 'collectionId':__CONFIG__['fastgpt_colId'], 'sourceName':'Semantic Scholar','sourceId?':'', 'q':str(i['title']), 'a':str(i['abstract'])}) print(i['title']) return res