Agent 서버 구축: 멀티테넌트 협상 PoC (UCB Q-Table 학습 + /chat + 14 API + 학습검증 하네스), config 단일화(local.toml) + 빌드 경량화
This commit is contained in:
1 parent
212725e5f9
commit
951d6eab84
140 files changed
+6689
-214
No files matched your search
@@ -0,0 +1,36 @@
|
||||
"""learning.experience_logs 를 company_id 별로 집계 출력 (DB 격리 확인용).
|
||||
|
||||
실행: cd agent && APP_ENV=local python -m tools.show_logs
|
||||
"""
|
||||
|
||||
import asyncio
|
||||
|
||||
from sqlalchemy import func, select
|
||||
|
||||
from common.database.db_session_manager import DB_SESSION_MNG
|
||||
from common.database.model.models import ExperienceLog
|
||||
from common.enums import DBType, DBWRType
|
||||
|
||||
|
||||
async def main():
|
||||
def q(s):
|
||||
stmt = (
|
||||
select(ExperienceLog.company_id, func.count().label("n"), func.max(ExperienceLog.reward).label("max_reward"))
|
||||
.group_by(ExperienceLog.company_id)
|
||||
.order_by(ExperienceLog.company_id)
|
||||
)
|
||||
return DB_SESSION_MNG.execute(s, stmt)
|
||||
|
||||
err, rows = await DB_SESSION_MNG.execute_lambda(DBType.MAIN.value, DBWRType.DB_READ.value, q)
|
||||
print("company_id count max_reward")
|
||||
print("-" * 44)
|
||||
for company_id, n, max_reward in rows:
|
||||
mr = f"{max_reward:+.4f}" if max_reward is not None else " n/a "
|
||||
print(f"{company_id:<20} {n:>6} {mr}")
|
||||
if not rows:
|
||||
print("(비어있음 — 먼저 tools.console_demo 를 실행하세요)")
|
||||
await DB_SESSION_MNG.dispose_all()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
Reference in new issue
Block a user