Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:

- run: uv run pytest

- run: uv run examples/check-examples.py
- run: uv run examples/.test_scripts/check-examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"""Typecheck all example directories with mypy.

Usage (from repo root):
uv run examples/check-examples.py
uv run examples/.test_scripts/check-examples.py
"""

import os
import subprocess
import sys
from pathlib import Path

REPO = Path(__file__).resolve().parent.parent
REPO = Path(__file__).resolve().parent.parent.parent
MYPY_VERSION = "mypy>=1.11"

# Each entry: (display name, directory to check, extra --with deps)
Expand Down
22 changes: 11 additions & 11 deletions examples/run-examples.py → examples/.test_scripts/run-examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
"""Run examples and report results.

Usage (from repo root):
uv run examples/run-examples.py # text-only samples
uv run examples/run-examples.py --image # also run image samples
uv run examples/run-examples.py --video # also run video samples
uv run examples/run-examples.py --e2e # also run e2e test scripts
uv run examples/run-examples.py --all # run everything
uv run examples/run-examples.py --parallel # run in parallel
uv run examples/run-examples.py stream.py tools_schema.py
uv run examples/.test_scripts/run-examples.py # text-only samples
uv run examples/.test_scripts/run-examples.py --image # also image samples
uv run examples/.test_scripts/run-examples.py --video # also video samples
uv run examples/.test_scripts/run-examples.py --e2e # also e2e test scripts
uv run examples/.test_scripts/run-examples.py --all # everything
uv run examples/.test_scripts/run-examples.py --parallel # in parallel
uv run examples/.test_scripts/run-examples.py stream.py tools_schema.py
# run selected example files
uv run examples/run-examples.py --model gateway:openai/gpt-5.4-mini
uv run examples/.test_scripts/run-examples.py --model MODEL
# patch ai.get_model() to use the given model for every sample
uv run examples/run-examples.py --protocol=responses
uv run examples/.test_scripts/run-examples.py --protocol=responses
# patch model/provider helpers and ai.stream()/ai.generate()
"""

Expand All @@ -24,9 +24,9 @@
import sys
from pathlib import Path

REPO = Path(__file__).resolve().parent.parent
REPO = Path(__file__).resolve().parent.parent.parent
SAMPLES = REPO / "examples" / "samples"
PATCH_SCRIPT = REPO / "examples" / "run-with-patched-model.py"
PATCH_SCRIPT = REPO / "examples" / ".test_scripts" / "run-with-patched-model.py"


@dataclasses.dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@

Usage (from repo root):

uv run examples/run-with-patched-model.py <model> <file.py>
uv run examples/run-with-patched-model.py --protocol=responses <file.py>
uv run examples/.test_scripts/run-with-patched-model.py <model> <file.py>
uv run examples/.test_scripts/run-with-patched-model.py \\
--protocol=responses <file.py>

Example:
uv run examples/run-with-patched-model.py \\
uv run examples/.test_scripts/run-with-patched-model.py \\
gateway:openai/gpt-5.4-mini \\
examples/samples/stream.py

Expand Down
2 changes: 1 addition & 1 deletion runtests
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ echo "=== pytest ==="
uv run pytest

echo "=== check-examples ==="
uv run examples/check-examples.py
uv run examples/.test_scripts/check-examples.py
Loading