[ESP/ENG] Chat GPT en Visual Studio Code./ Chat GPT in Visual Studio Code.

avatar

Introducción / Introduction

Hola a todos los miembros de esta hermosa comunidad!!!
Seguramente habrán oído acerca de como la Inteligencia Artificial(IA) ha impactado en la vida de las personas, proporcionando herramientas increíblemente útiles para aquellos que las necesiten. Ya sea en el ámbito de la educación, la salud, el marketing o la música, el uso de la IA es hoy una tendencia a nivel mundial.

Hello to all the members in this beautiful community!!!
Surely you have heard about how Artificial Intelligence (AI) has impacted people's lives, providing incredibly useful tools for those who need them. Whether in the field of education, health, marketing or music, the use of AI is now a worldwide trend.

Hoy escribo con la intención de hacerle llegar a quiénes se desenvuelven en el ámbito de la programación, interesante información acerca de como utilizar la IA en la escritura, documentación y análisis de código en la realización de proyectos dentro del excelente editor de código Visual Studio Code, muy utilizado por la comunidad de programadores en todo el mundo.

Today I am writing with the intention of sending to those who develop in the field of programming, interesting information about how to use AI in the writing, documentation and analysis of code in the realization of projects within the excellent code editor Visual Studio Code, widely used by the community of programmers around the world.

Como una de las herramientas de Inteligencia Artificial más poderosa y disponible para su utilización públicamente, se encuentra Chat GPT, siendo además tendencia actualmente debido al poder de respuesta que posee. Aunque es de pago, al registrarte en su plataforma se te consederán 18 dólares en créditos para utilizar sus servicios. Ya que la utilización de la misma es bastante asequible económicamente, este bono inicial te permitirá hacer muchas preguntas a esta asombrosa IA antes de que se acabe tu crédito.

As one of the most powerful Artificial Intelligence tools and available for public use, Chat GPT is also currently trending due to the response power it has. Although it is paid, when registering on their platform you will be granted $ 18 in credits to use their services. Since the use of it is quite affordable economically, this initial bonus will allow you to ask many questions to this amazing AI before your credit runs out.

¿Cómo empezar? / How to start?

1- Registrarse en la plataforma openai.com

1- Register on the platform openai.com


En la página principal dirijase hacia la barra de navegación y presione "API".

On the main page go to the navigation bar and press "API".


Presione el botón "Sign UP" y rellene los formularios que a continuación le sean solicitados. Es importante aclarar que si eres de Cuba u otro país que pueda estar bloqueado por este tipo de plataformas, es necesario un número de teléfono para realizar exitosamente el registro en la aplicación, por lo que deberá conseguir uno de otro país.

Press the "Sign UP" button and fill in the forms that are requested below. It is important to clarify that if you are from Cuba or another country that may be blocked by this type of platforms, a phone number is necessary to successfully register in the application, so you must get one from another country.

Una vez registrado correctamente puede continuar con los siguientes pasos.

Once successfully registered you can proceed to the next steps.

2- Instalar la extensión para Visual Studio Code que permite utilizar la IA de Chat GPT para escribir y analizar código.

2- Install the extension for Visual Studio Code that allows using the Chat GPT AI to write and analyze code.


Abrir Visual Studio Code y hacer click sobre el icono de "Extensiones" (señalado con una flecha en la imagen de arriba). Luego escribir entre comillas "Code GPT" en el cuadro de búsqueda de extensiones y por último instalar la extensión con ese nombre. Créditos a Daniel San por crear tan buena extensión.

Open Visual Studio Code and click on the "Extensions" icon (indicated with an arrow in the image above). Then type in quotes "Code GPT" in the extension search box and finally install the extension with that name. Credits to Daniel San for creating such a good extension.

3- Vincular tu cuenta en openai.com a la extension Code GPT y configurar la IA para su uso dentro de Visual Studio Code.

