YaGPT API
This Python library provides a simple wrapper for interacting with Yandex Language Models, making it easy to send requests for text generation.
Features
Simplified Interaction: Easily send requests to Yandex Language Models with just a few lines of code.
Error Handling: Robust error handling for HTTP requests and unexpected errors.
Example Usage: Included example for quick integration into your projects.
Source Code: GitHub
Installation
pip install YaGPT
Usage
from YaGPT import YaGPT, YaGPTException
# Replace with your actual values
folder_id = "your_folder_id"
iam_token = "your_iam_token"
# Create a LanguageModel instance
lm = YaGPT(folder_id, iam_token)
try:
# Send a request to the language model
result = lm.instruct(
model="general",
instruction_text="Найди ошибки в тексте и исправь их",
request_text="Ламинат подойдет для укладке на кухне или в детской комнате",
max_tokens=1500,
temperature=0.6)
if result:
for alternative in result:
print(f"Generated Text: {alternative['text']}")
print(f"Score: {alternative['score']}")
print(f"Number of Tokens: {alternative['num_tokens']}")
print()
except YaGPTException as e:
print(f"Language Model Error: {e}")
Metadata
Release files for YaGPT 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| YaGPT-0.1.0.tar.gz | 4.1 kB | Without provenance | Details for YaGPT-0.1.0.tar.gz |
Release files / YaGPT-0.1.0.tar.gz
| Download URL | YaGPT-0.1.0.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
73abd58eb497cdf64457b063969d6e8fa1361c75d328579553a5a95ccb1cc329
|
|
BLAKE2b-256 checksum How to use checksums |
5cf4104b003a18659d361998d2593594f3c61b979b2218a3f837f3082bc68ee9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.13
|
Security for YaGPT 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.