Skip to main content

Small Python client for Yandex AI Studio Responses API.

Project description

cheating_sparrow

Minimal Python client for Yandex AI Studio OpenAI-compatible Responses API.

Security

This package is intentionally minimal. If you publish it with a real API key inside the code, everyone who installs the package can extract and use that key.

Install locally

python3 -m pip install -e .

After publishing to PyPI, users will install it as:

python3 -m pip install cheating_sparrow

The Python import stays underscore-based:

from cheating_sparrow import ask

Usage

from cheating_sparrow import ask

answer = ask("Напиши Python-код для TF-IDF классификации текста.")
print(answer)

For more control:

from cheating_sparrow import YandexAIStudioClient

client = YandexAIStudioClient()
answer = client.ask(
    "Объясни лемматизацию в NLP.",
    instructions="Отвечай кратко.",
    temperature=0.3,
    max_output_tokens=500,
)

print(answer)

The package uses the same call as the raw OpenAI SDK:

import openai

YANDEX_CLOUD_FOLDER = "b1g22m7kb1cbitqfp8gf"
YANDEX_CLOUD_API_KEY = "***...X3OyrU"
YANDEX_CLOUD_MODEL = "gpt-oss-120b/latest"

client = openai.OpenAI(
    api_key=YANDEX_CLOUD_API_KEY,
    base_url="https://ai.api.cloud.yandex.net/v1",
    project=YANDEX_CLOUD_FOLDER,
)

response = client.responses.create(
    model=f"gpt://{YANDEX_CLOUD_FOLDER}/{YANDEX_CLOUD_MODEL}",
    temperature=0.3,
    instructions="",
    input="",
    max_output_tokens=500,
)

print(response.output_text)

Publish to PyPI

python3 -m pip install -U build twine
python3 -m build
python3 -m twine check dist/*
python3 -m twine upload dist/*

Use TestPyPI first while testing releases:

python3 -m twine upload --repository testpypi dist/*
python3 -m pip install --index-url https://test.pypi.org/simple/ cheating_sparrow

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

sparrow_nlp-0.1.0.tar.gz (33.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sparrow_nlp-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file sparrow_nlp-0.1.0.tar.gz.

File metadata

  • Download URL: sparrow_nlp-0.1.0.tar.gz
  • Upload date:
  • Size: 33.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for sparrow_nlp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4349660ff0d2d191f6ba62eb5c3ed85f5add54ee539341eb114304cf90f7fe40
MD5 65b516f1abca9c7b89038b63cd0c6471
BLAKE2b-256 f723f22011ed8156753542db287aebd2891259d3ac82b96aceb45ce21d68b587

See more details on using hashes here.

File details

Details for the file sparrow_nlp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sparrow_nlp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for sparrow_nlp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d9091a73d0bd684a1e56fe1ca33414e331332dd1cd12fc53873faf1ffad03ef0
MD5 6e21fbb40b0ff2ac9e03dee9e5cb451e
BLAKE2b-256 6c733db1fe8ee8daf51da0cc897bf75c5e729a03c6309f43a6148e0b9696c1be

See more details on using hashes here.

Supported by

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