Socket
Socket
Sign inDemoInstall

yandex_gpt

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yandex_gpt

Module for simple connecting to YandexGPT Api


Maintainers
1

(Module for simple connecting to YandexGPT Api)

Example to use:

from yandex_gpt import YandexGPT, Messages, SystemMessage, UserMessage

yandex_gpt_client = YandexGPT(
    OAUTH_TOKEN,
    FOLDER_ID
)

chat = Messages(
    SystemMessage('Ты в диалоге с пользователем. Отвечай на все его запросы'),
    UserMessage('Привет! Посоветуй фильм на вечер')
)

response = yandex_gpt_client.completion(chat)
print(response.alternatives[0].message)

It is possible to replace the model like this

from yandex_gpt import YandexGPT, YandexGPTModels

yandex_gpt_client = YandexGPT(
    OAUTH_TOKEN,
    FOLDER_ID,
    gpt_model=YandexGPTModels.YANDEX_GPT_LITE
)

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc