nlp.py 767 B

1234567891011121314151617181920212223242526272829
  1. from fastapi import APIRouter, Query
  2. from app.controllers.nlp.meeting import get_caught_result
  3. from app.models.domain.nlp import MeetingInfoResponse
  4. router = APIRouter()
  5. @router.get("/meeting/info", response_model=MeetingInfoResponse)
  6. async def catch_meeting_info(sentence: str = Query(..., max_length=100)):
  7. (
  8. start_time,
  9. end_time,
  10. duration,
  11. room_size,
  12. topic,
  13. name_list,
  14. ) = await get_caught_result(sentence)
  15. response = {
  16. "Message": "success",
  17. "AcceptableStartTime": start_time,
  18. "AcceptableEndTime": end_time,
  19. "MeetingDurationSeconds": duration,
  20. "MeetingRoomSize": room_size,
  21. "Topic": topic,
  22. "Participants": name_list,
  23. }
  24. return response