agentenv-framework-protocol 0.1.668__tar.gz → 0.1.670__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/PKG-INFO +16 -8
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/README.md +15 -7
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/pyproject.toml +1 -1
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/a2a_agent/__init__.py +14 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/a2a_agent/proxy.py +8 -4
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/a2a_agent/tasks/v1.py +110 -16
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_a2a_proxy.py +4 -1
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_usage.py +53 -1
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/.gitignore +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/LICENSE +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/NOTICE +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/THIRD_PARTY_NOTICES.md +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/examples/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/examples/advanced_agent.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/examples/basic_agent.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/examples/custom_extensions_agent.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/examples/multimodal_agent.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/examples/reference_model.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/examples/streaming_agent.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/examples/website/notes/.gitignore +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/examples/website/notes/Dockerfile +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/examples/website/notes/Dockerfile.dockerignore +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/examples/website/notes/README.md +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/examples/website/notes/data/seed.json +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/examples/website/notes/env.toml +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/examples/website/notes/site.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/examples/website/notes/web/index.html +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/examples/website/notes/web/package-lock.json +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/examples/website/notes/web/package.json +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/examples/website/notes/web/src/main.js +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/examples/website/notes/web/src/style.css +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/examples/website/notes/web/vite.config.js +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/a2a_agent/_atif_copy.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/a2a_agent/_media_spool.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/a2a_agent/_secrets.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/a2a_agent/_snapshot_state.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/a2a_agent/_trajectory_log.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/a2a_agent/_triggers.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/a2a_agent/_turn_index.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/a2a_agent/clock.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/a2a_agent/control_token.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/a2a_agent/extensions.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/a2a_agent/framework.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/a2a_agent/peer_agents.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/a2a_agent/registry.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/a2a_agent/staging.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/a2a_agent/tasks/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/agent_env_environment.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/PROFILE.md +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/__main__.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/_image_size.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/adapter.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/builder.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/fixtures/coding.json +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/fixtures/coding.stripped.json +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/fixtures/computer_use.json +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/fixtures/late_result.json +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/fixtures/media/482405b002a62efa8516c36709a7a100637507670576fa73a20ad5420d55c66f.png +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/fixtures/media/55c64d0fcd6f9d5f7c828093857e3fdfda68478bb4e9bd24d481ef391c7804e8.heic +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/fixtures/media/67905ad3cc2dd52b1f5f6a6d2814de0396618b29b4238b9af5207aeb69936e6d.mp4 +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/fixtures/media/69a8aa01fe5537076d023dd5e9cc4275b39fc0434aa6483a9f58b66ef2f3c896.png +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/fixtures/media/82e60066a2de261b6653bcdda90d1cb9a7af2f474cecd82e8d371e8384d72315.png +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/fixtures/media/845e91831319e89c4d656bdb80c278ac09a7230d61e5dfd2e1b1fbb436ac8917.pdf +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/fixtures/multi_agent.json +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/fixtures/odd_parts.json +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/fixtures/subagent.json +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/fixtures/two_turns.json +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/kit.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/models/LICENSE +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/models/VENDORED.md +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/models/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/models/agent.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/models/content.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/models/final_metrics.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/models/metrics.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/models/observation.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/models/observation_result.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/models/step.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/models/subagent_trajectory_ref.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/models/tool_call.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/models/trajectory.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/profile.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/reader.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/runner.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/served.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/atif/validator.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/client.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/_adb.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/_declare.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/_desktop.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/_job.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/_linux.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/_load.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/_macos.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/_reaping.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/_session_posix.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/_session_windows.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/_windows.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/_with_fds.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/_x11.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/annotate.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/app.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/app_data.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/app_runtime.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/apps.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/card.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/checks.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/clock.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/conformance/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/conformance/__main__.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/conformance/checks.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/conformance/client.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/conformance/desk.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/conformance/fixture.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/conformance/mp4.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/conformance/page_fixture.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/conformance/report.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/conformance/wayland_fixture.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/dataplane.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/driver.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/errors.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/extensions.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/frames.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/keys.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/launch.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/manifest.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/operations.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/platform.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/prefix.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/queue.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/recording.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/results.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/run_install_step.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/runtime.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/seed.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/serve.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/serve_app.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/served.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/session.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/settings.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/skill.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/spaces.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/svc.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/computer/tools.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/errors.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/manifest.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/passthrough.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/preflight.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/tool_access.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/tool_client.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/tool_context.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/transfers.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/types.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/website/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/website/clock.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/website/conformance.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/website/environment.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/website/errors.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/website/forwarding.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/website/readiness.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/website/routes.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/website/session.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/website_browser/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/website_browser/cdp.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/website_browser/contexts.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/website_browser/control.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/website_browser/data.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/website_browser/devtools.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/website_browser/environment.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/website_browser/log.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/website_browser/network.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/website_browser/recording.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/website_browser/scope.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/website_browser/shapes.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/src/agentenv_protocol/website_browser/stream.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/atif_cases.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/computer_fake.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/conftest.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/fake_adb.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/probe_fake.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_a2a_agent.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_a2a_agent_clock.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_a2a_agent_examples.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_a2a_atif_media.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_a2a_atif_prescribe.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_a2a_atif_scrubbing.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_a2a_atif_serving.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_a2a_atif_turns.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_a2a_cdp_config.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_a2a_object_transfers.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_a2a_peer_agents.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_a2a_staging.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_a2a_trajectory_log.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_agent_env_environment.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_atif_builder.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_atif_fixtures.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_atif_kit.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_atif_profile.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_atif_reader.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_atif_validator.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_atif_vendored.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_browser_cdp.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_browser_contexts.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_browser_data.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_browser_log.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_browser_network.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_browser_recording.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_browser_state.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_client.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_app_data.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_app_server.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_beside.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_clock.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_conformance.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_conformance_attempts.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_conformance_checks.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_conformance_page.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_conformance_recording.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_dataplane.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_declare.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_driver.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_driver_keys.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_extensions.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_frames.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_macos.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_page.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_queue.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_recording.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_recording_annotate.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_screenshot_delay.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_seed.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_serve.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_served.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_session_windows.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_spaces.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_svc_forward.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_tool_prefix.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_computer_windows_driver.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_control_token.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_data_objects.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_devtools_pipe.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_errors.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_extension_methods.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_intake.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_manifest.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_preflight.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_rpc_keepalive.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_tool_access.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_tool_annotations.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_tool_client.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_tool_context.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_tool_context_fastmcp.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_tool_context_injection.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_tool_defers.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_usage_models.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_website_api.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_website_browser.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_website_conformance.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_website_environment.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_website_forwarding.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_website_live.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_website_mcp.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_website_notes_example.py +0 -0
- {agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_website_readiness.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: agentenv-framework-protocol
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.670
|
|
4
4
|
Summary: Open data-plane protocol and server SDK for agent environments.
|
|
5
5
|
Project-URL: Homepage, https://www.agentenvframework.com
|
|
6
6
|
Project-URL: Documentation, https://www.agentenvframework.com/docs
|
|
@@ -1575,8 +1575,12 @@ cannot drift.
|
|
|
1575
1575
|
`cache_read_tokens` and `cache_write_tokens`, and `input_includes_cache`, which
|
|
1576
1576
|
says whether `input_tokens` counts both cache counts (`True`), neither
|
|
1577
1577
|
(`False`), or is unknown (`None`, the default). Set the flag whenever you set
|
|
1578
|
-
the cache counts: a price can't read them without it.
|
|
1579
|
-
|
|
1578
|
+
the cache counts: a price can't read them without it. `cache_write_ttl_tokens`
|
|
1579
|
+
counts the cache writes by how long they were kept, by a time of one unit
|
|
1580
|
+
(`{"5m": 200, "1h": 300}`; `s`, `m`, `h` or `d`), which a price charges at each
|
|
1581
|
+
time's rate; writes it doesn't count are taken as kept the provider's default
|
|
1582
|
+
time. Runtime-specific counts go in `provider_details`, but cache counts go in
|
|
1583
|
+
their own fields. `Usage.from_dict`
|
|
1580
1584
|
reads what `to_dict` wrote under any protocol version, a field it leaves out
|
|
1581
1585
|
being `None` and a key it doesn't know ignored, and `TaskResult.failure(...,
|
|
1582
1586
|
usage=...)` carries usage on a failure as `success` does.
|
|
@@ -1584,7 +1588,8 @@ usage=...)` carries usage on a failure as `success` does.
|
|
|
1584
1588
|
An agent that knows each call's model gives a turn's counts by model in
|
|
1585
1589
|
`Usage.models`, on every turn: one `ModelUsage` per model, with the model's
|
|
1586
1590
|
name as called, its `calls`, its token and cache counts read as `Usage`'s are,
|
|
1587
|
-
|
|
1591
|
+
its cache writes by time when the agent knows them, and the agent's own
|
|
1592
|
+
`cost_usd` for them when it has one. That prices a
|
|
1588
1593
|
subagent on a smaller model, a side call for a title, or a whole turn a CLI
|
|
1589
1594
|
ran on another model at that model's own rate. The rows cover every call the
|
|
1590
1595
|
turn counted; a call the agent can't name goes under the model it was
|
|
@@ -1602,10 +1607,13 @@ and Responses (`input_tokens`) shapes and Anthropic's:
|
|
|
1602
1607
|
- Anthropic's `input_tokens` counts neither `cache_read_input_tokens` nor
|
|
1603
1608
|
`cache_creation_input_tokens`, and neither does the `prompt_tokens` a LiteLLM
|
|
1604
1609
|
proxy sends with those two beside it, so they're added, to `total_tokens` too.
|
|
1605
|
-
- A provider's split of its cache writes by how long they're kept
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1610
|
+
- A provider's split of its cache writes by how long they're kept (Anthropic's
|
|
1611
|
+
`cache_creation`, OpenAI's `cache_write_tokens_details`) is kept in
|
|
1612
|
+
`provider_details` and read into `cache_write_ttl_tokens`, by the time each
|
|
1613
|
+
count's name holds (`ephemeral_1h_input_tokens`, `ttl_12h_tokens`); so are the
|
|
1614
|
+
keys of a usage in none of these shapes, as `unrecognized`. A value that isn't
|
|
1615
|
+
a count is left out. A `Usage` built or read without `cache_write_ttl_tokens`
|
|
1616
|
+
takes it from such a split in its `provider_details`, else from its rows.
|
|
1609
1617
|
|
|
1610
1618
|
Through a gateway, whether a response's input counts the cache depends on the
|
|
1611
1619
|
model behind it: a LiteLLM proxy's Claude answers through Chat Completions leave
|
|
@@ -1504,8 +1504,12 @@ cannot drift.
|
|
|
1504
1504
|
`cache_read_tokens` and `cache_write_tokens`, and `input_includes_cache`, which
|
|
1505
1505
|
says whether `input_tokens` counts both cache counts (`True`), neither
|
|
1506
1506
|
(`False`), or is unknown (`None`, the default). Set the flag whenever you set
|
|
1507
|
-
the cache counts: a price can't read them without it.
|
|
1508
|
-
|
|
1507
|
+
the cache counts: a price can't read them without it. `cache_write_ttl_tokens`
|
|
1508
|
+
counts the cache writes by how long they were kept, by a time of one unit
|
|
1509
|
+
(`{"5m": 200, "1h": 300}`; `s`, `m`, `h` or `d`), which a price charges at each
|
|
1510
|
+
time's rate; writes it doesn't count are taken as kept the provider's default
|
|
1511
|
+
time. Runtime-specific counts go in `provider_details`, but cache counts go in
|
|
1512
|
+
their own fields. `Usage.from_dict`
|
|
1509
1513
|
reads what `to_dict` wrote under any protocol version, a field it leaves out
|
|
1510
1514
|
being `None` and a key it doesn't know ignored, and `TaskResult.failure(...,
|
|
1511
1515
|
usage=...)` carries usage on a failure as `success` does.
|
|
@@ -1513,7 +1517,8 @@ usage=...)` carries usage on a failure as `success` does.
|
|
|
1513
1517
|
An agent that knows each call's model gives a turn's counts by model in
|
|
1514
1518
|
`Usage.models`, on every turn: one `ModelUsage` per model, with the model's
|
|
1515
1519
|
name as called, its `calls`, its token and cache counts read as `Usage`'s are,
|
|
1516
|
-
|
|
1520
|
+
its cache writes by time when the agent knows them, and the agent's own
|
|
1521
|
+
`cost_usd` for them when it has one. That prices a
|
|
1517
1522
|
subagent on a smaller model, a side call for a title, or a whole turn a CLI
|
|
1518
1523
|
ran on another model at that model's own rate. The rows cover every call the
|
|
1519
1524
|
turn counted; a call the agent can't name goes under the model it was
|
|
@@ -1531,10 +1536,13 @@ and Responses (`input_tokens`) shapes and Anthropic's:
|
|
|
1531
1536
|
- Anthropic's `input_tokens` counts neither `cache_read_input_tokens` nor
|
|
1532
1537
|
`cache_creation_input_tokens`, and neither does the `prompt_tokens` a LiteLLM
|
|
1533
1538
|
proxy sends with those two beside it, so they're added, to `total_tokens` too.
|
|
1534
|
-
- A provider's split of its cache writes by how long they're kept
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1539
|
+
- A provider's split of its cache writes by how long they're kept (Anthropic's
|
|
1540
|
+
`cache_creation`, OpenAI's `cache_write_tokens_details`) is kept in
|
|
1541
|
+
`provider_details` and read into `cache_write_ttl_tokens`, by the time each
|
|
1542
|
+
count's name holds (`ephemeral_1h_input_tokens`, `ttl_12h_tokens`); so are the
|
|
1543
|
+
keys of a usage in none of these shapes, as `unrecognized`. A value that isn't
|
|
1544
|
+
a count is left out. A `Usage` built or read without `cache_write_ttl_tokens`
|
|
1545
|
+
takes it from such a split in its `provider_details`, else from its rows.
|
|
1538
1546
|
|
|
1539
1547
|
Through a gateway, whether a response's input counts the cache depends on the
|
|
1540
1548
|
model behind it: a LiteLLM proxy's Claude answers through Chat Completions leave
|
|
@@ -135,6 +135,13 @@ from .tasks.v1 import (
|
|
|
135
135
|
ModelUsage,
|
|
136
136
|
Usage,
|
|
137
137
|
WriteOnly,
|
|
138
|
+
TOKEN_COUNTS,
|
|
139
|
+
TTL_UNIT_PATTERN,
|
|
140
|
+
TTL_UNITS,
|
|
141
|
+
ttl_counts_in_seconds,
|
|
142
|
+
ttl_label,
|
|
143
|
+
ttl_seconds,
|
|
144
|
+
ttl_sum,
|
|
138
145
|
)
|
|
139
146
|
from ..transfers import (
|
|
140
147
|
HttpGetGrant,
|
|
@@ -277,6 +284,13 @@ __all__ = [
|
|
|
277
284
|
"Uploaded",
|
|
278
285
|
"ModelUsage",
|
|
279
286
|
"Usage",
|
|
287
|
+
"TOKEN_COUNTS",
|
|
288
|
+
"TTL_UNIT_PATTERN",
|
|
289
|
+
"TTL_UNITS",
|
|
290
|
+
"ttl_counts_in_seconds",
|
|
291
|
+
"ttl_label",
|
|
292
|
+
"ttl_seconds",
|
|
293
|
+
"ttl_sum",
|
|
280
294
|
"WriteNamespaceGrant",
|
|
281
295
|
"WriteObject",
|
|
282
296
|
"WriteOnly",
|
|
@@ -19,7 +19,7 @@ import shutil
|
|
|
19
19
|
import signal
|
|
20
20
|
from collections import defaultdict
|
|
21
21
|
from collections.abc import AsyncIterator, Mapping
|
|
22
|
-
from dataclasses import dataclass, field,
|
|
22
|
+
from dataclasses import dataclass, field, replace
|
|
23
23
|
from datetime import datetime, timezone
|
|
24
24
|
from pathlib import Path
|
|
25
25
|
from typing import Any
|
|
@@ -58,7 +58,9 @@ from .extensions import (
|
|
|
58
58
|
extension,
|
|
59
59
|
)
|
|
60
60
|
from .framework import AgentEnvAgent, AgentIdentity, a2a_agent
|
|
61
|
-
from .tasks.v1 import
|
|
61
|
+
from .tasks.v1 import (
|
|
62
|
+
TOKEN_COUNTS, AgentConfig, ModelUsage, TaskRequest, TaskResult, TextPart, TrajectoryLog, Usage, ttl_sum,
|
|
63
|
+
)
|
|
62
64
|
from ..tool_client import ToolResult, ToolSession, ToolSessionError
|
|
63
65
|
from ..transfers import download
|
|
64
66
|
from ..types import EnvironmentTool
|
|
@@ -522,7 +524,7 @@ def _tool_error(message: str) -> ProxyToolResult:
|
|
|
522
524
|
return ProxyToolResult(content=[{"type": "text", "text": f"error: {message}"}], is_error=True)
|
|
523
525
|
|
|
524
526
|
|
|
525
|
-
_USAGE_SUMS = (*
|
|
527
|
+
_USAGE_SUMS = (*TOKEN_COUNTS, "cost_usd")
|
|
526
528
|
# Each provider's split of its cache writes by how long they're kept, which ``Usage.from_model_response`` keeps.
|
|
527
529
|
_CACHE_WRITE_SPLITS = ("cache_creation", "cache_write_tokens_details")
|
|
528
530
|
|
|
@@ -560,7 +562,8 @@ def _turn_usage(turn: _Turn) -> Usage:
|
|
|
560
562
|
as the lower bound it is; how many had cache counts with no word on whether their input held them
|
|
561
563
|
(``cache_unsettled``), which leaves the turn's flag unknown; how many usages were in a shape none of the readers
|
|
562
564
|
know (``unrecognized``); and each provider's split of the cache writes, summed, a reported ``Usage``'s split
|
|
563
|
-
counted only where it holds counts, as its ``provider_details`` may hold anything.
|
|
565
|
+
counted only where it holds counts, as its ``provider_details`` may hold anything. Its writes by how long they
|
|
566
|
+
were kept are the calls' summed."""
|
|
564
567
|
calls = [usage for _, usage in turn.model_calls]
|
|
565
568
|
sums, unreported = {}, {}
|
|
566
569
|
for name in _USAGE_SUMS:
|
|
@@ -581,6 +584,7 @@ def _turn_usage(turn: _Turn) -> Usage:
|
|
|
581
584
|
**({"cache_unsettled": unsettled} if unsettled else {}),
|
|
582
585
|
**({"unrecognized": unrecognized} if unrecognized else {}), **splits}
|
|
583
586
|
return Usage(tool_call_count=len(turn.actions), **sums,
|
|
587
|
+
cache_write_ttl_tokens=ttl_sum(call.cache_write_ttl_tokens for call in calls),
|
|
584
588
|
input_includes_cache=True if sums["input_tokens"] is not None and not unsettled else None,
|
|
585
589
|
models=_by_model(turn), provider_details=details if calls else {})
|
|
586
590
|
|
|
@@ -10,6 +10,7 @@ from __future__ import annotations
|
|
|
10
10
|
|
|
11
11
|
import json
|
|
12
12
|
import logging
|
|
13
|
+
import re
|
|
13
14
|
from collections.abc import AsyncIterator, Awaitable, Iterable, Mapping
|
|
14
15
|
from dataclasses import dataclass, field, fields
|
|
15
16
|
from enum import Enum
|
|
@@ -364,14 +365,9 @@ class NativeTrajectory:
|
|
|
364
365
|
object.__setattr__(self, "payload", _copy_json_value(self.payload))
|
|
365
366
|
|
|
366
367
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
"output_tokens",
|
|
371
|
-
"total_tokens",
|
|
372
|
-
"cache_read_tokens",
|
|
373
|
-
"cache_write_tokens",
|
|
374
|
-
)
|
|
368
|
+
#: ``Usage``'s token counts, each an integer a turn's calls sum.
|
|
369
|
+
TOKEN_COUNTS = ("input_tokens", "output_tokens", "total_tokens", "cache_read_tokens", "cache_write_tokens")
|
|
370
|
+
_USAGE_COUNTERS = ("tool_call_count", *TOKEN_COUNTS)
|
|
375
371
|
|
|
376
372
|
|
|
377
373
|
# The keys a model response's usage is read by, in any of the shapes ``Usage.from_model_response`` reads.
|
|
@@ -385,6 +381,86 @@ def _count(value: Any) -> int | None:
|
|
|
385
381
|
return value if isinstance(value, int) and not isinstance(value, bool) and value >= 0 else None
|
|
386
382
|
|
|
387
383
|
|
|
384
|
+
#: The seconds in each unit a time a cache write was kept may be written in, however it's spelled.
|
|
385
|
+
TTL_UNITS = {"s": 1, "sec": 1, "m": 60, "min": 60, "h": 3600, "hr": 3600, "hour": 3600, "d": 86400, "day": 86400}
|
|
386
|
+
#: A pattern for any of ``TTL_UNITS``' spellings, the longest first so a pattern that ends there matches it whole.
|
|
387
|
+
TTL_UNIT_PATTERN = "|".join(sorted(TTL_UNITS, key=len, reverse=True))
|
|
388
|
+
# How long cache writes were kept, as ``cache_write_ttl_tokens`` names it: a count of one unit, ``5m``, ``1h``, ``90s``.
|
|
389
|
+
_TTL_LABEL = re.compile(r"^(\d+)([smhd])$")
|
|
390
|
+
# A provider's count of cache writes kept a while, named for the time: Anthropic's ``ephemeral_1h_input_tokens``,
|
|
391
|
+
# OpenAI's ``ttl_12h_tokens``.
|
|
392
|
+
_TTL_COUNT = re.compile(rf"^(?:ephemeral_|ttl_)?(\d+)({TTL_UNIT_PATTERN})(?:_input)?_tokens$")
|
|
393
|
+
#: Where ``Usage.from_model_response`` keeps each provider's split of its cache writes by how long they were kept.
|
|
394
|
+
CACHE_WRITE_SPLITS = ("cache_creation", "cache_write_tokens_details")
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
_Time = TypeVar("_Time", str, int)
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
def ttl_seconds(label: Any) -> int | None:
|
|
401
|
+
"""The seconds a ``cache_write_ttl_tokens`` label names, ``1h`` as 3600; None for one that names no time."""
|
|
402
|
+
match = _TTL_LABEL.match(label) if isinstance(label, str) else None
|
|
403
|
+
return int(match[1]) * TTL_UNITS[match[2]] if match and int(match[1]) > 0 else None
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
def ttl_label(seconds: int) -> str:
|
|
407
|
+
"""A time as ``cache_write_ttl_tokens`` names it, in the largest unit it's a whole number of: ``1h``, ``90m``,
|
|
408
|
+
``1d``, ``45s``."""
|
|
409
|
+
for unit, size in (("d", 86400), ("h", 3600), ("m", 60)):
|
|
410
|
+
if seconds % size == 0:
|
|
411
|
+
return f"{seconds // size}{unit}"
|
|
412
|
+
return f"{seconds}s"
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
def _ttl_counts(value: Any) -> dict[str, int] | None:
|
|
416
|
+
"""A ``cache_write_ttl_tokens`` value with each time named as ``ttl_label`` names it; raises for a key that names no
|
|
417
|
+
time or a count that isn't a non-negative integer."""
|
|
418
|
+
if value is None:
|
|
419
|
+
return None
|
|
420
|
+
if not isinstance(value, Mapping):
|
|
421
|
+
raise TypeError("cache_write_ttl_tokens must map times to counts")
|
|
422
|
+
counts: dict[str, int] = {}
|
|
423
|
+
for label, count in value.items():
|
|
424
|
+
if (seconds := ttl_seconds(label)) is None:
|
|
425
|
+
raise ValueError(f"cache_write_ttl_tokens: {label!r} names no time, as 5m or 1h do")
|
|
426
|
+
if _count(count) is None:
|
|
427
|
+
raise ValueError(f"cache_write_ttl_tokens: {label}'s count must be a non-negative integer")
|
|
428
|
+
counts[ttl_label(seconds)] = counts.get(ttl_label(seconds), 0) + count
|
|
429
|
+
return counts
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
def _ttl_from_splits(details: Mapping[str, Any]) -> dict[str, int] | None:
|
|
433
|
+
"""The writes by time a provider's split in ``details`` (``CACHE_WRITE_SPLITS``) counts, by each count's name; a
|
|
434
|
+
count that isn't a positive integer is left out, and None when none is left."""
|
|
435
|
+
counts: dict[str, int] = {}
|
|
436
|
+
for name in CACHE_WRITE_SPLITS:
|
|
437
|
+
split = details.get(name)
|
|
438
|
+
for key, value in split.items() if isinstance(split, Mapping) else ():
|
|
439
|
+
if (match := _TTL_COUNT.match(str(key))) and (count := _count(value)):
|
|
440
|
+
label = ttl_label(int(match[1]) * TTL_UNITS[match[2]])
|
|
441
|
+
counts[label] = counts.get(label, 0) + count
|
|
442
|
+
return counts or None
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
def ttl_sum(parts: Iterable[Mapping[_Time, int] | None]) -> dict[_Time, int] | None:
|
|
446
|
+
"""Counts by how long cache writes were kept (``cache_write_ttl_tokens``, by label or by seconds) summed by time;
|
|
447
|
+
None when none of ``parts`` gives one."""
|
|
448
|
+
total: dict[_Time, int] = {}
|
|
449
|
+
for part in parts:
|
|
450
|
+
for time, count in (part or {}).items():
|
|
451
|
+
total[time] = total.get(time, 0) + count
|
|
452
|
+
return total or None
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
def ttl_counts_in_seconds(value: Any) -> dict[int, int]:
|
|
456
|
+
"""A ``cache_write_ttl_tokens`` value as stored, by seconds, each time that can't be read or count that isn't a
|
|
457
|
+
positive integer left out, as a reader of records another version wrote must take them."""
|
|
458
|
+
if not isinstance(value, Mapping):
|
|
459
|
+
return {}
|
|
460
|
+
return ttl_sum({seconds: count} for label, count in value.items()
|
|
461
|
+
if (seconds := ttl_seconds(label)) is not None and _count(count)) or {}
|
|
462
|
+
|
|
463
|
+
|
|
388
464
|
def _check_counts(record: Any, names: Iterable[str]) -> None:
|
|
389
465
|
for name in names:
|
|
390
466
|
value = getattr(record, name)
|
|
@@ -414,11 +490,13 @@ class ModelUsage:
|
|
|
414
490
|
cache_write_tokens: int | None = None
|
|
415
491
|
input_includes_cache: bool | None = None
|
|
416
492
|
cost_usd: float | None = None
|
|
493
|
+
cache_write_ttl_tokens: Mapping[str, int] | None = None
|
|
417
494
|
|
|
418
495
|
def __post_init__(self) -> None:
|
|
419
496
|
if not isinstance(self.model, str) or not self.model:
|
|
420
497
|
raise ValueError("a model's usage must name the model")
|
|
421
498
|
_check_counts(self, _MODEL_COUNTERS)
|
|
499
|
+
object.__setattr__(self, "cache_write_ttl_tokens", _ttl_counts(self.cache_write_ttl_tokens))
|
|
422
500
|
|
|
423
501
|
@classmethod
|
|
424
502
|
def of(cls, model: str, usages: Iterable["Usage"]) -> "ModelUsage":
|
|
@@ -435,7 +513,8 @@ class ModelUsage:
|
|
|
435
513
|
flags = {usage.input_includes_cache for usage in usages if usage.input_tokens is not None}
|
|
436
514
|
return cls(model=model, calls=len(usages), **{name: total(name) for name in _MODEL_COUNTERS[1:]},
|
|
437
515
|
input_includes_cache=flags.pop() if len(flags) == 1 else None,
|
|
438
|
-
cost_usd=sum(costs) if costs and None not in costs else None
|
|
516
|
+
cost_usd=sum(costs) if costs and None not in costs else None,
|
|
517
|
+
cache_write_ttl_tokens=ttl_sum(usage.cache_write_ttl_tokens for usage in usages))
|
|
439
518
|
|
|
440
519
|
@classmethod
|
|
441
520
|
def from_dict(cls, data: Mapping[str, Any]) -> "ModelUsage":
|
|
@@ -445,7 +524,8 @@ class ModelUsage:
|
|
|
445
524
|
return cls(**{f.name: data[f.name] for f in fields(cls) if data.get(f.name) is not None})
|
|
446
525
|
|
|
447
526
|
def to_dict(self) -> dict[str, Any]:
|
|
448
|
-
return {f.name: value
|
|
527
|
+
return {f.name: dict(value) if isinstance(value, Mapping) else value
|
|
528
|
+
for f in fields(self) if (value := getattr(self, f.name)) is not None}
|
|
449
529
|
|
|
450
530
|
|
|
451
531
|
@dataclass(frozen=True, slots=True, kw_only=True)
|
|
@@ -455,7 +535,11 @@ class Usage:
|
|
|
455
535
|
``input_includes_cache`` says whether ``input_tokens`` counts both of them (True), neither (False), or is unknown
|
|
456
536
|
(None), which a price needs to read the counts. ``models`` is the counts by model, from an agent that knows each
|
|
457
537
|
call's model: it covers every call the turn counted, so a price can charge each model at its own rate. A count
|
|
458
|
-
the turn leaves out that every row gives is the rows' sum, and so is the includes-cache flag the rows agree on.
|
|
538
|
+
the turn leaves out that every row gives is the rows' sum, and so is the includes-cache flag the rows agree on.
|
|
539
|
+
``cache_write_ttl_tokens`` is the cache writes by how long they were kept (``ttl_label``'s ``5m``, ``1h``, ``12h``),
|
|
540
|
+
which a price charges at each time's rate; left out, it's what a provider's split in ``provider_details``
|
|
541
|
+
(``CACHE_WRITE_SPLITS``) counts, else the rows' sum when every row gives one. Writes it doesn't count weren't
|
|
542
|
+
said how long they were kept."""
|
|
459
543
|
|
|
460
544
|
tool_call_count: int | None = None
|
|
461
545
|
input_tokens: int | None = None
|
|
@@ -463,6 +547,7 @@ class Usage:
|
|
|
463
547
|
total_tokens: int | None = None
|
|
464
548
|
cache_read_tokens: int | None = None
|
|
465
549
|
cache_write_tokens: int | None = None
|
|
550
|
+
cache_write_ttl_tokens: Mapping[str, int] | None = None
|
|
466
551
|
input_includes_cache: bool | None = None
|
|
467
552
|
cost_usd: float | None = None
|
|
468
553
|
models: tuple[ModelUsage, ...] = ()
|
|
@@ -486,6 +571,13 @@ class Usage:
|
|
|
486
571
|
object.__setattr__(
|
|
487
572
|
self, "provider_details", _copy_json_value(self.provider_details)
|
|
488
573
|
)
|
|
574
|
+
rows = [model.cache_write_ttl_tokens for model in self.models]
|
|
575
|
+
ttl = _ttl_counts(self.cache_write_ttl_tokens)
|
|
576
|
+
if ttl is None:
|
|
577
|
+
ttl = _ttl_from_splits(self.provider_details)
|
|
578
|
+
if ttl is None and rows and None not in rows:
|
|
579
|
+
ttl = ttl_sum(rows)
|
|
580
|
+
object.__setattr__(self, "cache_write_ttl_tokens", ttl)
|
|
489
581
|
|
|
490
582
|
@classmethod
|
|
491
583
|
def from_dict(cls, data: Mapping[str, Any]) -> "Usage":
|
|
@@ -511,9 +603,10 @@ class Usage:
|
|
|
511
603
|
``cached_tokens`` it counts, and ``cache_write_tokens`` with them. Anthropic's ``input_tokens``, and the
|
|
512
604
|
``prompt_tokens`` a LiteLLM proxy sends with Anthropic's ``cache_read_input_tokens`` and
|
|
513
605
|
``cache_creation_input_tokens`` beside it, count neither, so they're added, to ``total_tokens`` too. A
|
|
514
|
-
provider's split of its cache writes by how long they're kept (Anthropic's ``cache_creation``,
|
|
515
|
-
``
|
|
516
|
-
|
|
606
|
+
provider's split of its cache writes by how long they're kept (Anthropic's ``cache_creation``, which a LiteLLM
|
|
607
|
+
client's ``cache_creation_token_details`` is kept as, and OpenAI's ``cache_write_tokens_details``) is kept in
|
|
608
|
+
``provider_details``, and read into ``cache_write_ttl_tokens``; so are the keys of a usage in none of these
|
|
609
|
+
shapes, as ``unrecognized``. A value that isn't a count is left out."""
|
|
517
610
|
key = "prompt_tokens" if "prompt_tokens" in usage else "input_tokens"
|
|
518
611
|
details = usage.get(f"{key}_details")
|
|
519
612
|
details = details if isinstance(details, Mapping) else {}
|
|
@@ -532,7 +625,7 @@ class Usage:
|
|
|
532
625
|
total += missing
|
|
533
626
|
elif input_tokens is not None and output is not None:
|
|
534
627
|
total = input_tokens + output
|
|
535
|
-
kept = {"cache_creation": usage.get("cache_creation"),
|
|
628
|
+
kept = {"cache_creation": usage.get("cache_creation") or details.get("cache_creation_token_details"),
|
|
536
629
|
"cache_write_tokens_details": details.get("cache_write_tokens_details")}
|
|
537
630
|
provider_details: dict[str, Any] = {
|
|
538
631
|
name: counts for name, split in kept.items() if isinstance(split, Mapping)
|
|
@@ -549,7 +642,8 @@ class Usage:
|
|
|
549
642
|
and not self.provider_details)
|
|
550
643
|
|
|
551
644
|
def to_dict(self) -> dict[str, Any]:
|
|
552
|
-
result = {name: value
|
|
645
|
+
result = {name: dict(value) if isinstance(value, Mapping) else value
|
|
646
|
+
for name, value in self._values().items() if value is not None}
|
|
553
647
|
if self.models:
|
|
554
648
|
result["models"] = [model.to_dict() for model in self.models]
|
|
555
649
|
if self.provider_details:
|
{agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_a2a_proxy.py
RENAMED
|
@@ -734,6 +734,7 @@ def test_a_reported_usages_cache_write_split_counts_only_where_it_holds_counts(c
|
|
|
734
734
|
task = _settled(client, task_id)
|
|
735
735
|
assert task["status"]["state"] == "completed"
|
|
736
736
|
assert _usage(task)["provider_details"] == {"model_calls": 3, "cache_creation": {"ephemeral_5m_input_tokens": 7}}
|
|
737
|
+
assert _usage(task)["cache_write_ttl_tokens"] == {"5m": 7}
|
|
737
738
|
|
|
738
739
|
|
|
739
740
|
def test_a_turn_sums_each_providers_cache_write_split_and_counts_usage_it_couldnt_read(client):
|
|
@@ -746,10 +747,12 @@ def test_a_turn_sums_each_providers_cache_write_split_and_counts_usage_it_couldn
|
|
|
746
747
|
assert _proxy(client, "record", task_id=task_id, message="Thinking.", usage=usage).status_code == 200
|
|
747
748
|
_proxy(client, "reply", task_id=task_id, parts=[{"kind": "text", "text": "Done."}])
|
|
748
749
|
|
|
749
|
-
|
|
750
|
+
usage = _usage(_settled(client, task_id))
|
|
751
|
+
assert usage["provider_details"] == {
|
|
750
752
|
"model_calls": 3, "unrecognized": 1,
|
|
751
753
|
"unreported": {"input_tokens": 1, "output_tokens": 1, "total_tokens": 1, "cache_write_tokens": 1},
|
|
752
754
|
"cache_creation": {"ephemeral_1h_input_tokens": 7813, "ephemeral_5m_input_tokens": 20}}
|
|
755
|
+
assert usage["cache_write_ttl_tokens"] == {"1h": 7813, "5m": 20}
|
|
753
756
|
|
|
754
757
|
|
|
755
758
|
def test_an_env_tool_named_bash_is_held_to_all_its_recorded_arguments(terminal, monkeypatch, tmp_path):
|
{agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/tests/test_usage.py
RENAMED
|
@@ -3,7 +3,8 @@ set, read back by ``from_dict`` from any protocol version, and carried by a fail
|
|
|
3
3
|
|
|
4
4
|
import pytest
|
|
5
5
|
|
|
6
|
-
from agentenv_protocol.a2a_agent
|
|
6
|
+
from agentenv_protocol.a2a_agent import ttl_counts_in_seconds, ttl_label, ttl_seconds, ttl_sum
|
|
7
|
+
from agentenv_protocol.a2a_agent.tasks.v1 import ModelUsage, TaskResult, Usage
|
|
7
8
|
|
|
8
9
|
FULL = Usage(tool_call_count=2, input_tokens=120, output_tokens=7, total_tokens=127, cache_read_tokens=100,
|
|
9
10
|
cache_write_tokens=20, input_includes_cache=True, cost_usd=0.01, provider_details={"model": "m"})
|
|
@@ -118,6 +119,14 @@ RESPONSES = {
|
|
|
118
119
|
"cache_creation_input_tokens": 0, "cache_read_input_tokens": 7809},
|
|
119
120
|
Usage(input_tokens=7818, output_tokens=5, total_tokens=7823,
|
|
120
121
|
cache_read_tokens=7809, cache_write_tokens=0, input_includes_cache=True)),
|
|
122
|
+
"litellm-client-claude-writes-for-an-hour": (
|
|
123
|
+
{"prompt_tokens": 7822, "completion_tokens": 5, "total_tokens": 7827, "cache_creation_input_tokens": 7813,
|
|
124
|
+
"cache_read_input_tokens": 0,
|
|
125
|
+
"prompt_tokens_details": {"cached_tokens": 0, "cache_creation_tokens": 7813, "cache_creation_token_details": {
|
|
126
|
+
"ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 7813}}},
|
|
127
|
+
Usage(input_tokens=7822, output_tokens=5, total_tokens=7827, cache_read_tokens=0, cache_write_tokens=7813,
|
|
128
|
+
input_includes_cache=True,
|
|
129
|
+
provider_details={"cache_creation": {"ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 7813}})),
|
|
121
130
|
"openai-gpt-reads": ({"prompt_tokens": 7822, "completion_tokens": 2, "total_tokens": 7824,
|
|
122
131
|
"prompt_tokens_details": {"audio_tokens": 0, "cached_tokens": 7680}},
|
|
123
132
|
Usage(input_tokens=7822, output_tokens=2, total_tokens=7824, cache_read_tokens=7680,
|
|
@@ -138,3 +147,46 @@ RESPONSES = {
|
|
|
138
147
|
@pytest.mark.parametrize("response, expected", RESPONSES.values(), ids=RESPONSES.keys())
|
|
139
148
|
def test_a_model_responses_usage_reads_with_input_counting_the_cache(response, expected):
|
|
140
149
|
assert Usage.from_model_response(response) == expected
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
def test_an_older_agents_split_in_provider_details_is_read_into_its_writes_by_time():
|
|
153
|
+
usage = Usage.from_dict({"input_tokens": 9, "output_tokens": 5, "cache_write_tokens": 50, "provider_details": {
|
|
154
|
+
"cache_creation": {"ephemeral_5m_input_tokens": 0, "ephemeral_1h_input_tokens": 30},
|
|
155
|
+
"cache_write_tokens_details": {"ttl_12h_tokens": 20, "ttl_bad_tokens": 4, "ttl_30m_tokens": "x"}}})
|
|
156
|
+
|
|
157
|
+
assert usage.cache_write_ttl_tokens == {"1h": 30, "12h": 20}
|
|
158
|
+
assert Usage.from_dict(usage.to_dict()) == usage
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
def test_writes_by_time_name_each_time_one_way_and_an_explicit_count_wins_over_the_split():
|
|
162
|
+
usage = Usage(cache_write_ttl_tokens={"60m": 5, "1h": 2, "90s": 1, "24h": 3},
|
|
163
|
+
provider_details={"cache_creation": {"ephemeral_1h_input_tokens": 99}})
|
|
164
|
+
|
|
165
|
+
assert usage.cache_write_ttl_tokens == {"1h": 7, "90s": 1, "1d": 3}
|
|
166
|
+
assert (ttl_label(5400), ttl_label(43200), ttl_seconds("12h"), ttl_seconds("0m"), ttl_seconds("1w")) == (
|
|
167
|
+
"90m", "12h", 43200, None, None)
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
@pytest.mark.parametrize("ttl", [{"1w": 5}, {"soon": 5}, {"1h": -1}, {"1h": True}, {"1h": 2.5}, ["1h"]],
|
|
171
|
+
ids=["unit", "no-time", "negative", "bool", "float", "not-a-mapping"])
|
|
172
|
+
def test_writes_by_time_that_name_no_time_or_hold_no_count_are_refused(ttl):
|
|
173
|
+
with pytest.raises((ValueError, TypeError)):
|
|
174
|
+
Usage.from_dict({"cache_write_ttl_tokens": ttl})
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
def test_a_turn_without_writes_by_time_takes_its_rows_and_a_models_row_sums_its_calls():
|
|
178
|
+
rows = (ModelUsage(model="a", cache_write_tokens=5, cache_write_ttl_tokens={"1h": 5}),
|
|
179
|
+
ModelUsage(model="b", cache_write_tokens=2, cache_write_ttl_tokens={"5m": 2}))
|
|
180
|
+
calls = [Usage(cache_write_ttl_tokens={"1h": 3}), Usage(cache_write_ttl_tokens={"1h": 2, "5m": 1}), Usage()]
|
|
181
|
+
|
|
182
|
+
assert Usage(models=rows).cache_write_ttl_tokens == {"1h": 5, "5m": 2}
|
|
183
|
+
assert Usage(models=(rows[0], ModelUsage(model="c", cache_write_tokens=1))).cache_write_ttl_tokens is None
|
|
184
|
+
assert ModelUsage.of("a", calls).cache_write_ttl_tokens == {"1h": 5, "5m": 1}
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
def test_writes_by_time_as_stored_are_read_by_seconds_leaving_out_what_cant_be_read():
|
|
188
|
+
stored = {"1h": 5, "60m": 2, "soon": 3, "2h": -1, "5m": True, "12h": 4}
|
|
189
|
+
|
|
190
|
+
assert ttl_counts_in_seconds(stored) == {3600: 7, 43200: 4}
|
|
191
|
+
assert ttl_counts_in_seconds(["1h"]) == {} == ttl_counts_in_seconds(None)
|
|
192
|
+
assert ttl_sum([{3600: 1}, None, {3600: 2, 300: 1}]) == {3600: 3, 300: 1} and ttl_sum([None]) is None
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/THIRD_PARTY_NOTICES.md
RENAMED
|
File without changes
|
{agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/examples/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{agentenv_framework_protocol-0.1.668 → agentenv_framework_protocol-0.1.670}/examples/basic_agent.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|