mirror of
https://github.com/arc53/DocsGPT.git
synced 2026-02-21 11:51:24 +00:00
share api key through response
This commit is contained in:
@@ -596,7 +596,7 @@ def share_conversation():
|
|||||||
})
|
})
|
||||||
## Identifier as route parameter in frontend
|
## Identifier as route parameter in frontend
|
||||||
return jsonify({"success":True, "identifier":str(explicit_binary.as_uuid())}),201
|
return jsonify({"success":True, "identifier":str(explicit_binary.as_uuid())}),201
|
||||||
except ArithmeticError as err:
|
except Exception as err:
|
||||||
print (err)
|
print (err)
|
||||||
return jsonify({"success":False,"error":str(err)}),400
|
return jsonify({"success":False,"error":str(err)}),400
|
||||||
|
|
||||||
@@ -619,13 +619,15 @@ def get_publicly_shared_conversations(identifier : str):
|
|||||||
else:
|
else:
|
||||||
return jsonify({"sucess":False,"error":"might have broken url or the conversation does not exist"}),404
|
return jsonify({"sucess":False,"error":"might have broken url or the conversation does not exist"}),404
|
||||||
date = conversation["_id"].generation_time.isoformat()
|
date = conversation["_id"].generation_time.isoformat()
|
||||||
return jsonify({
|
res = {
|
||||||
"success":True,
|
"success":True,
|
||||||
"queries":conversation_queries,
|
"queries":conversation_queries,
|
||||||
"title":conversation["name"],
|
"title":conversation["name"],
|
||||||
"timestamp":date
|
"timestamp":date
|
||||||
}), 200
|
}
|
||||||
|
if(shared["isPromptable"] and "api_key" in shared):
|
||||||
|
res["api_key"] = shared["api_key"]
|
||||||
|
return jsonify(res), 200
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
print (err)
|
print (err)
|
||||||
return jsonify({"success":False,"error":str(err)}),400
|
return jsonify({"success":False,"error":str(err)}),400
|
||||||
|
|
||||||
Reference in New Issue
Block a user