pytest-agent-check 0.0.1__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.
- pytest_agent_check-0.0.1/.cassettes/balance_check.yaml +17 -0
- pytest_agent_check-0.0.1/.cassettes/bank-agent__test_check_balance_auto_cassette.yaml +16 -0
- pytest_agent_check-0.0.1/.cassettes/check_balance.yaml +16 -0
- pytest_agent_check-0.0.1/.cassettes/mock-support__test_expect_tools_and_output.yaml +23 -0
- pytest_agent_check-0.0.1/.cassettes/mock-support__test_no_tool_calls.yaml +10 -0
- pytest_agent_check-0.0.1/.cassettes/order_status.yaml +21 -0
- pytest_agent_check-0.0.1/.cassettes/refund_flow.yaml +40 -0
- pytest_agent_check-0.0.1/.cassettes/unknown_request.yaml +10 -0
- pytest_agent_check-0.0.1/.github/workflows/ci.yml +79 -0
- pytest_agent_check-0.0.1/.github/workflows/pr-labeler.yml +18 -0
- pytest_agent_check-0.0.1/.github/workflows/publish-pypi.yml +38 -0
- pytest_agent_check-0.0.1/.github/workflows/release-drafter.yml +19 -0
- pytest_agent_check-0.0.1/.gitignore +26 -0
- pytest_agent_check-0.0.1/LICENSE +21 -0
- pytest_agent_check-0.0.1/PKG-INFO +390 -0
- pytest_agent_check-0.0.1/README.md +352 -0
- pytest_agent_check-0.0.1/examples/agent.py +134 -0
- pytest_agent_check-0.0.1/examples/test_support_agent.py +92 -0
- pytest_agent_check-0.0.1/pyproject.toml +80 -0
- pytest_agent_check-0.0.1/pytest_agent_check.egg-info/PKG-INFO +390 -0
- pytest_agent_check-0.0.1/pytest_agent_check.egg-info/SOURCES.txt +38 -0
- pytest_agent_check-0.0.1/pytest_agent_check.egg-info/dependency_links.txt +1 -0
- pytest_agent_check-0.0.1/pytest_agent_check.egg-info/entry_points.txt +5 -0
- pytest_agent_check-0.0.1/pytest_agent_check.egg-info/requires.txt +16 -0
- pytest_agent_check-0.0.1/pytest_agent_check.egg-info/scm_file_list.json +34 -0
- pytest_agent_check-0.0.1/pytest_agent_check.egg-info/scm_version.json +8 -0
- pytest_agent_check-0.0.1/pytest_agent_check.egg-info/top_level.txt +1 -0
- pytest_agent_check-0.0.1/pytest_agent_eval/__init__.py +30 -0
- pytest_agent_check-0.0.1/pytest_agent_eval/api.py +188 -0
- pytest_agent_check-0.0.1/pytest_agent_eval/cassette.py +246 -0
- pytest_agent_check-0.0.1/pytest_agent_eval/cli.py +161 -0
- pytest_agent_check-0.0.1/pytest_agent_eval/comparator.py +129 -0
- pytest_agent_check-0.0.1/pytest_agent_eval/models.py +173 -0
- pytest_agent_check-0.0.1/pytest_agent_eval/plugin.py +108 -0
- pytest_agent_check-0.0.1/pytest_agent_eval/reporter.py +138 -0
- pytest_agent_check-0.0.1/setup.cfg +4 -0
- pytest_agent_check-0.0.1/tests/test_api.py +105 -0
- pytest_agent_check-0.0.1/tests/test_cassette.py +168 -0
- pytest_agent_check-0.0.1/tests/test_comparator.py +134 -0
- pytest_agent_check-0.0.1/tests/test_smoke.py +74 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
agent_name: support-agent
|
|
2
|
+
interactions:
|
|
3
|
+
- input: What's my account balance?
|
|
4
|
+
metadata: {}
|
|
5
|
+
output: Your current account balance is $1,250.00 USD.
|
|
6
|
+
timestamp: '2026-07-30T17:55:13.139494+00:00'
|
|
7
|
+
tool_calls:
|
|
8
|
+
- arguments:
|
|
9
|
+
account_id: ACT-001
|
|
10
|
+
duration_ms: null
|
|
11
|
+
name: get_account_balance
|
|
12
|
+
result:
|
|
13
|
+
balance: 1250.0
|
|
14
|
+
currency: USD
|
|
15
|
+
metadata: {}
|
|
16
|
+
recorded_at: '2026-07-30T17:55:13.139599+00:00'
|
|
17
|
+
test_name: balance_check
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
agent_name: bank-agent
|
|
2
|
+
interactions:
|
|
3
|
+
- input: What is my balance?
|
|
4
|
+
metadata: {}
|
|
5
|
+
output: Your current balance is $250.00.
|
|
6
|
+
timestamp: '2026-07-30T17:55:44.516827+00:00'
|
|
7
|
+
tool_calls:
|
|
8
|
+
- arguments:
|
|
9
|
+
account_id: A-001
|
|
10
|
+
duration_ms: null
|
|
11
|
+
name: get_balance
|
|
12
|
+
result:
|
|
13
|
+
balance: 250.0
|
|
14
|
+
metadata: {}
|
|
15
|
+
recorded_at: '2026-07-30T17:55:44.516939+00:00'
|
|
16
|
+
test_name: bank-agent__test_check_balance_auto_cassette
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
agent_name: bank-agent
|
|
2
|
+
interactions:
|
|
3
|
+
- input: What is my balance?
|
|
4
|
+
metadata: {}
|
|
5
|
+
output: Your current balance is $250.00.
|
|
6
|
+
timestamp: '2026-07-30T17:55:44.515350+00:00'
|
|
7
|
+
tool_calls:
|
|
8
|
+
- arguments:
|
|
9
|
+
account_id: A-001
|
|
10
|
+
duration_ms: null
|
|
11
|
+
name: get_balance
|
|
12
|
+
result:
|
|
13
|
+
balance: 250.0
|
|
14
|
+
metadata: {}
|
|
15
|
+
recorded_at: '2026-07-30T17:55:44.515721+00:00'
|
|
16
|
+
test_name: check_balance
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
agent_name: mock-support
|
|
2
|
+
interactions:
|
|
3
|
+
- input: I want a refund
|
|
4
|
+
metadata: {}
|
|
5
|
+
output: Your refund of $50 has been processed. It will arrive in 3-5 business days.
|
|
6
|
+
timestamp: '2026-07-30T17:55:44.532931+00:00'
|
|
7
|
+
tool_calls:
|
|
8
|
+
- arguments:
|
|
9
|
+
order_id: '123'
|
|
10
|
+
duration_ms: null
|
|
11
|
+
name: lookup_order
|
|
12
|
+
result:
|
|
13
|
+
status: delivered
|
|
14
|
+
- arguments:
|
|
15
|
+
amount: 50
|
|
16
|
+
order_id: '123'
|
|
17
|
+
duration_ms: null
|
|
18
|
+
name: issue_refund
|
|
19
|
+
result:
|
|
20
|
+
refund_id: RF-001
|
|
21
|
+
metadata: {}
|
|
22
|
+
recorded_at: '2026-07-30T17:55:44.533010+00:00'
|
|
23
|
+
test_name: mock-support__test_expect_tools_and_output
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
agent_name: mock-support
|
|
2
|
+
interactions:
|
|
3
|
+
- input: Hello
|
|
4
|
+
metadata: {}
|
|
5
|
+
output: I'm not sure how to help with that.
|
|
6
|
+
timestamp: '2026-07-30T17:55:44.533958+00:00'
|
|
7
|
+
tool_calls: []
|
|
8
|
+
metadata: {}
|
|
9
|
+
recorded_at: '2026-07-30T17:55:44.534040+00:00'
|
|
10
|
+
test_name: mock-support__test_no_tool_calls
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
agent_name: support-agent
|
|
2
|
+
interactions:
|
|
3
|
+
- input: Where is my order?
|
|
4
|
+
metadata: {}
|
|
5
|
+
output: 'Your order ORD-001 is currently in transit via FastShip (tracking: FS-987654321).
|
|
6
|
+
Estimated delivery is February 20, 2025.'
|
|
7
|
+
timestamp: '2026-07-30T17:55:13.140429+00:00'
|
|
8
|
+
tool_calls:
|
|
9
|
+
- arguments:
|
|
10
|
+
order_id: ORD-001
|
|
11
|
+
duration_ms: null
|
|
12
|
+
name: lookup_order
|
|
13
|
+
result:
|
|
14
|
+
carrier: FastShip
|
|
15
|
+
estimated_delivery: '2025-02-20'
|
|
16
|
+
order_id: ORD-001
|
|
17
|
+
status: in_transit
|
|
18
|
+
tracking: FS-987654321
|
|
19
|
+
metadata: {}
|
|
20
|
+
recorded_at: '2026-07-30T17:55:13.140515+00:00'
|
|
21
|
+
test_name: order_status
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
agent_name: support-agent
|
|
2
|
+
interactions:
|
|
3
|
+
- input: I want a refund for my order ORD-001
|
|
4
|
+
metadata: {}
|
|
5
|
+
output: 'Your refund of $49.99 for order ORD-001 has been approved (refund ID: RF-001).
|
|
6
|
+
The amount will be returned to your original payment method within 3-5 business
|
|
7
|
+
days.'
|
|
8
|
+
timestamp: '2026-07-30T17:55:13.137690+00:00'
|
|
9
|
+
tool_calls:
|
|
10
|
+
- arguments:
|
|
11
|
+
order_id: ORD-001
|
|
12
|
+
duration_ms: null
|
|
13
|
+
name: lookup_order
|
|
14
|
+
result:
|
|
15
|
+
amount: 49.99
|
|
16
|
+
items:
|
|
17
|
+
- Wireless Headphones
|
|
18
|
+
order_id: ORD-001
|
|
19
|
+
status: delivered
|
|
20
|
+
- arguments:
|
|
21
|
+
order_id: ORD-001
|
|
22
|
+
duration_ms: null
|
|
23
|
+
name: check_refund_eligibility
|
|
24
|
+
result:
|
|
25
|
+
eligible: true
|
|
26
|
+
reason: Within 30-day return window
|
|
27
|
+
refund_amount: 49.99
|
|
28
|
+
- arguments:
|
|
29
|
+
amount: 49.99
|
|
30
|
+
method: original_payment
|
|
31
|
+
order_id: ORD-001
|
|
32
|
+
duration_ms: null
|
|
33
|
+
name: issue_refund
|
|
34
|
+
result:
|
|
35
|
+
expected_arrival: 3-5 business days
|
|
36
|
+
refund_id: RF-001
|
|
37
|
+
status: approved
|
|
38
|
+
metadata: {}
|
|
39
|
+
recorded_at: '2026-07-30T17:55:13.137966+00:00'
|
|
40
|
+
test_name: refund_flow
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
agent_name: support-agent
|
|
2
|
+
interactions:
|
|
3
|
+
- input: Sing me a song
|
|
4
|
+
metadata: {}
|
|
5
|
+
output: I'm sorry, I couldn't understand your request. Please try rephrasing.
|
|
6
|
+
timestamp: '2026-07-30T17:55:13.141367+00:00'
|
|
7
|
+
tool_calls: []
|
|
8
|
+
metadata: {}
|
|
9
|
+
recorded_at: '2026-07-30T17:55:13.141458+00:00'
|
|
10
|
+
test_name: unknown_request
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
lint:
|
|
15
|
+
name: Lint
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
19
|
+
with:
|
|
20
|
+
fetch-depth: 0 # full history for setuptools-scm
|
|
21
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
22
|
+
with:
|
|
23
|
+
python-version: "3.14"
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: |
|
|
26
|
+
python -m pip install --upgrade pip
|
|
27
|
+
pip install ruff
|
|
28
|
+
- name: Check formatting & lint
|
|
29
|
+
run: ruff check .
|
|
30
|
+
|
|
31
|
+
test:
|
|
32
|
+
name: Test Python ${{ matrix.python-version }}
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
strategy:
|
|
35
|
+
matrix:
|
|
36
|
+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
37
|
+
fail-fast: false
|
|
38
|
+
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
41
|
+
with:
|
|
42
|
+
fetch-depth: 0 # full history for setuptools-scm
|
|
43
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
44
|
+
with:
|
|
45
|
+
python-version: ${{ matrix.python-version }}
|
|
46
|
+
|
|
47
|
+
- name: Install package
|
|
48
|
+
run: |
|
|
49
|
+
python -m pip install --upgrade pip
|
|
50
|
+
pip install .[cli]
|
|
51
|
+
|
|
52
|
+
- name: Run tests (replay mode — offline, deterministic)
|
|
53
|
+
run: |
|
|
54
|
+
python -m pytest tests/ examples/ -v --cassette-mode=replay
|
|
55
|
+
|
|
56
|
+
- name: Verify CLI works
|
|
57
|
+
run: |
|
|
58
|
+
agent-eval run tests/ --quiet 2>&1 | tail -5
|
|
59
|
+
agent-eval --help
|
|
60
|
+
|
|
61
|
+
build:
|
|
62
|
+
name: Build package
|
|
63
|
+
runs-on: ubuntu-latest
|
|
64
|
+
needs: [lint, test]
|
|
65
|
+
steps:
|
|
66
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
67
|
+
with:
|
|
68
|
+
fetch-depth: 0 # full history for setuptools-scm
|
|
69
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
70
|
+
with:
|
|
71
|
+
python-version: "3.14"
|
|
72
|
+
- name: Build
|
|
73
|
+
run: |
|
|
74
|
+
pip install build
|
|
75
|
+
python -m build
|
|
76
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
77
|
+
with:
|
|
78
|
+
name: dist
|
|
79
|
+
path: dist/
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
name: PR Labeler
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request_target:
|
|
5
|
+
types: [opened, edited, synchronize, labeled, unlabeled]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
label_pr:
|
|
9
|
+
permissions:
|
|
10
|
+
pull-requests: write
|
|
11
|
+
contents: read
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: release-drafter/release-drafter/autolabeler@4d75298e00d9e34c483e5ff8c68d0ea1c1940c1e # v7.5.1
|
|
15
|
+
env:
|
|
16
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
17
|
+
with:
|
|
18
|
+
config-name: github:shenxianpeng/.github:/.github/release-drafter.yml
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: Upload Python Package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
branches: [main]
|
|
6
|
+
types: [published]
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build-and-publish:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
permissions:
|
|
15
|
+
id-token: write # mandatory for trusted publishing (OIDC)
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
19
|
+
with:
|
|
20
|
+
fetch-depth: 0
|
|
21
|
+
|
|
22
|
+
- name: Set up Python
|
|
23
|
+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
24
|
+
with:
|
|
25
|
+
python-version: "3.x"
|
|
26
|
+
|
|
27
|
+
- name: Install build dependencies
|
|
28
|
+
run: python -m pip install --upgrade pip build twine
|
|
29
|
+
|
|
30
|
+
- name: Build distribution
|
|
31
|
+
run: python -m build
|
|
32
|
+
|
|
33
|
+
- name: Check distribution
|
|
34
|
+
run: twine check dist/*
|
|
35
|
+
|
|
36
|
+
- name: Publish to PyPI
|
|
37
|
+
if: github.repository == 'shenxianpeng/pytest-agent-check'
|
|
38
|
+
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
name: Release Drafter
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
update_release_draft:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write
|
|
13
|
+
pull-requests: read
|
|
14
|
+
steps:
|
|
15
|
+
- uses: release-drafter/release-drafter@4d75298e00d9e34c483e5ff8c68d0ea1c1940c1e # v7.5.1
|
|
16
|
+
with:
|
|
17
|
+
config-name: github:shenxianpeng/.github:/.github/release-drafter.yml
|
|
18
|
+
env:
|
|
19
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
dist/
|
|
6
|
+
build/
|
|
7
|
+
|
|
8
|
+
# Virtual environment
|
|
9
|
+
venv/
|
|
10
|
+
.env
|
|
11
|
+
|
|
12
|
+
# Ruff
|
|
13
|
+
.ruff_cache/
|
|
14
|
+
|
|
15
|
+
# Pytest
|
|
16
|
+
.pytest_cache/
|
|
17
|
+
|
|
18
|
+
# OS
|
|
19
|
+
.DS_Store
|
|
20
|
+
Thumbs.db
|
|
21
|
+
|
|
22
|
+
# IDE
|
|
23
|
+
.vscode/
|
|
24
|
+
.idea/
|
|
25
|
+
*.swp
|
|
26
|
+
*.swo
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Xianpeng Shen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|