{"id":24535267,"url":"https://github.com/mroblesdev/chatgpt-python","last_synced_at":"2025-10-12T09:14:12.170Z","repository":{"id":273303169,"uuid":"919255139","full_name":"mroblesdev/chatgpt-python","owner":"mroblesdev","description":" Uso del API de ChatGPT desde Python ","archived":false,"fork":false,"pushed_at":"2025-01-20T04:11:12.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-18T05:37:26.435Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/mroblesdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":"2025-01-20T03:50:36.000Z","updated_at":"2025-01-26T16:33:17.000Z","dependencies_parsed_at":"2025-01-20T05:18:45.102Z","dependency_job_id":"a166c730-8ba0-4973-9a73-257c49e05ce3","html_url":"https://github.com/mroblesdev/chatgpt-python","commit_stats":null,"previous_names":["mroblesdev/chatgpt-python"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mroblesdev/chatgpt-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mroblesdev%2Fchatgpt-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mroblesdev%2Fchatgpt-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mroblesdev%2Fchatgpt-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mroblesdev%2Fchatgpt-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mroblesdev","download_url":"https://codeload.github.com/mroblesdev/chatgpt-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mroblesdev%2Fchatgpt-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010963,"owners_count":26084837,"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-12T02:00:06.719Z","response_time":53,"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-22T12:16:38.859Z","updated_at":"2025-10-12T09:14:12.148Z","avatar_url":"https://github.com/mroblesdev.png","language":"Python","funding_links":["https://www.paypal.com/paypalme/markorobles?locale.x=es_XC."],"categories":[],"sub_categories":[],"readme":"# Chat con OpenAI API\r\n\r\nEste repositorio contiene dos scripts en Python que implementan un sistema de chat utilizando la API de OpenAI. Los scripts permiten interactuar con un modelo de lenguaje (GPT-4o-mini) de manera dinámica.\r\n\r\n## Requisitos\r\n\r\nAntes de ejecutar los scripts, asegúrate de tener instalados los siguientes elementos:\r\n\r\n- Python 3.7 o superior.\r\n- Biblioteca `openai` instalada. Puedes instalarla con:\r\n  ```bash\r\n  pip install openai\r\n  ```\r\n\r\n## Configuración\r\n\r\nPara usar los scripts, necesitas una clave de API válida de OpenAI. \r\n\r\n```bash\r\nclient = OpenAI(api_key=\"TU_API_KEY\")\r\n```\r\n\r\n## Scripts\r\n\r\n### 1. **`basico.py`**\r\n\r\nEste script realiza una consulta simple al modelo GPT-4o-mini y muestra la respuesta en la terminal.\r\n\r\n**Uso:**\r\n```bash\r\npython basico.py\r\n```\r\n\r\n**Flujo del script:**\r\n- Envía una pregunta definida al modelo.\r\n- Muestra la respuesta generada.\r\n\r\n---\r\n\r\n### 2. **`chat.py`**\r\n\r\nEste script implementa un sistema de chat interactivo donde puedes enviar múltiples mensajes y recibir respuestas del modelo.\r\n\r\n**Uso:**\r\n```bash\r\npython chat.py\r\n```\r\n\r\n**Flujo del script:**\r\n- Escribe tu mensaje en la consola.\r\n- Recibe una respuesta del modelo.\r\n- Escribe \"salir\", \"exit\" o \"quit\" para finalizar el programa.\r\n\r\n---\r\n\r\n## Ejemplo de Ejecución\r\n\r\n### Script Básico:\r\n```bash\r\nTú: ¿Qué es Python?\r\nAsistente: Python es un lenguaje de programación...\r\n```\r\n\r\n### Chat Interactivo:\r\n```bash\r\nTú: Hola\r\nAsistente: ¡Hola! ¿En qué puedo ayudarte?\r\n\r\nTú: ¿Qué es Python?\r\nAsistente: Python es un lenguaje de programación...\r\n\r\nTú: salir\r\nAsistente: Bye!\r\n```\r\n\r\n## Contribución\r\n\r\nLas contribuciones son bienvenidas. Siéntete libre de abrir un issue o pull request para mejoras.\r\n\r\n## Licencia\r\n\r\nEste proyecto está licenciado bajo la [MIT License](LICENSE).\r\n\r\n## Expresiones de Gratitud 🎁\r\n\r\n- Comenta a otros sobre este proyecto 📢\r\n- Invitame una cerveza 🍺 o un café ☕ [Da clic aquí](https://www.paypal.com/paypalme/markorobles?locale.x=es_XC.).\r\n- Da las gracias públicamente 🤓.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmroblesdev%2Fchatgpt-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmroblesdev%2Fchatgpt-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmroblesdev%2Fchatgpt-python/lists"}