Получение ответов от YandexGPT Lite
Project description
Коннектор к YandexGPT Lite на Python
Как использовать коннектор:
-
Активируем платёжный аккаунт Yandex.Cloud: https://console.cloud.yandex.ru/billing?section=accounts. Можно активировать пробный период на 60 дней. Вам потребуется ID папки Yandex.Cloud, эти папки находятся тут: https://console.cloud.yandex.ru/folders/. Folder ID можно взять из URL или из интерфейса.
-
Получаем токен вашего аккаунта на Яндексе для подключения к YandexGPT:
https://oauth.yandex.ru/authorize?response_type=token&client_id=1a6990aa636648e9b2ef855fa7bec2fb
- Устанавливаем пакет pip:
pip install yandexgptlite
- Импортируем класс из пакета:
from yandexgptlite import YandexGPTLite
- Подключаемся к Yandex GPT, создавая экземпляр класса (требуется указать папку Yandex Cloud и токен):
account = YandexGPTLite('b1g2k730lqhu8pc02a', 'y0_AgAAAAMf8GzATuwQAAAD15w-py1O8Ucn-RN6bl9W8hwdkX7vuE' )
- Вызываем функцию обращения к GPT для нашего аккаунта (температура от 0 до 1, где единица - максимум творчества):
text = account.create_completion('Привет! Как твои дела?', '0.6')
print(text) #Привет! У меня всё хорошо, как дела у вас?
Лицензия
Этот проект распространяется под лицензией MIT. См. файл https://github.com/morinad/yandexgptlite/blob/main/LICENSE.txt (LICENSE) для дополнительной информации.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yandexgptlite-0.1.7.tar.gz.
File metadata
- Download URL: yandexgptlite-0.1.7.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ed40e9938f38afba22e7e92d71a39229de6a157a117e25e30e64cefb763d1ca
|
|
| MD5 |
748e4404af23aa3e168c0c5e726203cf
|
|
| BLAKE2b-256 |
dc545182823623e8868644854768eb1519bf02f99dde76dc49b4b0bca38cb934
|
File details
Details for the file yandexgptlite-0.1.7-py3-none-any.whl.
File metadata
- Download URL: yandexgptlite-0.1.7-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ff89feb1d55c94f00e63dbf921a897049a6207d6a6052658bd867ef94558ed7
|
|
| MD5 |
d6e4504379af92ca878ae207457ffe4c
|
|
| BLAKE2b-256 |
a55dfbe6dbe616b37b3d697caa346d8d3ff59dcc6ea8862fda2f49165dbbffab
|