Тёмный
No video :(

Connect to ChatGPT via openAI API using Python 

The iT Tech Solutions
Подписаться 142
Просмотров 1,3 тыс.
50% 1

Connect to ChatGPT via openAI API using Python
In this video we will learn to create a simple custom chatbot using openAI API and connect to ChatGPT using Python. We will see two ways of making call to openAI API, once is through openai and another using conventional http post request and see how we can leverage the power of ChatGPT in our application.
API Documentation:
platform.opena...
Install Python:
• Install Python on Wind...
Set Virtual Environment:
• Python Virtual Environ...

Опубликовано:

 

15 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 17   
@qiratwajahat
@qiratwajahat 6 месяцев назад
Thanks! for this informative guide!🙂
@TheiTTechSolutions
@TheiTTechSolutions 6 месяцев назад
Glad it was helpful!
@davidkempton2894
@davidkempton2894 6 месяцев назад
Thanks for this tutorial!
@loulou4799
@loulou4799 5 месяцев назад
You explained it well! But I have a question : how can I provide the path to the apikey if it is stored in a .txt file not .env?
@TheiTTechSolutions
@TheiTTechSolutions 5 месяцев назад
Well, in that case you will have to read the file. Something as below: # Open and read the .txt file with open('env_variables.txt', 'r') as file: lines = file.readlines() # Parse each line and store the variables in a dictionary env_vars = {} for line in lines: key, value = line.strip().split('=') env_vars[key] = value # Now you can use the environment variables in your code api_key = env_vars.get('API_KEY') print("API Key:", api_key) But, keep in mind that storing sensitive information like passwords or API keys in plaintext files is not recommended for production use
@csec0565
@csec0565 5 месяцев назад
Is this free or paid. I'm asked to get subscription now. Can somebody help me.
@TheiTTechSolutions
@TheiTTechSolutions 5 месяцев назад
Hi, No its not free. To activate or create account you don't need to pay anything as such, but you will be charged for each api call that your program will make. You pay for what you use. As per their website new users get free $5 worth of free tokens. after that it is charged @ $0.0010 / 1K tokens for inputs and $0.0020 / 1K tokens for outputs. Tokens can be thought of as pieces of words. Before the API processes the prompts, the input is broken down into tokens. 1 token ~= 4 chars in English 1 token ~= ¾ words 100 tokens ~= 75 words More about these can be found at: openai.com/pricing help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them
@wolfmanwatcher5699
@wolfmanwatcher5699 7 месяцев назад
do we have to purchase or pay any thing to activate the api of gpt 3.5 turbo?
@TheiTTechSolutions
@TheiTTechSolutions 7 месяцев назад
Hi, To activate or create account you don't need to pay anything as such, but you will be charged for each api call that your program will make. You pay for what you use. As per their website new users get free $5 worth of free tokens. after that it is charged @ $0.0010 / 1K tokens for inputs and $0.0020 / 1K tokens for outputs. Tokens can be thought of as pieces of words. Before the API processes the prompts, the input is broken down into tokens. 1 token ~= 4 chars in English 1 token ~= ¾ words 100 tokens ~= 75 words More about these can be found at: openai.com/pricing help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them
@wolfmanwatcher5699
@wolfmanwatcher5699 7 месяцев назад
@@TheiTTechSolutions is there any free api of chart gpt type AI? I am student , and I only need it,to build small personal project .
@TheiTTechSolutions
@TheiTTechSolutions 7 месяцев назад
No, calling api is not free, you'll get $5 credits as a new user.
@wolfmanwatcher5699
@wolfmanwatcher5699 6 месяцев назад
@@TheiTTechSolutions i am facing some problem in this, can u send your insta id where i can send u my problem photo.
@TheiTTechSolutions
@TheiTTechSolutions 6 месяцев назад
Still facing issue? U can post me on insta @the_it_tech_sol, I will try to help
@call-me-potato.
@call-me-potato. 7 месяцев назад
your screen is so small. cant watch it properly.
@TheiTTechSolutions
@TheiTTechSolutions 7 месяцев назад
My apologies, try to see it in a laptop or PC, I hope that will be helpful. But I will try to zoom it a little next time so that its clearly visible.
Далее
아이스크림으로 진짜 친구 구별하는법
00:17
ChatGPT API in Python
35:18
Просмотров 179 тыс.
10X Your Code with ChatGPT:  How to Use it Effectively
17:14
Can We Create New Elements Beyond the Periodic Table?
18:07
Creating Jarvis powered by OpenAI and Python | ChatGPT
18:40
The ULTIMATE Guide to ChatGPT 4o | Beginner to Advanced
24:43
How To Connect OpenAI To WhatsApp (Python Tutorial)
30:31
What is OpenAI | ChatGPT
9:51
Просмотров 23 тыс.