3- Link your account in openai.com to the Code GPT extension and configure the AI for use within Visual Studio Code.


En la página de inicio de openai.com, una vez iniciada la sesión dentro de la misma, dirijase hacia la esquina superior derecha de la página y presione sobre su usuario. Se desplegará un menú de opciones, de las cuales seleccionará "View API keys".

On the home page of openai.com, once logged in to it, go to the upper right corner of the page and click on your user. A menu of options will be displayed, from which you will select "View API keys".


Luego de hacer click en "View API keys", se visualizará una página que le dará la posibilidad de crear nuevas claves secretas para utilizar la API de Chat GPT en cualquier plataforma o aplicación que se lo permita. Presione el botón "+ Create new secret key" y copie la clave generada en su portapapeles.

After clicking on "View API keys", a page will be displayed that will give you the possibility to create new secret keys to use the Chat GPT API on any platform or application that allows it. Press the "+ Create new secret key" button and copy the generated key to your clipboard.


Abra Visual Studio Code y presione el icono con forma de engranaje. En el menú de opciones desplegado a continuación seleccione "Settings" o utilice la combinación de teclas "Ctrl + ,".

Open Visual Studio Code and press the gear-shaped icon. In the options menu displayed below select "Settings" or use the key combination "Ctrl + ,".


Dentro de las opciones de configuración de Visual Studio Code haga click en "Extensions" o "Extensiones" (señalado en rojo) si lo tiene en español. Luego haga click en la extensión llamada "CodeGPT" (señalada en azul) y pegue su clave secreta en el campo señalado con el color verde en la imagen de arriba.

Within the Visual Studio Code configuration options, click on "Extensions" (indicated in red). Then click on the extension called "CodeGPT" (indicated in blue) and paste your secret key in the field indicated with the green color in the image above.

Señalado con color morado se encuentra una opción para configurar la cantidad máxima de caracteres con los que prefiere que la IA devuelva una respuesta.

Marked with purple color is an option to configure the maximum number of characters with which you prefer the AI to return a response.

Señalado con color marrón se encuentra la configuración del modelo de procesado que utilizará la IA a la hora de responder. Recomiendo utilizar el que se encuentra en la imagen "text-davinci-003" ya que es el último lanzado y el que mejores resultados me ha dado personalmente.

Indicated with brown color is the configuration of the processing model that the AI will use when responding. I recommend using the one found in the image "text-davinci-003" since it is the latest one released and the one that has given me the best results personally.

Y por último, señalado en amarillo se encuentra la configuración de la temperatura, es decir, la creatividad con la que desea que la IA responda. Este valor puede variar de 0 a 1, siendo 0 el nivel de respuesta más estricto.

And finally, indicated in yellow is the temperature setting, that is, the creativity with which you want the AI to respond. This value can vary from 0 to 1, with 0 being the strictest response level.

¿Cómo usar esta extensión? / How to use this extension?.

1- Comentarios

1- Comments


Abra un archivo con el formato de cualquier lenguaje de programación en el que desee obtener una respuesta de la IA y escriba y un comentario con lo que le quiere preguntar. Luego de establecer la pregunta en formato de comentario, presionar la combinación de teclas "Ctrl + Shift + i".

Open a file with the format of any programming language in which you want to get an answer from the AI and write and a comment with what you want to ask. After setting the question in comment format, press the key combination "Ctrl + Shift + i".


Automáticamente le saldrá una nueva ventana a su derecha con la respuesta generada por la IA. En mi caso el lenguaje de programación es javascript y la pregunta es "Haz una función que tome dos matrices como entrada y devuelva su suma y su multiplicación como dos matrices separadas". La respuesta por parte de la IA fue bastante correcta.

A new window will automatically pop up on your right with the answer generated by the AI. In my case the programming language is javascript and the question is "Make a function that takes two bidimensional arrays as input and returns their addition and multiplication as two separate bidimensional arrays". The answer from the AI was quite correct.

