{"id":28372337,"url":"https://github.com/chris-official/chatbot","last_synced_at":"2026-05-02T23:32:24.321Z","repository":{"id":248565707,"uuid":"802932499","full_name":"chris-official/chatbot","owner":"chris-official","description":"OpenAI-based Weather Chatbot.","archived":false,"fork":false,"pushed_at":"2024-07-19T12:43:24.000Z","size":407,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-05T14:15:02.722Z","etag":null,"topics":["chatbot","dash","langchain","openai","python"],"latest_commit_sha":null,"homepage":"https://iu-weather-chatbot.onrender.com","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/chris-official.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":"2024-05-19T16:41:15.000Z","updated_at":"2024-11-07T16:56:00.000Z","dependencies_parsed_at":"2024-07-15T20:47:59.886Z","dependency_job_id":"d388982a-fa41-44e3-8659-55cef8b74c2f","html_url":"https://github.com/chris-official/chatbot","commit_stats":null,"previous_names":["chris-official/chatbot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chris-official/chatbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-official%2Fchatbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-official%2Fchatbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-official%2Fchatbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-official%2Fchatbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chris-official","download_url":"https://codeload.github.com/chris-official/chatbot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-official%2Fchatbot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278956338,"owners_count":26075221,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["chatbot","dash","langchain","openai","python"],"created_at":"2025-05-29T14:16:06.755Z","updated_at":"2025-10-08T13:48:05.592Z","avatar_url":"https://github.com/chris-official.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"assets/iu-logo.png\" alt=\"Logo\" width=\"150\"\u003e\n  \u003ch1\u003eProject: AI Use Case - Weather Chatbot\u003c/h1\u003e\n\u003c/div\u003e\n\n![Weather Chatbot](assets/screenshot.png)\n\n## Description\n\nThis is a weather chatbot that uses the [LangChain](https://python.langchain.com/v0.2/docs/introduction/) library, the\n[OpenAI](https://platform.openai.com/docs/api-reference/introduction) API and the\n[OpenWeatherMap](https://openweathermap.org/api) API to generate responses to weather-related user queries. A user\ninterface is provided by a [Dash](https://dash.plotly.com/tutorial) web application that allows users to chat with the\nchatbot intuitively without any manual installations. The chatbot has been deployed on [Render](https://render.com/)\nand can be accessed online by visiting [iu-weather-chatbot.onrender.com](https://iu-weather-chatbot.onrender.com).\n\n\n## Web UI (recommended)\n\nNo manual installation is required, and you can start chatting immediately! \u003cbr\u003e\nYou can visit the online chatbot here: [iu-weather-chatbot.onrender.com](https://iu-weather-chatbot.onrender.com)\n\n\u003e [!WARNING]\n\u003e When accessing the online chatbot after a longer period of inactivity, you may need to wait for the\n\u003e server to start up. This can take up to 3 minutes. Therefore, please be patient and wait for the website to load.\n\n\u003e [!TIP]\n\u003e For the best experience, use the chatbot on a desktop or laptop. Even though the chatbot is mobile-friendly,\n\u003e the UI is optimized for larger screens and some features are disabled to fit the smaller screen size of mobile\n\u003e devices.\n\n\n## Manual Installation\n\nDownload the contents of the chatbot repository or clone it using the following command:\n\n```bash \ngit clone https://github.com/chris-official/chatbot.git\ncd chatbot\n```\n\nIt is recommended to use `Python=3.12`. However, `Python\u003e=3.10` may also work but has not been tested.\nCreate a new virtual environment and activate it:\n    \n```bash\npython -m venv chatbot_env\nchatbot_env/Scripts/activate.bat  # Linux: source chatbot_env/bin/activate\n```\n\nAlternatively, you can use `conda` to create a new environment:\n\n```bash\nconda create --name chatbot_env python=3.12.4\nconda activate chatbot_env\n```\n\nInstall the required dependencies:\n\n```bash\npip install -r requirements.txt\n```\n\nOpen the `.env` file and add your OpenAI and OpenWeatherMap API key. You can get your OpenAI key\n[here](https://platform.openai.com/api-keys) and your OpenWeatherMap key\n[here](https://home.openweathermap.org/api_keys). Finally, the file should look like this:\n\n```bash\nOPENAI_API_KEY=\"your_openai_api_key\"\nOPENWEATHERMAP_API_KEY=\"your_openweathermap_api_key\"\n```\n\nTo start the chatbot interface on your machine, run `app.py` by executing the following command:\n\n```bash\npython app.py\n```\n\nThis will initiate a local server at [`http://127.0.0.1:8050`](http://127.0.0.1:8050).\nTo start chatting with the chatbot, simply open this URL in your browser.\n\n\u003e [!WARNING]\n\u003e When no API keys are provided, the chatbot will automatically start in offline mode and will not make any API calls.\n\u003e Instead, a default response will be displayed. For the chatbot to work properly, you must provide the API keys or\n\u003e visit the online chatbot.\n\n\n## Features\n\nThe chatbot provides following functionalities:\n1. **Weather Information**: The chatbot can provide the current weather information and the weather forecasts for the\nnext 7 days for a specific city. This includes the temperature, humidity, wind speed, cloudiness, UV index, and\nprecipitation. This information is retrieved in real-time from the OpenWeatherMap API.\n2. **Weather-related Queries**: The chatbot can also answer more general weather-related queries based on the LLMs\nfoundational knowledge.\n3. **Offline Mode**: When the chatbot is set up locally and no API keys are provided, the chatbot will run in offline\nmode and will not make any API calls. However, chat functionality is still available for testing purposes.\n4. **Conversation Memory**: The chatbot remembers the last 4 chat messages and can use them to generate more\ncontextually relevant responses.\n\nThe UI offers four features:\n1. **Chat Interface**: The chat interface (middle) allows users to interact with the chatbot and displays the chat\nhistory. The chatbot can be reset at any time by refreshing the page.\n2. **Prompt Examples**: The examples column (left) provides some example prompts that users can ask the chatbot by\nsimply clicking on them and submitting the query. This column is hidden on mobile devices.\n3. **Weather Information**: The weather information column (right) summarizes the requested weather information for the\nspecified location for the next 7 days. The information is updated automatically as soon as the user interacts with the\nchatbot. This column is hidden on mobile devices.\n4. **Theme Switch**: The theme switch button in the top right corner allows users to switch between light and dark mode.\n\n\u003e [!NOTE]\n\u003e The Prompt Examples and Weather Information columns are hidden on mobile devices to provide a better user experience\n\u003e on smaller screens.\n\n\n## Example\n\n1. Select a prompt from the examples column or type a query in the chat interface. Your prompt should be a general\nweather-related question or address the weather in a specific location determined by the city name. In case of an\nambiguous city name, you may need to provide the country or state as well. Otherwise, the chatbot will choose one\nlocation. The selected location is displayed at the top of the weather information column as soon as the chatbot has\nmade a successful API call.\n2. Press the \"Send\" button or hit \"Enter\" to submit your query.\n3. Wait for the chatbot to generate a response.\n4. Keep the conversation going by asking more questions!\n\n\n## Troubleshooting\n\nIf you encounter any server related issues (Error code: 5XX), please check the server status on the\n[Render Status Page](https://status.render.com) for any ongoing incidents and try again later.\n\n\n## License\n\nThis project was developed as part of the course \"Project: AI Use Case\" at the International University of \nApplied Sciences (IU) and is not intended for use other than educational purposes.\n\n\n## References\n\n* [Dash Bootstrap Components](https://dash-bootstrap-components.opensource.faculty.ai/docs/)\n* [Dash Chatbot Example](https://github.com/plotly/dash-sample-apps/tree/main/apps/dash-gpt3-chatbot)\n* [Google Fonts](https://fonts.google.com/specimen/Poppins)\n* [LangChain Custom Tools](https://python.langchain.com/v0.2/docs/how_to/custom_tools/)\n* [LangChain OpenWeatherMap Tool](https://python.langchain.com/v0.2/docs/integrations/tools/openweathermap/)\n* [LangChain OpenWeatherMap Wrapper](https://python.langchain.com/v0.2/docs/integrations/providers/openweathermap/)\n* [LangChain Tool Calling Agents](https://python.langchain.com/v0.1/docs/modules/agents/agent_types/tool_calling/)\n* [OpenWeatherMap API Docs](https://openweathermap.org/api/one-call-3)\n* [OpenWeatherMap Geocoding API](https://openweathermap.org/api/geocoding-api)\n* [OpenWeatherMap Weather Condition Icons](https://openweathermap.org/weather-conditions)\n* [PyOWM Docs](https://pyowm.readthedocs.io/en/latest/v3/code-recipes.html)\n* [PyOWM GitHub](https://github.com/csparpa/pyowm)\n* [Render Dashboard](https://dashboard.render.com)\n* [Render Web Service](https://docs.render.com/web-services)\n* [Robot Icon](https://cdn-icons-png.flaticon.com/512/3398/3398643.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchris-official%2Fchatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchris-official%2Fchatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchris-official%2Fchatbot/lists"}