{"id":24534550,"url":"https://github.com/njaffe/fast_api_chatbot","last_synced_at":"2026-04-30T07:38:50.358Z","repository":{"id":273444975,"uuid":"919743302","full_name":"njaffe/fast_api_chatbot","owner":"njaffe","description":"FastAPI powered chatbot using OpenAI API.","archived":false,"fork":false,"pushed_at":"2025-01-20T23:49:14.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-19T05:05:11.021Z","etag":null,"topics":["api","chatbot","fastapi","llms","python","uvicorn"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/njaffe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-20T23:35:14.000Z","updated_at":"2025-01-20T23:51:10.000Z","dependencies_parsed_at":"2025-01-24T02:45:19.283Z","dependency_job_id":null,"html_url":"https://github.com/njaffe/fast_api_chatbot","commit_stats":null,"previous_names":["njaffe/fast_api_chatbot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/njaffe/fast_api_chatbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/njaffe%2Ffast_api_chatbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/njaffe%2Ffast_api_chatbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/njaffe%2Ffast_api_chatbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/njaffe%2Ffast_api_chatbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/njaffe","download_url":"https://codeload.github.com/njaffe/fast_api_chatbot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/njaffe%2Ffast_api_chatbot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260690830,"owners_count":23047099,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","chatbot","fastapi","llms","python","uvicorn"],"created_at":"2025-01-22T11:17:36.960Z","updated_at":"2026-04-30T07:38:50.352Z","avatar_url":"https://github.com/njaffe.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LLM-Powered Chatbot with FastAPI\n\nThis is a simple chatbot application built with FastAPI, integrated with OpenAI’s GPT-3.5 model for natural language processing. The chatbot responds to user messages using OpenAI’s API and is deployed as a REST API.\n\n## Features\n\n- FastAPI backend for handling API requests.\n- OpenAI GPT-3.5 model used for generating chatbot responses.\n- Supports async operations for scalable performance.\n- Built-in exception handling for error management.\n\n## Requirements\n\n- Python 3.9 or higher\n- OpenAI API key\n- FastAPI\n- Uvicorn (for running the server)\n\n## Setup Instructions\n\n1. Clone the repository\n`git clone https://github.com/yourusername/fast_api_chatbot.git`\n`cd fast_api_chatbot`\n\n2. Create a virtual environment\n\n    You can use either conda or venv to create your environment. If you prefer conda:\n`conda create --name chatbot-env python=3.9`\n`conda activate chatbot-env`\n\n    Alternatively, if you’re using venv:\n`python -m venv chatbot-env`\n`source chatbot-env/bin/activate`  # On Windows: chatbot-env\\Scripts\\activate\n\n3. Install dependencies\n\n    Install the required Python packages via pip:\n`pip install -r requirements.txt`\n\n    You will also need an OpenAI API key. You can obtain one from [OpenAI’s website](https://beta.openai.com/signup/).\n\n4. Set up your environment variables\n`OPENAI_API_KEY=your-openai-api-key`\n\n5. Run the application\n\n    Start the FastAPI server using uvicorn:\n`uvicorn app.main:app --reload`\n\n    This will run the server locally at http://127.0.0.1:8000.\n\n6. Access the API\n\n    You can interact with the chatbot using the /chat endpoint. The API expects a POST request with a JSON payload:\n\n    Request:\n    `{\"message\": \"Hello, how are you?\"}`\n\n    Response:\n    `{\"response\": \"I'm doing well, thank you!\"}`\n\n    You can test the API directly from the Swagger UI, which is automatically generated by FastAPI and available at:\nhttp://127.0.0.1:8000/docs\n\n7. Stop the server\n\n    To stop the server, press Ctrl+C in the terminal.\n\n## File Structure\n\nfast_api_chatbot/\u003cbr\u003e\n├── app/\u003cbr\u003e\n│   ├── __init__.py        # FastAPI app setup\u003cbr\u003e\n│   ├── main.py            # FastAPI app setup\u003cbr\u003e\n│   ├── chatbot.py         # Chatbot logic using OpenAI\u003cbr\u003e\n│   └── models.py          # Pydantic models for request/response\u003cbr\u003e\n├── .env                   # Environment variables (OpenAI API key)\u003cbr\u003e\n├── requirements.txt       # List of dependencies\u003cbr\u003e\n└── README.md              # Project documentation\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnjaffe%2Ffast_api_chatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnjaffe%2Ffast_api_chatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnjaffe%2Ffast_api_chatbot/lists"}