Skip to content

Commit

Permalink
Merge pull request #826 from lucagobbi/develop
Browse files Browse the repository at this point in the history
fix experimental message endpoint
  • Loading branch information
pieroit committed May 19, 2024
2 parents 3860a48 + 91b4f95 commit 3c675c2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions core/cat/routes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import tomli
from cat.headers import session

from cat.convo.messages import CatMessage

router = APIRouter()

Expand All @@ -20,13 +21,11 @@ async def home() -> Dict:
}


@router.post("/message")
@router.post("/message", response_model=CatMessage)
async def message_with_cat(
payload: Dict = Body({"text": "hello!"}),
stray = Depends(session),
) -> Dict:
"""Get a response from the Cat"""

answer = await stray(payload)

answer = await stray({"user_id": stray.user_id, **payload})
return answer

0 comments on commit 3c675c2

Please sign in to comment.