fix variable name problem, upd stringize
This commit is contained in:
parent
b4aa5b1147
commit
1345f253a0
@ -24,13 +24,13 @@ def __new_set():
|
|||||||
).json()
|
).json()
|
||||||
return result["data"]
|
return result["data"]
|
||||||
|
|
||||||
__CONFIG__['colId'] = __new_set()
|
__CONFIG__['fastgpt_colId'] = __new_set()
|
||||||
|
|
||||||
def upload2fastgpt(data):
|
def upload2fastgpt(data):
|
||||||
try:
|
try:
|
||||||
headers = {"Authorization": f"Bearer {key}", "Content-Type": "application/json"}
|
headers = {"Authorization": f"Bearer {key}", "Content-Type": "application/json"}
|
||||||
payload = {
|
payload = {
|
||||||
"collectionId": __CONFIG__['colId'],
|
"collectionId": __CONFIG__['fastgpt_colId'],
|
||||||
"trainingMode": "chunk",
|
"trainingMode": "chunk",
|
||||||
"data": data
|
"data": data
|
||||||
}
|
}
|
||||||
|
2
main.py
2
main.py
@ -11,7 +11,7 @@ def query(query:str):
|
|||||||
res = []
|
res = []
|
||||||
list = search_paper(query)
|
list = search_paper(query)
|
||||||
for i in list:
|
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'])
|
print(i['title'])
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user