agentplaykit 0.1.0__tar.gz → 0.2.0__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.
- agentplaykit-0.2.0/.claude/hooks/session-start.sh +12 -0
- agentplaykit-0.2.0/.claude/settings.json +14 -0
- agentplaykit-0.2.0/.github/workflows/release.yml +112 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/CHANGELOG.md +50 -0
- agentplaykit-0.2.0/CLAUDE.md +19 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/PKG-INFO +12 -11
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/README.md +11 -10
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/docs/adr/0003-model-neutral.md +1 -1
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/docs/adr/0004-no-built-in-prices.md +1 -1
- agentplaykit-0.2.0/docs/adr/0005-provider-presets.md +33 -0
- agentplaykit-0.2.0/docs/guides/models.md +146 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/docs/guides/scenarios.md +3 -2
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/docs/quickstart.md +28 -7
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/docs/release-checklist.md +18 -20
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/docs/tutorials/evaluate.md +1 -1
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/mkdocs.yml +2 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/specs/SPEC-002-agent.md +2 -1
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/specs/SPEC-007-cli.md +2 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/specs/SPEC-009-adapters.md +34 -7
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/specs/SPEC-010-evaluators.md +2 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/__init__.py +1 -1
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/agents/_http.py +12 -7
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/agents/anthropic_agent.py +2 -2
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/agents/config.py +9 -4
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/agents/http_agent.py +2 -2
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/agents/openai_compat.py +70 -18
- agentplaykit-0.2.0/src/agentplaykit/agents/providers.py +96 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/cli/main.py +18 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/evals/summary.py +28 -12
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/registry/__init__.py +28 -1
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/conformance/test_adapters.py +14 -1
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/conformance/test_cli.py +21 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/conformance/test_evaluators.py +32 -0
- agentplaykit-0.2.0/tests/conformance/test_presets.py +258 -0
- agentplaykit-0.1.0/.github/workflows/release.yml +0 -80
- agentplaykit-0.1.0/docs/guides/models.md +0 -69
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/.github/CODEOWNERS +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/.github/ISSUE_TEMPLATE/bug.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/.github/ISSUE_TEMPLATE/spec-proposal.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/.github/ISSUE_TEMPLATE/world-request.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/.github/workflows/ci.yml +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/.github/workflows/docs.yml +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/.gitignore +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/.pre-commit-config.yaml +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/CODE_OF_CONDUCT.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/CONTRIBUTING.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/GOVERNANCE.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/LICENSE +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/MAINTAINERS.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/SECURITY.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/docs/adr/0000-template.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/docs/adr/0001-name-and-package-name.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/docs/adr/0002-tooling-and-defaults.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/docs/development-plan.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/docs/guides/cli.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/docs/guides/run-log.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/docs/index.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/docs/security-review.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/docs/tutorials/write-a-world.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/docs/tutorials/write-an-agent.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/examples/command-agent/my_agent.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/examples/command-agent/scenario.yaml +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/examples/guess/bisect_agent.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/examples/guess/guess_world.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/examples/guess/scenario.yaml +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/examples/ox-chat/scenario.yaml +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/examples/ox-llm/scenario.yaml +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/examples/ox_demo.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/examples/treasure/scenario.yaml +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/examples/treasure/treasure_checker.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/examples/treasure/treasure_world.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/pyproject.toml +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/scripts/check_boundaries.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/scripts/check_licenses.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/scripts/check_spdx.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/scripts/check_spec_links.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/scripts/mkdocs_hooks.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/specs/SPEC-000-process.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/specs/SPEC-001-environment.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/specs/SPEC-003-run-log.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/specs/SPEC-004-runner.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/specs/SPEC-005-scenario.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/specs/SPEC-006-registry.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/specs/SPEC-008-message-bus.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/specs/SPEC-011-security.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/specs/TEMPLATE.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/specs/schemas/evalresult.schema.json +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/specs/schemas/runlog.schema.json +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/specs/schemas/scenario.schema.json +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/specs/untested.yaml +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/__main__.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/agents/__init__.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/agents/command.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/agents/mcp_agent.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/agents/pricing.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/agents/proc.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/agents/prompting.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/agents/scripted.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/cli/__init__.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/core/__init__.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/core/agent.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/core/bus.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/core/environment.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/core/evaluator.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/core/log.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/core/plain.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/core/runner.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/envs/__init__.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/envs/blank.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/envs/ox.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/envs/rps.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/evals/__init__.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/evals/judge.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/evals/outcome.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/py.typed +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/scenario/__init__.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/scenarios/demo.yaml +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/schemas/evalresult.schema.json +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/schemas/runlog.schema.json +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/schemas/scenario.schema.json +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/src/agentplaykit/testkit.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/__init__.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/conformance/__init__.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/conformance/conftest.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/conformance/fakes.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/conformance/helpers.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/conformance/plugin_pkg.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/conformance/test_agent.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/conformance/test_environment.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/conformance/test_message_bus.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/conformance/test_registry.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/conformance/test_run_log.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/conformance/test_runner.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/conformance/test_scenario.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/conformance/test_schemas.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/conformance/test_security.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/conformance/test_specs.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/conformance/test_testkit.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/fixtures/providers/README.md +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/fixtures/providers/anthropic_refusal.json +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/fixtures/providers/anthropic_text.json +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/fixtures/providers/anthropic_tool_use.json +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/fixtures/providers/openai_chat_no_usage.json +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/fixtures/providers/openai_chat_text.json +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/fixtures/providers/openai_chat_tool.json +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/fixtures/sample_run.jsonl +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/fixtures/sample_scenario.yaml +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/golden/ox_minimax_vs_random_seed7.jsonl +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/live/__init__.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/live/test_live_adapters.py +0 -0
- {agentplaykit-0.1.0 → agentplaykit-0.2.0}/tests/test_smoke.py +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Installs dev dependencies in Claude Code on the web sessions only.
|
|
3
|
+
# Locally, use the .venv described in CONTRIBUTING.md.
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
|
|
6
|
+
if [ "${CLAUDE_CODE_REMOTE:-}" != "true" ]; then
|
|
7
|
+
exit 0
|
|
8
|
+
fi
|
|
9
|
+
|
|
10
|
+
cd "${CLAUDE_PROJECT_DIR:-.}"
|
|
11
|
+
python -m pip install -q -e ".[dev]"
|
|
12
|
+
pre-commit install || true
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
# Publishes a version to PyPI and creates its GitHub release. Ways to start it:
|
|
3
|
+
# - Automatic: merge a change of __version__ into master. If that version has no release yet,
|
|
4
|
+
# it is released; any other push to master does nothing.
|
|
5
|
+
# - Push a tag such as v0.1.0, or create a release with a new v* tag on GitHub.
|
|
6
|
+
# - Actions -> Release -> Run workflow, from master or from a v* tag.
|
|
7
|
+
# Publishing uses PyPI trusted publishing: no API token is stored in this repository
|
|
8
|
+
# (see docs/release-checklist.md). Every step is safe to re-run for the same version.
|
|
9
|
+
on:
|
|
10
|
+
push:
|
|
11
|
+
branches: [master]
|
|
12
|
+
tags: ["v*"]
|
|
13
|
+
workflow_dispatch:
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
concurrency:
|
|
19
|
+
group: release-${{ github.ref }}
|
|
20
|
+
cancel-in-progress: false
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
decide:
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
outputs:
|
|
26
|
+
release: ${{ steps.decide.outputs.release }}
|
|
27
|
+
tag: ${{ steps.decide.outputs.tag }}
|
|
28
|
+
steps:
|
|
29
|
+
- uses: actions/checkout@v4
|
|
30
|
+
- id: decide
|
|
31
|
+
name: Is there a version to release?
|
|
32
|
+
env: { GH_TOKEN: "${{ github.token }}" }
|
|
33
|
+
run: |
|
|
34
|
+
version=$(sed -n 's/^__version__ = "\(.*\)"$/\1/p' src/agentplaykit/__init__.py)
|
|
35
|
+
tag="v$version"
|
|
36
|
+
echo "package version: $version"
|
|
37
|
+
case "$GITHUB_REF" in
|
|
38
|
+
refs/tags/v*)
|
|
39
|
+
if [ "$GITHUB_REF_NAME" != "$tag" ]; then
|
|
40
|
+
echo "tag $GITHUB_REF_NAME does not match the package version $version"; exit 1
|
|
41
|
+
fi
|
|
42
|
+
release=true ;;
|
|
43
|
+
refs/heads/master)
|
|
44
|
+
if git ls-remote --exit-code --tags origin "refs/tags/$tag" > /dev/null; then
|
|
45
|
+
echo "$tag is already released; nothing to do"
|
|
46
|
+
release=false
|
|
47
|
+
else
|
|
48
|
+
echo "$tag has no release yet; releasing it"
|
|
49
|
+
release=true
|
|
50
|
+
fi ;;
|
|
51
|
+
*)
|
|
52
|
+
echo "run this from master or a v* tag, not $GITHUB_REF"; exit 1 ;;
|
|
53
|
+
esac
|
|
54
|
+
echo "release=$release" >> "$GITHUB_OUTPUT"
|
|
55
|
+
echo "tag=$tag" >> "$GITHUB_OUTPUT"
|
|
56
|
+
|
|
57
|
+
build:
|
|
58
|
+
needs: decide
|
|
59
|
+
if: needs.decide.outputs.release == 'true'
|
|
60
|
+
runs-on: ubuntu-latest
|
|
61
|
+
steps:
|
|
62
|
+
- uses: actions/checkout@v4
|
|
63
|
+
- uses: actions/setup-python@v5
|
|
64
|
+
with: { python-version: "3.12" }
|
|
65
|
+
- run: python -m pip install -e ".[dev]" build twine
|
|
66
|
+
- run: python -m pytest -q
|
|
67
|
+
- run: python -m build
|
|
68
|
+
- run: python -m twine check dist/*
|
|
69
|
+
- uses: actions/upload-artifact@v4
|
|
70
|
+
with: { name: dist, path: dist/ }
|
|
71
|
+
|
|
72
|
+
publish:
|
|
73
|
+
needs: [decide, build]
|
|
74
|
+
runs-on: ubuntu-latest
|
|
75
|
+
# The pypi environment must allow the tag pattern v* and the branch master.
|
|
76
|
+
environment: {name: pypi, url: "https://pypi.org/project/agentplaykit/"}
|
|
77
|
+
permissions:
|
|
78
|
+
id-token: write
|
|
79
|
+
steps:
|
|
80
|
+
- uses: actions/download-artifact@v4
|
|
81
|
+
with: { name: dist, path: dist/ }
|
|
82
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
83
|
+
with:
|
|
84
|
+
skip-existing: true # a re-run for the same version must not fail
|
|
85
|
+
|
|
86
|
+
github-release:
|
|
87
|
+
needs: [decide, publish]
|
|
88
|
+
runs-on: ubuntu-latest
|
|
89
|
+
permissions:
|
|
90
|
+
contents: write
|
|
91
|
+
env:
|
|
92
|
+
TAG: ${{ needs.decide.outputs.tag }}
|
|
93
|
+
GH_TOKEN: ${{ github.token }}
|
|
94
|
+
steps:
|
|
95
|
+
- uses: actions/checkout@v4
|
|
96
|
+
- uses: actions/download-artifact@v4
|
|
97
|
+
with: { name: dist, path: dist/ }
|
|
98
|
+
- name: Release notes from CHANGELOG.md
|
|
99
|
+
run: |
|
|
100
|
+
version="${TAG#v}"
|
|
101
|
+
awk -v v="$version" '/^## \[/{p = index($0, "[" v "]") > 0; next} p' CHANGELOG.md > notes.md
|
|
102
|
+
test -s notes.md || { echo "no CHANGELOG section for $version"; exit 1; }
|
|
103
|
+
- name: Create the tag and release, or update a release made in the browser
|
|
104
|
+
run: |
|
|
105
|
+
title="AgentPlay $TAG"
|
|
106
|
+
if gh release view "$TAG" > /dev/null 2>&1; then
|
|
107
|
+
gh release edit "$TAG" --title "$title" --notes-file notes.md
|
|
108
|
+
gh release upload "$TAG" dist/* --clobber
|
|
109
|
+
else
|
|
110
|
+
# Creates the tag at the released commit when it does not exist yet.
|
|
111
|
+
gh release create "$TAG" dist/* --target "$GITHUB_SHA" --title "$title" --notes-file notes.md
|
|
112
|
+
fi
|
|
@@ -6,6 +6,56 @@ Format: [Keep a Changelog](https://keepachangelog.com/). Versioning: [SemVer](ht
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.2.0] - 2026-11-30
|
|
10
|
+
|
|
11
|
+
Named setups for common model services ([ADR-0005](docs/adr/0005-provider-presets.md)).
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
- Provider presets: `use: openai`, `openrouter`, `groq`, `deepseek`, `gemini`, `mistral`,
|
|
15
|
+
`together` and `ollama`. Each fills in the service's address and key variable, so `model` is
|
|
16
|
+
all you need; any default can be overridden (ADP-020). A missing key stops the run before
|
|
17
|
+
any request and names the variable to export (ADP-021).
|
|
18
|
+
- `openrouter` logs the actual cost OpenRouter reports for each call, so `price` is optional
|
|
19
|
+
there (ADP-022). Attribution headers are sent only when you set `app_name` / `app_url`
|
|
20
|
+
(ADP-023).
|
|
21
|
+
- `ollama` needs no key, costs 0, and says to run `ollama serve` when the server is not
|
|
22
|
+
running (ADP-024).
|
|
23
|
+
- Hosted presets never count as free, even through a proxy on `localhost`, so budget caps keep
|
|
24
|
+
applying; set `local: true` to opt out.
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
- `openai_compat` is now the generic adapter for servers without a preset (LM Studio, vLLM,
|
|
28
|
+
llama.cpp, proxies). Existing scenarios using it keep working unchanged.
|
|
29
|
+
- The log's `provider` for a preset is the preset name (for example `openrouter`) instead of
|
|
30
|
+
the URL's host.
|
|
31
|
+
|
|
32
|
+
## [0.1.1] - 2026-11-30
|
|
33
|
+
|
|
34
|
+
Fixes from trying v0.1.0 with free hosted models and on Windows.
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
- Model adapters retry rate limits and server errors 5 times by default (was 2), waiting 1, 2,
|
|
38
|
+
4, 8 and 16 seconds (or as long as the server's `Retry-After` asks). Free models on
|
|
39
|
+
OpenRouter often answer `429`; two quick retries aborted most runs. Set `retries` to change it.
|
|
40
|
+
|
|
41
|
+
### Fixed
|
|
42
|
+
- `play --runs N` now shows why runs failed: summary rows carry the run's `error`, the summary
|
|
43
|
+
file has an `errors` table, and the printed summary lists each error with its count
|
|
44
|
+
(EVL-015). Before, a failing provider showed only as "aborted".
|
|
45
|
+
- Piping output into a program that stops reading early (`| head`) no longer prints a Python
|
|
46
|
+
traceback; the command exits quietly with code 1 (CLI-012).
|
|
47
|
+
|
|
48
|
+
### Added
|
|
49
|
+
- Automatic releases: merging a new `__version__` into `master` publishes it to PyPI and creates
|
|
50
|
+
the tag and GitHub release; merges that keep the version do nothing. Tags, the browser and
|
|
51
|
+
"Run workflow" still work as manual routes (see `docs/release-checklist.md`).
|
|
52
|
+
|
|
53
|
+
### Docs
|
|
54
|
+
- Quickstart: installing in a virtual environment on Windows and macOS/Linux, and what to do
|
|
55
|
+
when `agentplaykit` is "not recognized as a command" (`python -m agentplaykit`).
|
|
56
|
+
- Real AI models: an OpenRouter section (chat vs embedding models, free-model rate limits).
|
|
57
|
+
- README now installs from PyPI.
|
|
58
|
+
|
|
9
59
|
## [0.1.0] - 2026-11-30
|
|
10
60
|
|
|
11
61
|
First release: the engine for putting AI agents into worlds, letting them act and talk, and
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# AgentPlay
|
|
2
|
+
|
|
3
|
+
Spec-driven Python framework (package `agentplaykit`). See [CONTRIBUTING.md](CONTRIBUTING.md) for rules; the spec in `specs/` is the source of truth.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
- Local: `python -m venv .venv`, activate it (`.venv\Scripts\activate` on Windows), then `pip install -e ".[dev]"` and `pre-commit install`.
|
|
7
|
+
- Claude Code on the web: dependencies are installed automatically by `.claude/hooks/session-start.sh`.
|
|
8
|
+
|
|
9
|
+
## Checks (same as CI)
|
|
10
|
+
```bash
|
|
11
|
+
python scripts/check_spdx.py && python scripts/check_boundaries.py
|
|
12
|
+
ruff check . && ruff format --check . && mypy && pytest
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Conventions
|
|
16
|
+
- Development branch: `claude/laughing-clarke-wakxes`.
|
|
17
|
+
- Python 3.8-compatible runtime code; every Python file starts with `# SPDX-License-Identifier: MIT`.
|
|
18
|
+
- `core` must not import `agents`, `envs` or `evals`.
|
|
19
|
+
- Sign off commits (`git commit -s`).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: agentplaykit
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: A framework for putting AI agents into worlds, letting them act and talk, and scoring and logging what happens.
|
|
5
5
|
Project-URL: Homepage, https://github.com/thetejasmagade/agentplay
|
|
6
6
|
Project-URL: Documentation, https://agentplay.itejas.dev/
|
|
@@ -42,18 +42,18 @@ Description-Content-Type: text/markdown
|
|
|
42
42
|
|
|
43
43
|
An MIT-licensed Python framework for putting AI agents into worlds, letting them act and talk, and scoring and logging what happens.
|
|
44
44
|
|
|
45
|
-
**Status:**
|
|
45
|
+
**Status:** released on PyPI as [`agentplaykit`](https://pypi.org/project/agentplaykit/). Docs: <https://agentplay.itejas.dev>. The specs in [`specs/`](specs/) are the source of truth; every requirement has a test.
|
|
46
46
|
|
|
47
47
|
## Install
|
|
48
48
|
Python 3.8 or newer. Plain `pip` works:
|
|
49
49
|
```bash
|
|
50
|
-
pip install agentplaykit
|
|
50
|
+
pip install agentplaykit
|
|
51
51
|
pip install -e ".[dev]" # from a clone, for development
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
## Try it
|
|
55
55
|
```bash
|
|
56
|
-
pip install
|
|
56
|
+
pip install agentplaykit
|
|
57
57
|
agentplaykit play # built-in demo, no API key needed
|
|
58
58
|
agentplaykit play examples/guess/scenario.yaml # a custom world + agent from plain .py files
|
|
59
59
|
agentplaykit play examples/ox-chat/scenario.yaml # two agents play OX and chat between moves
|
|
@@ -80,27 +80,28 @@ Any model can play, hosted or local. Change the agent's `use` line:
|
|
|
80
80
|
|
|
81
81
|
| `use` | Connects to |
|
|
82
82
|
|---|---|
|
|
83
|
-
| `
|
|
83
|
+
| `openai`, `openrouter`, `groq`, `deepseek`, `gemini`, `mistral`, `together` | That hosted service; only `model` is needed, the key comes from its usual variable (`OPENROUTER_API_KEY`, ...) |
|
|
84
|
+
| `ollama` | A local Ollama server: free, no key |
|
|
85
|
+
| `openai_compat` | Any other OpenAI-compatible server (LM Studio, vLLM, llama.cpp, proxies) via `base_url` |
|
|
84
86
|
| `anthropic` | Claude via the Anthropic SDK (`pip install "agentplaykit[anthropic]"`) |
|
|
85
87
|
| `command` | Any program, in any language, reading and writing JSON lines |
|
|
86
88
|
| `http` | Any agent behind a URL |
|
|
87
89
|
| `mcp` | A tool on an MCP server (`pip install "agentplaykit[mcp]"`, Python 3.10+) |
|
|
88
90
|
|
|
89
91
|
```yaml
|
|
90
|
-
- id: x
|
|
91
|
-
|
|
92
|
-
config: {base_url: "http://localhost:11434/v1", model: "llama3.2"} # local Ollama, free
|
|
92
|
+
- {id: x, use: ollama, config: {model: "llama3.2"}} # local, free
|
|
93
|
+
- {id: y, use: openrouter, config: {model: "<provider>/<model>"}} # key from OPENROUTER_API_KEY
|
|
93
94
|
```
|
|
94
|
-
Keys come from environment variables
|
|
95
|
+
Keys come from environment variables, never from the scenario.
|
|
95
96
|
Every call's tokens and cost are logged; runs stop at `max_cost_usd` (default $1). Set `price`
|
|
96
|
-
per model for exact costs. See `examples/ox-llm/scenario.yaml` and `examples/command-agent/`.
|
|
97
|
+
per model for exact costs (`openrouter` reports its own). See `examples/ox-llm/scenario.yaml` and `examples/command-agent/`.
|
|
97
98
|
|
|
98
99
|
## Score and compare
|
|
99
100
|
Add evaluators to a scenario; they read only the finished log, so agents can never touch them:
|
|
100
101
|
```yaml
|
|
101
102
|
evaluators:
|
|
102
103
|
- {use: outcome, config: {agent: x}} # did x win?
|
|
103
|
-
- {use: judge, config: {rubric: "Did x explain its moves?", agent: {use:
|
|
104
|
+
- {use: judge, config: {rubric: "Did x explain its moves?", agent: {use: openrouter, config: {...}}}}
|
|
104
105
|
```
|
|
105
106
|
Run many seeds and get a summary (pass rate, steps, cost, spread):
|
|
106
107
|
```bash
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
An MIT-licensed Python framework for putting AI agents into worlds, letting them act and talk, and scoring and logging what happens.
|
|
4
4
|
|
|
5
|
-
**Status:**
|
|
5
|
+
**Status:** released on PyPI as [`agentplaykit`](https://pypi.org/project/agentplaykit/). Docs: <https://agentplay.itejas.dev>. The specs in [`specs/`](specs/) are the source of truth; every requirement has a test.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
Python 3.8 or newer. Plain `pip` works:
|
|
9
9
|
```bash
|
|
10
|
-
pip install agentplaykit
|
|
10
|
+
pip install agentplaykit
|
|
11
11
|
pip install -e ".[dev]" # from a clone, for development
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
## Try it
|
|
15
15
|
```bash
|
|
16
|
-
pip install
|
|
16
|
+
pip install agentplaykit
|
|
17
17
|
agentplaykit play # built-in demo, no API key needed
|
|
18
18
|
agentplaykit play examples/guess/scenario.yaml # a custom world + agent from plain .py files
|
|
19
19
|
agentplaykit play examples/ox-chat/scenario.yaml # two agents play OX and chat between moves
|
|
@@ -40,27 +40,28 @@ Any model can play, hosted or local. Change the agent's `use` line:
|
|
|
40
40
|
|
|
41
41
|
| `use` | Connects to |
|
|
42
42
|
|---|---|
|
|
43
|
-
| `
|
|
43
|
+
| `openai`, `openrouter`, `groq`, `deepseek`, `gemini`, `mistral`, `together` | That hosted service; only `model` is needed, the key comes from its usual variable (`OPENROUTER_API_KEY`, ...) |
|
|
44
|
+
| `ollama` | A local Ollama server: free, no key |
|
|
45
|
+
| `openai_compat` | Any other OpenAI-compatible server (LM Studio, vLLM, llama.cpp, proxies) via `base_url` |
|
|
44
46
|
| `anthropic` | Claude via the Anthropic SDK (`pip install "agentplaykit[anthropic]"`) |
|
|
45
47
|
| `command` | Any program, in any language, reading and writing JSON lines |
|
|
46
48
|
| `http` | Any agent behind a URL |
|
|
47
49
|
| `mcp` | A tool on an MCP server (`pip install "agentplaykit[mcp]"`, Python 3.10+) |
|
|
48
50
|
|
|
49
51
|
```yaml
|
|
50
|
-
- id: x
|
|
51
|
-
|
|
52
|
-
config: {base_url: "http://localhost:11434/v1", model: "llama3.2"} # local Ollama, free
|
|
52
|
+
- {id: x, use: ollama, config: {model: "llama3.2"}} # local, free
|
|
53
|
+
- {id: y, use: openrouter, config: {model: "<provider>/<model>"}} # key from OPENROUTER_API_KEY
|
|
53
54
|
```
|
|
54
|
-
Keys come from environment variables
|
|
55
|
+
Keys come from environment variables, never from the scenario.
|
|
55
56
|
Every call's tokens and cost are logged; runs stop at `max_cost_usd` (default $1). Set `price`
|
|
56
|
-
per model for exact costs. See `examples/ox-llm/scenario.yaml` and `examples/command-agent/`.
|
|
57
|
+
per model for exact costs (`openrouter` reports its own). See `examples/ox-llm/scenario.yaml` and `examples/command-agent/`.
|
|
57
58
|
|
|
58
59
|
## Score and compare
|
|
59
60
|
Add evaluators to a scenario; they read only the finished log, so agents can never touch them:
|
|
60
61
|
```yaml
|
|
61
62
|
evaluators:
|
|
62
63
|
- {use: outcome, config: {agent: x}} # did x win?
|
|
63
|
-
- {use: judge, config: {rubric: "Did x explain its moves?", agent: {use:
|
|
64
|
+
- {use: judge, config: {rubric: "Did x explain its moves?", agent: {use: openrouter, config: {...}}}}
|
|
64
65
|
```
|
|
65
66
|
Run many seeds and get a summary (pass rate, steps, cost, spread):
|
|
66
67
|
```bash
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# ADR-0005: Built-in provider presets
|
|
2
|
+
- Status: Accepted
|
|
3
|
+
- Date: 2026-11-30
|
|
4
|
+
- Amends: [ADR-0003](0003-model-neutral.md), [ADR-0004](0004-no-built-in-prices.md)
|
|
5
|
+
|
|
6
|
+
## Context
|
|
7
|
+
In v0.1 every OpenAI-compatible service went through one adapter, `openai_compat`. Users had to
|
|
8
|
+
know each service's URL, key variable and quirks, and nothing service-specific was possible:
|
|
9
|
+
OpenRouter could not report the cost it actually charged, and a stopped Ollama gave a generic
|
|
10
|
+
"is the server running?" error.
|
|
11
|
+
|
|
12
|
+
## Decision
|
|
13
|
+
- Ship named presets as built-in adapters: `openai`, `openrouter`, `groq`, `deepseek`, `gemini`,
|
|
14
|
+
`mistral`, `together` (hosted) and `ollama` (local).
|
|
15
|
+
- All presets are rows in one table (`agentplaykit/agents/providers.py`) over the shared
|
|
16
|
+
OpenAI-compatible code. A preset only fills in defaults (`base_url`, `api_key_env`); config
|
|
17
|
+
can override any of them.
|
|
18
|
+
- `openai_compat` stays as the generic adapter for every other OpenAI-compatible server.
|
|
19
|
+
`anthropic` and `mcp` are unchanged.
|
|
20
|
+
- Every preset keeps plain-text replies by default, so all models get the same prompt (ADP-003).
|
|
21
|
+
- When a provider reports the cost it charged for a call (OpenRouter), that cost is used if the
|
|
22
|
+
config sets no `price`. This is a measured value, not a guess, so ADR-0004's rule against
|
|
23
|
+
built-in prices still holds.
|
|
24
|
+
- A hosted preset is never treated as a free local endpoint, even through a proxy on
|
|
25
|
+
`localhost`, unless config sets `local: true`; otherwise budget caps could silently stop
|
|
26
|
+
applying.
|
|
27
|
+
- OpenRouter attribution headers are sent only when config sets `app_name` or `app_url`.
|
|
28
|
+
|
|
29
|
+
## Consequences
|
|
30
|
+
Most users get a one-line setup (`use: openrouter`, `model: ...`). The core still names no
|
|
31
|
+
vendor: presets live in `agents/` and are ordinary built-in adapters (ADP-001). Adding another
|
|
32
|
+
OpenAI-compatible service is one row in the table plus a test. Services that are not
|
|
33
|
+
OpenAI-compatible still ship as plugins (ADP-005).
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# Real AI models
|
|
2
|
+
|
|
3
|
+
AgentPlay is model-neutral ([ADR-0003](../adr/0003-model-neutral.md)): no vendor is built
|
|
4
|
+
into the core, and every model gets the same prompt.
|
|
5
|
+
|
|
6
|
+
| `use` | Connects to | Install |
|
|
7
|
+
| --- | --- | --- |
|
|
8
|
+
| `openai` | OpenAI | included |
|
|
9
|
+
| `openrouter` | Hundreds of hosted models through [OpenRouter](https://openrouter.ai) | included |
|
|
10
|
+
| `groq`, `deepseek`, `gemini`, `mistral`, `together` | That hosted service | included |
|
|
11
|
+
| `ollama` | A local [Ollama](https://ollama.com) server | included |
|
|
12
|
+
| `openai_compat` | Any other OpenAI-compatible server: LM Studio, vLLM, llama.cpp, proxies | included |
|
|
13
|
+
| `anthropic` | Claude, through the official SDK | `pip install "agentplaykit[anthropic]"` |
|
|
14
|
+
| `command` | Any program speaking JSON lines | included |
|
|
15
|
+
| `http` | Any agent behind a URL | included |
|
|
16
|
+
| `mcp` | A tool on an MCP server | `pip install "agentplaykit[mcp]"` (Python 3.10+) |
|
|
17
|
+
|
|
18
|
+
## Provider presets
|
|
19
|
+
|
|
20
|
+
Each named service is a preset: it fills in the address and the key variable, so `model` is
|
|
21
|
+
all you need ([ADR-0005](../adr/0005-provider-presets.md)).
|
|
22
|
+
|
|
23
|
+
| `use` | Default `base_url` | Key variable |
|
|
24
|
+
| --- | --- | --- |
|
|
25
|
+
| `openai` | `https://api.openai.com/v1` | `OPENAI_API_KEY` |
|
|
26
|
+
| `openrouter` | `https://openrouter.ai/api/v1` | `OPENROUTER_API_KEY` |
|
|
27
|
+
| `groq` | `https://api.groq.com/openai/v1` | `GROQ_API_KEY` |
|
|
28
|
+
| `deepseek` | `https://api.deepseek.com/v1` | `DEEPSEEK_API_KEY` |
|
|
29
|
+
| `gemini` | `https://generativelanguage.googleapis.com/v1beta/openai` | `GEMINI_API_KEY` |
|
|
30
|
+
| `mistral` | `https://api.mistral.ai/v1` | `MISTRAL_API_KEY` |
|
|
31
|
+
| `together` | `https://api.together.xyz/v1` | `TOGETHER_API_KEY` |
|
|
32
|
+
| `ollama` | `http://localhost:11434/v1` | none |
|
|
33
|
+
|
|
34
|
+
```yaml
|
|
35
|
+
- id: x
|
|
36
|
+
use: groq
|
|
37
|
+
config:
|
|
38
|
+
model: "<model id from the provider's model list>"
|
|
39
|
+
price: {input_per_mtok: 0.5, output_per_mtok: 1.5} # the model's listed prices
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
- If the key variable is not set, the run stops before any request and says which variable
|
|
43
|
+
to export.
|
|
44
|
+
- Every preset takes all the `openai_compat` options below. Override `base_url` to go through a
|
|
45
|
+
proxy, `api_key_env` to read a different variable, or `api_key_env: null` to send no key.
|
|
46
|
+
- A hosted preset is never counted as free, even through a proxy on `localhost`, so budget
|
|
47
|
+
caps keep working. Set `price`, or `local: true` if the calls really cost nothing.
|
|
48
|
+
- The log records the preset name as the provider (override with `provider`).
|
|
49
|
+
- Replies are plain JSON text by default, the same for every model, so comparisons are fair.
|
|
50
|
+
Set `tool_calls: true` to use native tool calls.
|
|
51
|
+
|
|
52
|
+
## OpenRouter
|
|
53
|
+
|
|
54
|
+
OpenRouter gives one key for hundreds of hosted models:
|
|
55
|
+
|
|
56
|
+
```yaml
|
|
57
|
+
- id: x
|
|
58
|
+
use: openrouter
|
|
59
|
+
config:
|
|
60
|
+
model: "<provider>/<model>" # copy the exact id from openrouter.ai/models
|
|
61
|
+
app_name: "My benchmark" # optional: sent as X-Title
|
|
62
|
+
app_url: "https://example.org" # optional: sent as HTTP-Referer
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
- **Cost is recorded for you.** AgentPlay asks OpenRouter for each call's actual cost and logs
|
|
66
|
+
it, so `price` is optional here. A `price` you set still wins.
|
|
67
|
+
- Nothing identifies your app unless you set `app_name` / `app_url` (OpenRouter uses them for
|
|
68
|
+
its app rankings).
|
|
69
|
+
- Pick a **chat (text to text)** model. Embedding models (often with `embed` in the name)
|
|
70
|
+
cannot play: every request is refused and runs end as `aborted`.
|
|
71
|
+
- Models ending in `:free` cost nothing but have tight rate limits. Many games in a row hit
|
|
72
|
+
`429` errors; the multi-run summary lists them under `errors:`. Run fewer games, wait
|
|
73
|
+
between batches, or raise `retries`.
|
|
74
|
+
- `usage` events record the model OpenRouter actually served, so you can see if it routed you
|
|
75
|
+
elsewhere.
|
|
76
|
+
|
|
77
|
+
## Ollama
|
|
78
|
+
|
|
79
|
+
```yaml
|
|
80
|
+
- {id: x, use: ollama, config: {model: "llama3.2"}} # run `ollama pull llama3.2` first
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
No key, and cost is 0 on this machine. If Ollama is not running, the error says to start it
|
|
84
|
+
with `ollama serve`. For Ollama on another machine, set `base_url: "http://<host>:11434/v1"`
|
|
85
|
+
and `local: true` to keep it free; otherwise its cost is unknown and the token cap applies.
|
|
86
|
+
|
|
87
|
+
## `openai_compat`
|
|
88
|
+
|
|
89
|
+
For any other server that speaks the OpenAI chat format (LM Studio, vLLM, llama.cpp, a proxy):
|
|
90
|
+
|
|
91
|
+
```yaml
|
|
92
|
+
- id: x
|
|
93
|
+
use: openai_compat
|
|
94
|
+
config:
|
|
95
|
+
base_url: "http://localhost:1234/v1" # required
|
|
96
|
+
model: "local-model" # required
|
|
97
|
+
api_key_env: MY_API_KEY # only if the server needs a key
|
|
98
|
+
price: {input_per_mtok: 0.5, output_per_mtok: 1.5}
|
|
99
|
+
tool_calls: false # default: the model answers with JSON text, which every server supports
|
|
100
|
+
json_mode: false
|
|
101
|
+
temperature: 0.2 # sent only if set
|
|
102
|
+
max_output_tokens: 1024
|
|
103
|
+
timeout_s: 120
|
|
104
|
+
retries: 5 # default; about 30 s of backoff for rate limits
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## `anthropic`
|
|
108
|
+
|
|
109
|
+
```yaml
|
|
110
|
+
- id: x
|
|
111
|
+
use: anthropic
|
|
112
|
+
config:
|
|
113
|
+
model: claude-opus-5-5
|
|
114
|
+
api_key_env: ANTHROPIC_API_KEY
|
|
115
|
+
price: {input_per_mtok: 4.0, output_per_mtok: 20.0}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
It lets the model choose to call the `act` tool (`tool_choice: auto`), sends no sampling
|
|
119
|
+
parameters unless you set them, and reports a refusal as an agent error.
|
|
120
|
+
|
|
121
|
+
## Costs and budgets
|
|
122
|
+
|
|
123
|
+
- Every call's tokens and cost are logged, and runs stop at `limits.max_cost_usd`
|
|
124
|
+
(default $1).
|
|
125
|
+
- AgentPlay ships no price list ([ADR-0004](../adr/0004-no-built-in-prices.md)): set `price`
|
|
126
|
+
from your provider's current price list. The exception is `openrouter`, which reports each
|
|
127
|
+
call's actual cost.
|
|
128
|
+
- Local servers cost $0. Without a price, cost is unknown: the log gets a warning and
|
|
129
|
+
`limits.max_tokens` applies instead.
|
|
130
|
+
|
|
131
|
+
## Keys and safety
|
|
132
|
+
|
|
133
|
+
- Keys come only from environment variables (`api_key_env`), never from scenario files.
|
|
134
|
+
- Keys are redacted from logs, results and errors.
|
|
135
|
+
- Keys are never sent over plain `http://` to a remote host (override:
|
|
136
|
+
`allow_insecure_http: true`).
|
|
137
|
+
- Redirects are never followed, so a key only goes to the host you named.
|
|
138
|
+
- Agent programs (`command`, `mcp`) do not inherit your environment; forward variables with
|
|
139
|
+
`pass_env`.
|
|
140
|
+
|
|
141
|
+
## Retries
|
|
142
|
+
|
|
143
|
+
Rate limits and server errors are retried with backoff (`retries`, default 5: waits of 1, 2, 4, 8
|
|
144
|
+
and 16 seconds), honoring
|
|
145
|
+
`Retry-After`. Each retry is logged as a `provider_error`. If the provider stays down, the
|
|
146
|
+
run ends as `aborted`; this never counts as a forfeit.
|
|
@@ -11,7 +11,7 @@ seed: 7 # default 0
|
|
|
11
11
|
world: {use: ox, config: {}}
|
|
12
12
|
agents:
|
|
13
13
|
- {id: x, use: scripted/minimax}
|
|
14
|
-
- {id: o, use:
|
|
14
|
+
- {id: o, use: openrouter, config: {model: "..."}}
|
|
15
15
|
limits:
|
|
16
16
|
max_steps: 200 # defaults shown; null turns a limit off
|
|
17
17
|
max_seconds: 600
|
|
@@ -34,7 +34,8 @@ In this order; the first match wins:
|
|
|
34
34
|
3. An installed plugin (entry points `agentplaykit.envs`, `agentplaykit.agents`,
|
|
35
35
|
`agentplaykit.evaluators`).
|
|
36
36
|
4. A built-in: worlds `ox`, `blank`, `rps`; agents `scripted/random`, `scripted/minimax`,
|
|
37
|
-
`openai_compat`, `
|
|
37
|
+
`openai_compat`, `openai`, `openrouter`, `groq`, `deepseek`, `gemini`, `mistral`, `together`,
|
|
38
|
+
`ollama`, `anthropic`, `command`, `http`, `mcp`; evaluators `outcome`, `judge`.
|
|
38
39
|
|
|
39
40
|
`agentplaykit env list` shows the worlds available from the current folder.
|
|
40
41
|
|
|
@@ -8,8 +8,31 @@ Python 3.8 or newer. Plain `pip` works:
|
|
|
8
8
|
pip install agentplaykit
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
We recommend a virtual environment, so AgentPlay and its dependencies stay separate:
|
|
12
|
+
|
|
13
|
+
=== "Windows"
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
python -m venv .venv
|
|
17
|
+
.venv\Scripts\activate
|
|
18
|
+
pip install agentplaykit
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
=== "macOS / Linux"
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
python3 -m venv .venv
|
|
25
|
+
source .venv/bin/activate
|
|
26
|
+
pip install agentplaykit
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
!!! tip "'agentplaykit' is not recognized as a command"
|
|
30
|
+
The folder pip put the command in is not on your PATH, usually because the virtual
|
|
31
|
+
environment is not active (your prompt should start with `(.venv)`). Either activate it,
|
|
32
|
+
or run every command through Python instead: `python -m agentplaykit play`.
|
|
33
|
+
|
|
34
|
+
In PowerShell, if activation says *running scripts is disabled*, run
|
|
35
|
+
`Set-ExecutionPolicy -Scope CurrentUser RemoteSigned` once, then activate again.
|
|
13
36
|
|
|
14
37
|
## 2. Run the demo
|
|
15
38
|
|
|
@@ -52,15 +75,13 @@ agentplaykit play my-game.yaml
|
|
|
52
75
|
Change one line. With [Ollama](https://ollama.com) running locally (free, no key):
|
|
53
76
|
|
|
54
77
|
```yaml
|
|
55
|
-
- {id: x, use:
|
|
78
|
+
- {id: x, use: ollama, config: {model: "llama3.2"}}
|
|
56
79
|
```
|
|
57
80
|
|
|
58
|
-
Or a hosted
|
|
81
|
+
Or a hosted service, with its key in the usual environment variable (here `OPENROUTER_API_KEY`):
|
|
59
82
|
|
|
60
83
|
```yaml
|
|
61
|
-
- id: x
|
|
62
|
-
use: openai_compat
|
|
63
|
-
config: {base_url: "https://openrouter.ai/api/v1", model: "<provider>/<model>", api_key_env: OPENROUTER_API_KEY}
|
|
84
|
+
- {id: x, use: openrouter, config: {model: "<provider>/<model>"}}
|
|
64
85
|
```
|
|
65
86
|
|
|
66
87
|
See [Real AI models](guides/models.md) for every option.
|