fix: connect Peg to local AI runtime
MetaBloom CI / app (push) Canceled after 0s
MetaBloom CI / api (push) Canceled after 0s

This commit is contained in:
AI Company
2026-07-21 22:06:38 +00:00
parent 02e24cbc92
commit 0c2430ad13
7 changed files with 50 additions and 8 deletions
+6 -1
View File
@@ -10,7 +10,7 @@ from .config import get_settings
from .db import Base, engine, get_db
from .models import Entry, Profile, User
from .schemas import CoachChatIn, CoachChatOut, EntryIn, EntryOut, ProfileIn, ProfileOut, Register, Token
from .coach import chat_with_peg
from .coach import chat_with_peg, peg_provider_health
from .security import current_user, hash_password, make_token, verify_password
cfg = get_settings()
@@ -31,6 +31,11 @@ def health():
return {"status": "ok", "medical_notice": "MetaBloom does not diagnose or replace medical care."}
@app.get("/health/ai")
async def ai_health():
return await peg_provider_health(cfg)
@app.post("/coach/chat", response_model=CoachChatOut)
async def coach_chat(data: CoachChatIn, user: User = Depends(current_user)):
return await chat_with_peg(data, cfg)