Skip to main content

Pydantic models for the Agent Trajectory Interchange Format (ATIF v1.7).

Project description

atif

Pydantic models for the Agent Trajectory Interchange Format (ATIF), a standardized JSON schema for logging the complete interaction history of autonomous LLM agents — user messages, agent responses, tool calls, observations, metrics, and embedded subagent trajectories. Implements ATIF v1.7.

Install

pip install atif

Usage

from atif import Trajectory

data = {
    "schema_version": "ATIF-v1.7",
    "agent": {"name": "my-agent", "version": "1.0.0", "model_name": "claude-sonnet-4-6"},
    "steps": [
        {"step_id": 1, "source": "user", "message": "What time is it?"},
        {
            "step_id": 2,
            "source": "agent",
            "message": "Let me check.",
            "tool_calls": [
                {"tool_call_id": "c1", "function_name": "now", "arguments": {}}
            ],
            "observation": {
                "results": [{"source_call_id": "c1", "content": "2026-05-16T12:00:00Z"}]
            },
            "metrics": {"prompt_tokens": 120, "completion_tokens": 18},
        },
    ],
}

trajectory = Trajectory.model_validate(data)
print(trajectory.steps[1].tool_calls[0].function_name)  # "now"
print(trajectory.to_json_dict(exclude_none=True))

Validation enforces the ATIF rules: sequential step_ids, ISO 8601 timestamps, agent-only fields gated on source == "agent", tool-call / observation correlation, embedded-subagent trajectory_id uniqueness, and ContentPart text/image XOR.

Versioning

atif's MAJOR.MINOR tracks the ATIF RFC version it implements (1.7.x ⇔ ATIF v1.7); PATCH is reserved for library-only fixes. Because the ATIF RFC occasionally introduces breaking changes on a MINOR bump (e.g. v1.7's SubagentTrajectoryRef resolution change), a MINOR bump of this library may be breaking too — pin to atif~=1.7.0 if you need to stay on a single ATIF version.

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

atif-1.7.0a0.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

atif-1.7.0a0-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file atif-1.7.0a0.tar.gz.

File metadata

  • Download URL: atif-1.7.0a0.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for atif-1.7.0a0.tar.gz
Algorithm Hash digest
SHA256 b558c0e07b8352f2c250c1a15e5bb8283f7721702ede758cd0dd329d0d0e5143
MD5 55b16ba0d9647ed3225f5a9f333024de
BLAKE2b-256 bf051f881c429dfa09d6c1e98974e35b1905ad17d346622a8b2c9e396bd3fac2

See more details on using hashes here.

Provenance

The following attestation bundles were made for atif-1.7.0a0.tar.gz:

Publisher: publish.yml on bolu61/python-atif

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file atif-1.7.0a0-py3-none-any.whl.

File metadata

  • Download URL: atif-1.7.0a0-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for atif-1.7.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 36476d52db47153fae2cb7ed8f1c170a191a1dfe9b8490c9009105c7c6409058
MD5 8542db4c4a0f1f36166f77f376f25ce1
BLAKE2b-256 d2e0ab32ec11134364cd03340baf311f1982387968115f40a1ac848725311db0

See more details on using hashes here.

Provenance

The following attestation bundles were made for atif-1.7.0a0-py3-none-any.whl:

Publisher: publish.yml on bolu61/python-atif

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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