The end-point implementation is like so: @app.post("/api/chat/{question}", dependencies=[Depends(sessionValidator)]) async def chat(question: str = Path(...), my_chatbot=Depends(chatbotProvider)): # Generate response try: logger.info(f"Getting LLM response..") ans = my_chatbot.chatbot.chat(question) logger.info(f"SUCCESS! Chatbot responded: {ans.response}") return ans.response except Exception as e: logger.error(f"FAILED! Got no response from...
Originally asked by Sun Bee on Stack Exchange (stackoverflow) (CC BY-SA 4.0).