from fastapi import FastAPI, HTTPException from pydantic import BaseModel import openai import os # Initialize FastAPI app app = FastAPI() # Set your OpenAI API key openai.api_key = os.getenv("OPENAI_API_KEY") class ChatRequest(BaseModel): message: str user_id: str @app.post("/chat") async def chat_with_bot(request: ChatRequest): try: response = openai.ChatCompletion.create( model="gpt-4", messages=[{"role": "user", "content": request.message}] ) reply = response["choices"][0]["message"]["content"] return {"response": reply} except Exception as e: raise HTTPException(status_code=500, detail=str(e))
top of page

Latest News

Oct 1, 2023

school massage therapist Avaible

Amom student clinic LMT available to book

school massage therapist Avaible

Jun 1, 2023

Student clinic booking available Friday and weekend. ! ONLY ONLINE BOOKING AND PAYMENT

Amom student clinic is opening friday and weekend now, only for online booking and payment

Student clinic booking available Friday and weekend. ! ONLY ONLINE BOOKING AND PAYMENT
bottom of page