fix: connect Peg to local AI runtime
This commit is contained in:
+6
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user