Schrek.fr

Mon super blog :)

  1. home
  2. posts
  3. 2023
  4. 03
  5. ChatGPT

ChatGPT dans un terminal


Table des matières

ChatGPT, le célèbre générateur de texte contrôlé par une intelligence artificielle , peut être utilisé dans un terminal.

##API key:

Il faut créer un compte et générer une API KEY ici. ça sera sur la forme.

 sk-qUP3OL6jQ95cXJbxsxyPT3BlbkFJzf3ypT6djfo2ZsjcZwME2

Le script

Tout ce trouve sur ce github.

$ wget https://github.com/0xacx/chatGPT-shell-cli/blob/main/chatgpt.sh
$ chmod +x chatgpt.sh 
$ export OPENAI_KEY=sk-qUP3OL6jdkdlQ95cXJbxsxyPT3Bldkkkff3ypT6Rn1gZsjcZwME2

Remplacez OPENAI_KEY par votre clef.

Le script a besoin de jq.

$ sudo apt install jq

et pour finir:

$ ./chatgpt.sh 
Welcome to chatgpt. You can quit with 'exit' or 'q'.

Enter a prompt:
bonjour

chatgpt Bonjour! Comment puis-je vous aider aujourd'hui?

Enter a prompt:
une blague sur les chats

chatgpt Bien sûr! Voici une blague sur les chats :

Pourquoi les chats n'aiment-ils pas jouer au poker dans la jungle ?
Parce qu'il y a trop de léopards !

Lien

https://github.com/0xacx/chatGPT-shell-cli

comments powered by Disqus

TAGS


Buy Me a Beer at ko-fi.com