akgentic-agent 1.6.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.
Files changed (30) hide show
  1. akgentic_agent-1.6.0/.github/workflows/ci.yml +86 -0
  2. akgentic_agent-1.6.0/.github/workflows/release.yml +69 -0
  3. akgentic_agent-1.6.0/.gitignore +27 -0
  4. akgentic_agent-1.6.0/LICENSE +661 -0
  5. akgentic_agent-1.6.0/PKG-INFO +518 -0
  6. akgentic_agent-1.6.0/README.md +491 -0
  7. akgentic_agent-1.6.0/docs/agent-collaboration.md +975 -0
  8. akgentic_agent-1.6.0/examples/README.md +151 -0
  9. akgentic_agent-1.6.0/examples/simple_team.py +378 -0
  10. akgentic_agent-1.6.0/pyproject.toml +81 -0
  11. akgentic_agent-1.6.0/src/akgentic/__init__.py +2 -0
  12. akgentic_agent-1.6.0/src/akgentic/agent/__init__.py +26 -0
  13. akgentic_agent-1.6.0/src/akgentic/agent/agent.py +514 -0
  14. akgentic_agent-1.6.0/src/akgentic/agent/config.py +93 -0
  15. akgentic_agent-1.6.0/src/akgentic/agent/human_proxy.py +122 -0
  16. akgentic_agent-1.6.0/src/akgentic/agent/messages.py +25 -0
  17. akgentic_agent-1.6.0/src/akgentic/agent/output_models.py +49 -0
  18. akgentic_agent-1.6.0/src/akgentic/agent/py.typed +1 -0
  19. akgentic_agent-1.6.0/tests/__init__.py +1 -0
  20. akgentic_agent-1.6.0/tests/agent/test_agent.py +297 -0
  21. akgentic_agent-1.6.0/tests/agent/test_agent_coverage.py +700 -0
  22. akgentic_agent-1.6.0/tests/agent/test_compact_clear_commands.py +283 -0
  23. akgentic_agent-1.6.0/tests/agent/test_human_proxy.py +122 -0
  24. akgentic_agent-1.6.0/tests/agent/test_initial_system_prompt.py +89 -0
  25. akgentic_agent-1.6.0/tests/agent/test_messages.py +58 -0
  26. akgentic_agent-1.6.0/tests/agent/test_mock_react_agent_wiring.py +137 -0
  27. akgentic_agent-1.6.0/tests/agent/test_on_stop_close.py +140 -0
  28. akgentic_agent-1.6.0/tests/agent/test_output_models.py +140 -0
  29. akgentic_agent-1.6.0/tests/agent/test_simple_team.py +558 -0
  30. akgentic_agent-1.6.0/tests/agent/test_usage_summary.py +217 -0
