Skip to content

Commit

Permalink
Merge pull request #761 from Ikaros-521/owner
Browse files Browse the repository at this point in the history
程序内部api调用监听地址改为0.0.0.0,为后期跨网络调用提供服务
  • Loading branch information
Ikaros-521 committed Apr 14, 2024
2 parents 09c3c52 + 0a954d8 commit df3cccb
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 @@ -146,7 +146,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 @@ -2535,8 +2535,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 @@ -2550,7 +2550,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 df3cccb

Please sign in to comment.