GithubHelp home page GithubHelp logo

yandexgptlite's Introduction

Коннектор к YandexGPT Lite на Python

Новые видео, статьи и полезности в Telegram-канале: https://t.me/+2kqVrjV5aXs0NTRi

Как использовать коннектор:

  1. Активируем платёжный аккаунт Yandex.Cloud: https://console.cloud.yandex.ru/billing?section=accounts. Можно активировать пробный период на 60 дней. Вам потребуется ID папки Yandex.Cloud, эти папки находятся тут: https://console.cloud.yandex.ru/folders/. Folder ID можно взять из URL или из интерфейса.

  2. Получаем токен вашего аккаунта на Яндексе для подключения к YandexGPT:

https://oauth.yandex.ru/authorize?response_type=token&client_id=1a6990aa636648e9b2ef855fa7bec2fb

  1. Устанавливаем пакет pip:

pip install yandexgptlite

  1. Импортируем класс из пакета:

from yandexgptlite import YandexGPTLite

  1. Подключаемся к Yandex GPT, создавая экземпляр класса (требуется указать папку Yandex Cloud и токен):

account = YandexGPTLite('b1g2k730lqhu8pc02a', 'y0_AgAAAAMf8GzATuwQAAAD15w-py1O8Ucn-RN6bl9W8hwdkX7vuE' )

  1. Вызываем функцию обращения к GPT для нашего аккаунта (температура от 0 до 1, где единица - максимум творчества):

text = account.create_completion('Привет! Как твои дела?', '0.6')

print(text) #Привет! У меня всё хорошо, как дела у вас?

Лицензия

Этот проект распространяется под лицензией MIT. См. файл https://github.com/morinad/yandexgptlite/blob/main/LICENSE.txt (LICENSE) для дополнительной информации.

yandexgptlite's People

Contributors

morinad avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.