|
@@ -8,6 +8,7 @@ from moon_shoot_api import MoonShotHandle
|
|
|
|
|
|
config_ = set_config()
|
|
|
log_ = Log()
|
|
|
+moonShotHandle_ = MoonShotHandle()
|
|
|
|
|
|
|
|
|
def get_tag(prompt):
|
|
@@ -54,7 +55,7 @@ def request_gpt(prompt):
|
|
|
while retry_count < config_.RETRY_MAX_COUNT:
|
|
|
retry_count += 1
|
|
|
try:
|
|
|
- result_content = MoonShotHandle.chat_with_chatgpt(prompt)
|
|
|
+ result_content = moonShotHandle_.chat(prompt)
|
|
|
|
|
|
|
|
|
|
|
@@ -67,8 +68,17 @@ def request_gpt(prompt):
|
|
|
|
|
|
|
|
|
|
|
|
+ if "```json" in result_content:
|
|
|
+ result_content = result_content.split(
|
|
|
+ "```json")[1].split("```")[0]
|
|
|
return result_content
|
|
|
except Exception:
|
|
|
+ log_.error(traceback.format_exc())
|
|
|
time.sleep(10)
|
|
|
continue
|
|
|
return result_content
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|