This is a demo of ChatCompletion using the OpenAI Python API with comments in Japanese, allowing you to chat just like the web version of ChatGPT, except that the total token is displayed and you can explicitly write prompts in the code. You can also explicitly write a prompt in code. This version implements LangChain.
- Run from top to bottom on Google colab.
- You must choose how to upload your API key. (File upload or Define in system environment variable)
pip install openai(Already implemented on Colab)import os(Already implemented on Colab)- You must obtain an API key from the OpenAI website. For more information : https://platform.openai.com/docs/api-reference