{"id":25816441,"url":"https://github.com/niftycode/ai-chatbot","last_synced_at":"2025-02-28T05:33:38.991Z","repository":{"id":262974253,"uuid":"718543455","full_name":"niftycode/ai-chatbot","owner":"niftycode","description":"Fetch Python related answers from OpenAI using the OpenAI api","archived":false,"fork":false,"pushed_at":"2025-02-14T12:47:11.000Z","size":2218,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T13:41:30.198Z","etag":null,"topics":["openai-api","python","tkinter"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/niftycode.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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":"2023-11-14T09:55:20.000Z","updated_at":"2025-02-14T12:45:10.000Z","dependencies_parsed_at":"2024-11-15T11:20:36.074Z","dependency_job_id":"e31ccd14-0643-4ada-81aa-c8444169617d","html_url":"https://github.com/niftycode/ai-chatbot","commit_stats":null,"previous_names":["niftycode/ai-chatbot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niftycode%2Fai-chatbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niftycode%2Fai-chatbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niftycode%2Fai-chatbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niftycode%2Fai-chatbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niftycode","download_url":"https://codeload.github.com/niftycode/ai-chatbot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241106481,"owners_count":19910832,"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":["openai-api","python","tkinter"],"created_at":"2025-02-28T05:33:38.433Z","updated_at":"2025-02-28T05:33:38.980Z","avatar_url":"https://github.com/niftycode.png","language":"Python","readme":"# ai-chatbot\n\n![Static Badge](https://img.shields.io/badge/python-3.12-blue)\n![Static Badge](https://img.shields.io/badge/python-3.13-blue)\n![GitHub License](https://img.shields.io/github/license/niftycode/ai-chatbot)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n![GitHub Issues or Pull Requests](https://img.shields.io/github/issues/niftycode/ai-chatbot)\n![GitHub last commit](https://img.shields.io/github/last-commit/niftycode/ai-chatbot)\n\n\nThis chatbot is using the OpenAI API to fetch **Python** related answers.\n\nThe program is inspired by an article from [heise.de](https://www.heise.de/ratgeber/Python-Eigene-KI-Programmierhilfe-entwickeln-9330993.html). In contrast to the code in the article, the new API (\u003e 1.0.0) is used here.\n\nInformation on how to use the new API can be found on Github:\n\n[v1.0.0 Migration Guide #742](https://github.com/openai/openai-python/discussions/742)\n\nIn the [heise.de](https://www.heise.de/ratgeber/Python-Eigene-KI-Programmierhilfe-entwickeln-9330993.html) code, the API key is hard coded. In the code used here, however, it is stored in a **binary file**. By default the key is located in\n\n    \u003e ~/Documents/API/openai-api-file.bin\n\nThis deviates from the suggestion shown [on Github](https://github.com/openai/openai-python/discussions/742)\n. Because `os.environ` is used there:\n\n    from openai import OpenAI\n\n    client = OpenAI(\n      api_key=os.environ['OPENAI_API_KEY'],\n    )\n\n**Tip**: You can create a binary file in Python using this code:\n\n    # initialize string\n    api_key = \"API_KEY\"\n\n    # open file as a binary file\n    f = open('openai-api-file', 'wb')\n\n    # convert string to bytes\n    strBytes = api_key.encode()\n\n    # write byte string to binary file\n    f.write(strBytes)\n\n    f.close()\n\n## Operating System\n\n* macOS\n* Linux\n* Windows (not tested, but should work too)\n\n## Requirements\n\n* Python \u003e= 3.12\n* openai \u003e= 1.0.0\n* OpenAI API Key\n\n## Additional Notes\n\nThis repository contains a spec file that allows you to create an executable with [PyInstaller](https://pyinstaller.org/en/stable/). This requires `pyinstaller` to be installed:\n\n```Bash\npip3 install pyinstaller\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniftycode%2Fai-chatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniftycode%2Fai-chatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniftycode%2Fai-chatbot/lists"}