From b830d0d15c89610c6462fae772d3418027c07cb4 Mon Sep 17 00:00:00 2001 From: zhanggangyong Date: Fri, 30 Jan 2026 12:28:28 +0000 Subject: [PATCH] Initial commit: my-test-agent with 1 tools - run_api_server.py --- run_api_server.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 run_api_server.py diff --git a/run_api_server.py b/run_api_server.py new file mode 100644 index 0000000..fdd7da9 --- /dev/null +++ b/run_api_server.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +"""启动 API 服务器""" +import sys +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).parent)) + +if __name__ == '__main__': + from src.server.api_server import app + import uvicorn + import os + + host = os.getenv('API_HOST', '0.0.0.0') + port = int(os.getenv('API_PORT', '8000')) + + print(f"🚀 启动 Agent API: http://{host}:{port}") + uvicorn.run(app, host=host, port=port, log_level="info")