Skip to main content

Module for simple connecting to YandexGPT Api

Project description

(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
)

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

yandex_gpt-0.2.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

yandex_gpt-0.2.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file yandex_gpt-0.2.0.tar.gz.

File metadata

  • Download URL: yandex_gpt-0.2.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.9.6 Darwin/23.4.0

File hashes

Hashes for yandex_gpt-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4acc5e968316b74a071d03c412fc38a2b5845d2fd9099cc24c732ab4131d1e7b
MD5 f3c19c563798f4f6cc3355893a65b4ea
BLAKE2b-256 ac156bec9959fcfef33bdecb1cc6d52a96ad964cb5ae06a44163f49e1f244d08

See more details on using hashes here.

File details

Details for the file yandex_gpt-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: yandex_gpt-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.9.6 Darwin/23.4.0

File hashes

Hashes for yandex_gpt-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 527eb1ba37fff6bf7332af68b8e911b47e8ccee0d2546aee3293609b9a5a750f
MD5 6627e233e4369ef27b7c36f08d9e51d3
BLAKE2b-256 32757a56675ac12d8288491fd1eec16aa13fddc781b94eb5acc57cadd8deea54

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page