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

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

Jun 1, 2023

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

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

bottom of page