Skip to main content

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

Metadata

Release files for yandex_gpt 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yandex_gpt 0.3.0
File Size Uploaded
yandex_gpt-0.3.0.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for yandex_gpt 0.3.0
File Interpreter ABI Platform
yandex_gpt-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.5 kB

Release files / yandex_gpt-0.3.0.tar.gz

Download URL yandex_gpt-0.3.0.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7ff34e54c8b252849d12098e79ac4d8bf08cfcfc5d992b535b8b0b8feb785895
BLAKE2b-256 checksum
How to use checksums
7eddb659555e908e27fe443b073bc23e842c45c9bc9ae43417fc8977b794efab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.9.6 Darwin/24.0.0

Release files / yandex_gpt-0.3.0-py3-none-any.whl

Download URL yandex_gpt-0.3.0-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b2c35a26c7e4264c194a770d58efe0d29af34b9ea383c9a33056d25ca7d6b973
BLAKE2b-256 checksum
How to use checksums
3f75f9f2fc3aa476abed1333c054147d49f6aa4141f0cdfbf16703bf34563f30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.9.6 Darwin/24.0.0

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page