Skip to main content

GigaChat executor for acty

Project description

acty-gigachat

acty-gigachat provides a GigaChatExecutor implementation for Acty. It adapts langchain-gigachat chat models to the Acty executor interface and adds session-aware behavior for GigaChat prefix-caching workflows.

Install

pip install acty-gigachat

For local development:

pip install -e .[dev]

Usage

import asyncio

from acty import ActyEngine, EngineConfig
from acty_gigachat import GigaChatExecutor
from langchain_gigachat.chat_models import GigaChat


async def main() -> None:
    model = GigaChat(credentials="YOUR_AUTHORIZATION_KEY", verify_ssl_certs=False)
    engine = ActyEngine(
        executor=GigaChatExecutor(model=model),
        config=EngineConfig(primer_workers=1, follower_workers=1),
    )
    try:
        submission = await engine.submit_group(
            "demo",
            {"input": "Hello!", "invoke_kwargs": {"temperature": 0.2}},
            [],
        )
        if submission.primer is not None:
            result = await submission.primer
            print(result.output)
    finally:
        await engine.close()


asyncio.run(main())

Payloads may provide messages, input, or prompt. The executor forwards an optional invoke_kwargs dictionary to the model.

Session Handling

GigaChatExecutor uses the GigaChat SDK session_id_cvar context variable to control the X-Session-ID header during model calls.

  • if Job.context["cache"]["provider_ref"] is present, the executor reuses it
  • otherwise, it creates a per-group fallback session id
  • session-invalid failures rotate to a new session id
  • transient failures reuse the current session id

This makes the executor suitable for Acty cache flows where a primer attaches a provider reference and followers reuse it later.

Telemetry

The executor can enrich the active OpenTelemetry/OpenInference LLM span with:

  • Acty correlation identifiers
  • bounded input message attributes
  • cached prompt token usage when the model response exposes it

This is enabled by default and respects the configured telemetry privacy gates.

Development

  • tests live under tests/
  • the repo includes unit tests, session lifecycle tests, and Acty engine integration coverage for telemetry, retry, and TTL/session rotation behavior
  • the package depends directly on both acty and acty-core because it imports symbols from both at runtime

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

acty_gigachat-0.1.0.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

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

acty_gigachat-0.1.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for acty_gigachat-0.1.0.tar.gz
Algorithm Hash digest
SHA256 441c6d0d365a83b6048450eb91bbecf944962eb290eecad1ac307df6bb3b2a7a
MD5 6eeb84fefe8e6b807cbab7293976b113
BLAKE2b-256 aeb487be6d4c6522d14a0da8d0a56a52af756ebc2ed64e618a1a0ce1e9d2a9e4

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for acty_gigachat-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5527d2505183793beb5d9dd7fd5d4974c74b7f4b0c5c19a36e648edb0e094e49
MD5 6fba680db00511c88b451272ddee70f5
BLAKE2b-256 1b8f4e6d01f7fc035a4ddd55e1fb8a3843135a6275042098b2cdda80038e4980

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