{"id":24623759,"url":"https://github.com/ecopque/api_chatgpt","last_synced_at":"2026-04-18T14:03:21.842Z","repository":{"id":273357627,"uuid":"919440525","full_name":"ecopque/api_chatgpt","owner":"ecopque","description":"Solution in Python that uses the ChatGPT API to create a question-and-answer assistant. The system allows users to ask questions and receive answers in real time, maintaining the context of interactions.","archived":false,"fork":false,"pushed_at":"2025-01-30T18:12:54.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-19T07:21:19.736Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://linktr.ee/edsoncopque","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/ecopque.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,"zenodo":null}},"created_at":"2025-01-20T11:51:17.000Z","updated_at":"2025-01-30T18:12:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"c062e747-588a-4151-9000-138afcea1d91","html_url":"https://github.com/ecopque/api_chatgpt","commit_stats":null,"previous_names":["ecopque/api_chatgpt"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ecopque/api_chatgpt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecopque%2Fapi_chatgpt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecopque%2Fapi_chatgpt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecopque%2Fapi_chatgpt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecopque%2Fapi_chatgpt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ecopque","download_url":"https://codeload.github.com/ecopque/api_chatgpt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecopque%2Fapi_chatgpt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31971490,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"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":[],"created_at":"2025-01-25T03:58:17.350Z","updated_at":"2026-04-18T14:03:16.832Z","avatar_url":"https://github.com/ecopque.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ChatGPT API Python Integration\n\nThis repository contains a Python implementation that integrates the [OpenAI ChatGPT API](https://platform.openai.com/docs/guides/text-generation) for creating a simple interactive question-and-answer assistant.\n\n## Overview\n\nThe Python script interacts with the ChatGPT API to provide real-time responses to user queries while maintaining the context of the conversation. It allows users to ask questions, receive answers, and continue the conversation in a natural flow.\n\n### Key Features\n- **API Integration:** Easy setup using the OpenAI API key.\n- **Message History Management:** Maintains context of interactions for more accurate responses.\n- **Continuous Interaction:** Allows ongoing conversations until the user decides to stop.\n\n## Setup\n\n### Prerequisites\n1. **Python \u003e= 3.11 installed on your machine.\n2. **OpenAI API Key:** You need an API key from [OpenAI](https://platform.openai.com/settings/organization/api-keys).\n\n### Installation\n\n1. Install the required dependencies:\n    ```bash\n    pip install openai\n    ```\n\n2. Replace the API key in the script (`API_ChatGPT.py`) with your own.\n\n3. Run the script:\n    ```bash\n    python3 API_ChatGPT.py\n    ```\n\n### Example Usage\n\nOnce the script is running, you can input your question in the terminal. The assistant will respond based on the message history, and you can continue the conversation until you type `'end'` to stop.\n\n```bash\nAsk your question: Who was Carl Sagan?\nAnswer: Carl Sagan was an American astronomer, astrophysicist, and science communicator.\nAsk your question: Tell me more about his work.\nAnswer: Carl Sagan made significant contributions to our understanding of planetary science...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecopque%2Fapi_chatgpt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fecopque%2Fapi_chatgpt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecopque%2Fapi_chatgpt/lists"}