Skip to content

Commit

Permalink
程序内部api调用监听地址改为0.0.0.0,为后期跨网络调用提供服务
Browse files Browse the repository at this point in the history
  • Loading branch information
Ikaros-521 committed Apr 14, 2024
1 parent 09a11f1 commit 0a954d8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def llm():
except Exception as e:
return jsonify({"code": -1, "message": f"发送数据失败!{e}"})

app.run(host=config.get("api_ip"), port=config.get("api_port"), debug=False)
app.run(host="0.0.0.0", port=config.get("api_port"), debug=False)

# HTTP API线程并启动
schedule_thread = threading.Thread(target=http_api_thread)
Expand Down Expand Up @@ -2531,8 +2531,8 @@ def send():
data_json = request.get_json()
logging.info(f"API收到数据:{data_json}")

if data_json["type"] == "reread":
my_handle.reread_handle(data_json)
if data_json["type"] in ["reread", "reread_top_priority"]:
my_handle.reread_handle(data_json, type=data_json["type"])
elif data_json["type"] == "comment":
my_handle.process_data(data_json, "comment")
elif data_json["type"] == "tuning":
Expand All @@ -2546,7 +2546,7 @@ def send():
except Exception as e:
return jsonify({"code": -1, "message": f"发送数据失败!{e}"})

app.run(host=config.get("api_ip"), port=config.get("api_port"), debug=False)
app.run(host="0.0.0.0", port=config.get("api_port"), debug=False)
# app.run(host="0.0.0.0", port=8082, debug=True)
elif platform == "youtube":
import pytchat
Expand Down

0 comments on commit 0a954d8

Please sign in to comment.