2- Panel de comandos

2- Command panel


Otra forma de preguntar algo a la IA es a través del panel de comandos presionando la combinación de teclas "Ctrl + Shift + P". Esriba en el cuadro de texto del panel de comandos lo siguiente: "Ask CodeGPT" y presione la tecla enter. Luego en el cuadro de texto escriba la pregunta que le desea realizar y presione la tecla enter nuevamente. Esta vez deberá especificar el lenguaje de programación a utilizar. La respuesta se muestra de la misma manera que en el primer ejemplo de esta sección.

Another way to ask the AI something is through the command panel by pressing the "Ctrl + Shift + P" key combination. It is necessary to type in the text box of the command panel the following: "Ask CodeGPT" and press the enter key. Then in the text box type the question you want to ask him and press the enter key again. This time you will need to specify the programming language to be used. The answer is displayed in the same way as in the first example in this section.

3- Refactorización, Explicación y Corrección

3- Refactoring, Explanation and Correction


Si seleccionamos cualquier código ya escrito por nosotros y presionamos click derecho sobre el mismo, podremos apreciar un menú de opciones referentes a los servicios ofrecidos por la extensión. Podemos pedirle a la IA que nos explique el código, que lo refactorice, que haga una documentación para el mismo o que encuentre algún error en su estructura. Los invito a probar estas opciones por su cuenta, no se decepcionarán.

If we select any code already written by us and press right click on it, we will be able to appreciate a menu of options regarding the services offered by the extension. We can ask the AI to explain the code to us, to refactor it, to make a documentation for it or to find some error in its structure. I invite you to try these options on your own, you will not be disappointed.

Y bueno hasta aquí el post. Espero que haya sido de su interés y agrado. Un saludo a todos los hivers.

And well so far the post. I hope it has been of your interest and liking. Greetings to all the hivers.



0
0
0.000
5 comments
avatar

Muy interesante. Lástima que sea limitado en versiones gratis, pero de igual manera se agradece poder utilizarlo.

¡Saludos!

0
0
0.000
avatar

¡Hola @valtervalik! Te saluda Ajolote, un integrante del Proyecto Aliento.👋🏼🪸**

Excelente herramienta que nos traes para que todos los hivers vayan relacionándose más profundamente con el manejo de las IAs.


En el proyecto Aliento instamos a los hivers a realizar sus post en nichos acordes a su contenido para que tengan mayor visibilidad y alcance.

Esperamos te sea de utilidad la siguiente sugerencia de comunidad, para publicaciones futuras de este tipo:

GEEKZONE
https://peakd.com/c/hive-106817/created


¡Todo contenido tiene cabida en hive, solo debemos encontrar el mejor lugar para crecer! Saludos @valtervalik👋🏼


Nichos - Aliento! (1).png

Te invitamos a visitar las Comunidades Amigas apoyadas por el Proyecto Aliento. Si tienes dudas puedes escribir en nuestro servidor, en el canal #dudasypreguntas, donde con gusto te atenderemos.

Síguenos en Hive @alientoNuestra Página Web Aliento.blogSíguenos en Twitter
Nuestro Servidor de Discord AlientoVota por Aliento como testigo¿Qué es un testigo? - Haz Clic aquí

0
0
0.000
avatar

Congratulations @valtervalik! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You received more than 200 upvotes.
Your next target is to reach 300 upvotes.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Check out our last posts:

Our Hive Power Delegations to the December PUM Winners
Feedback from the January Hive Power Up Day
Hive Power Up Month Challenge 2022-12 - Winners List
The Hive Gamification Proposal Renewal
Support the HiveBuzz project. Vote for our proposal!
0
0
0.000
avatar

Este codigo ha llamado la atencion estos ultimos dias, lastima que no conozco nada de programacion para si entender todos los procesos que el ejecuta.

0
0
0.000