@@ -0,0 +1,86 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ branches: [master]
7
+ workflow_dispatch:
8
+
9
+ env:
10
+ NO_COLOR: "1"
11
+ # Release channel for akgentic-* dependencies. On a release branch set this
12
+ # to that branch (e.g. version-1.x); sibling akgentic-* packages are built
13
+ # from this branch into the local wheelhouse.
14
+ RELEASE_BRANCH: master
15
+ # Transitive closure of akgentic-* dependencies, space-separated. uv resolves
16
+ # the graph from the wheelhouse, so order does not matter.
17
+ AKGENTIC_DEPS: "akgentic-core akgentic-llm akgentic-tool"
18
+
19
+ jobs:
20
+ quality:
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - name: Checkout akgentic-agent
24
+ uses: actions/checkout@v6
25
+
26
+ - name: Install uv
27
+ uses: astral-sh/setup-uv@v8.1.0
28
+ with:
29
+ version: "latest"
30
+
31
+ - name: Set up Python 3.12
32
+ run: uv python install 3.12
33
+
34
+ # Build every akgentic-* dependency from RELEASE_BRANCH into a local
35
+ # wheelhouse. uv pip install --find-links then resolves them from there;
36
+ # all other (PyPI) deps still come from the default index.
37
+ - name: Build akgentic-* dependency wheelhouse
38
+ run: |
39
+ mkdir -p wheelhouse
40
+ for dep in ${AKGENTIC_DEPS}; do
41
+ echo "::group::build ${dep} @ ${RELEASE_BRANCH}"
42
+ git clone --depth 1 --branch "${RELEASE_BRANCH}" \
43
+ "https://github.com/b12consulting/${dep}.git" "/tmp/${dep}"
44
+ uv build --wheel --out-dir wheelhouse "/tmp/${dep}"
45
+ echo "::endgroup::"
46
+ done
47
+ ls -1 wheelhouse
48
+
49
+ - name: Create virtual environment
50
+ run: uv venv
51
+
52
+ # Install the package editable, resolving akgentic-* deps from the
53
+ # wheelhouse and everything else from PyPI.
54
+ - name: Install dependencies
55
+ run: uv pip install --find-links wheelhouse -e ".[dev]"
56
+
57
+ # --no-sync: run in the wheelhouse-built venv without re-resolving from a
58
+ # lockfile (there is no project lockfile in this install model).
59
+ - name: Type checking
60
+ run: uv run --no-sync mypy src/
61
+
62
+ - name: Linting
63
+ run: uv run --no-sync ruff check src/
64
+
65
+ - name: Run tests with coverage
66
+ run: >
67
+ uv run --no-sync pytest tests/
68
+ --cov=akgentic.agent
69
+ --cov-report=term-missing
70
+ --cov-report=json:coverage.json
71
+ --cov-fail-under=80
72
+ env:
73
+ OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
74
+
75
+ - name: Update coverage badge
76
+ if: github.ref_name == 'master' && github.event_name == 'push'
77
+ run: |
78
+ COVERAGE=$(python -c "import json; print(int(json.load(open('coverage.json'))['totals']['percent_covered_display']))")
79
+ if [ "$COVERAGE" -ge 90 ]; then COLOR="brightgreen"
80
+ elif [ "$COVERAGE" -ge 80 ]; then COLOR="green"
81
+ elif [ "$COVERAGE" -ge 70 ]; then COLOR="yellow"
82
+ else COLOR="red"; fi
83
+ echo "{\"schemaVersion\":1,\"label\":\"coverage\",\"message\":\"${COVERAGE}%\",\"color\":\"${COLOR}\"}" > badge.json
84
+ gh gist edit 69ad301e9b6491972aa7324eb8953f8a -f coverage.json badge.json
85
+ env:
86
+ GH_TOKEN: ${{ secrets.GH_PAT }}
@@ -0,0 +1,69 @@
1
+ name: Release
2
+
3
+ # Manual release: reads version from pyproject.toml on master, tags master HEAD,
4
+ # builds the wheel, and creates a GitHub Release with the wheel attached.
5
+ #
6
+ # Bumping the version is a separate maintainer action via a normal PR. This
7
+ # workflow does NOT push commits to master — branch protection blocks that.
8
+ # The release flow is therefore two-step:
9
+ # 1. Open a "chore: bump version to X.Y.Z" PR; merge it.
10
+ # 2. Trigger this workflow from the Actions tab.
11
+
12
+ on:
13
+ workflow_dispatch:
14
+
15
+ jobs:
16
+ release:
17
+ runs-on: ubuntu-latest
18
+ permissions:
19
+ contents: write
20
+ steps:
21
+ - name: Checkout master
22
+ uses: actions/checkout@v6
23
+ with:
24
+ ref: master
25
+ fetch-depth: 0
26
+
27
+ - name: Install uv
28
+ uses: astral-sh/setup-uv@v8.1.0
29
+ with:
30
+ version: "latest"
31
+
32
+ - name: Set up Python 3.12
33
+ run: uv python install 3.12
34
+
35
+ - name: Read version from pyproject.toml
36
+ id: version
37
+ run: |
38
+ VERSION=$(grep -E '^version = ' pyproject.toml | sed -E 's/version = "(.*)"/\1/')
39
+ echo "Releasing version: $VERSION"
40
+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
41
+
42
+ - name: Verify tag does not already exist
43
+ env:
44
+ VERSION: ${{ steps.version.outputs.version }}
45
+ run: |
46
+ if git rev-parse "v$VERSION" >/dev/null 2>&1; then
47
+ echo "::error::Tag v$VERSION already exists. Bump the version in pyproject.toml first."
48
+ exit 1
49
+ fi
50
+
51
+ - name: Tag master HEAD
52
+ env:
53
+ VERSION: ${{ steps.version.outputs.version }}
54
+ run: |
55
+ git config user.name "github-actions[bot]"
56
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
57
+ git tag "v$VERSION"
58
+ git push origin "v$VERSION"
59
+
60
+ - name: Build wheel
61
+ run: uv build --wheel --out-dir dist/
62
+
63
+ - name: Create GitHub Release
64
+ uses: softprops/action-gh-release@v2
65
+ with:
66
+ tag_name: "v${{ steps.version.outputs.version }}"
67
+ name: "v${{ steps.version.outputs.version }}"
68
+ files: dist/*.whl
69
+ generate_release_notes: true
@@ -0,0 +1,27 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # Distribution / packaging
7
+ dist/
8
+ build/
9
+ *.egg-info/
10
+ **/settings.local.json
11
+
12
+ # Testing
13
+ .pytest_cache/
14
+ .coverage
15
+ htmlcov/
16
+
17
+ # Type checking
18
+ .mypy_cache/
19
+ .dmypy.json
20
+
21
+ # Virtual environments
22
+ .venv/
23
+ venv/
24
+
25
+ # IDE
26
+ .vscode/
27
+ .idea/