Files
pingtai_agent/steering_agent/run_api_server.py
T

24 lines
791 B
Python

#!/usr/bin/env python
"""启动 Steering Agent 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"🚀 启动 Steering Agent API: http://{host}:{port}")
print("📋 核心功能:")
print(" - extract_project_knowledge: 提取项目知识")
print(" - add_rule / list_rules: 规则管理")
print(" - get_context: 获取项目上下文")
print(" - check_compliance: 合规检查")
print(" - generate_steering_doc: 生成规范文档")
uvicorn.run(app, host=host, port=port, log_level="info")