akgentic-llm 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 (45) hide show
  1. akgentic_llm-1.6.0/.github/workflows/ci.yml +57 -0
  2. akgentic_llm-1.6.0/.github/workflows/release.yml +69 -0
  3. akgentic_llm-1.6.0/.gitignore +27 -0
  4. akgentic_llm-1.6.0/LICENSE +661 -0
  5. akgentic_llm-1.6.0/PKG-INFO +802 -0
  6. akgentic_llm-1.6.0/README.md +770 -0
  7. akgentic_llm-1.6.0/examples/README.md +13 -0
  8. akgentic_llm-1.6.0/pyproject.toml +76 -0
  9. akgentic_llm-1.6.0/quick_start.py +11 -0
  10. akgentic_llm-1.6.0/src/akgentic/__init__.py +2 -0
  11. akgentic_llm-1.6.0/src/akgentic/llm/__init__.py +107 -0
  12. akgentic_llm-1.6.0/src/akgentic/llm/agent.py +648 -0
  13. akgentic_llm-1.6.0/src/akgentic/llm/compaction.py +527 -0
  14. akgentic_llm-1.6.0/src/akgentic/llm/config.py +419 -0
  15. akgentic_llm-1.6.0/src/akgentic/llm/context.py +494 -0
  16. akgentic_llm-1.6.0/src/akgentic/llm/event.py +192 -0
  17. akgentic_llm-1.6.0/src/akgentic/llm/loadtest/__init__.py +34 -0
  18. akgentic_llm-1.6.0/src/akgentic/llm/loadtest/mock_agent.py +332 -0
  19. akgentic_llm-1.6.0/src/akgentic/llm/loadtest/scenario.py +119 -0
  20. akgentic_llm-1.6.0/src/akgentic/llm/pricing.py +268 -0
  21. akgentic_llm-1.6.0/src/akgentic/llm/prompts.py +73 -0
  22. akgentic_llm-1.6.0/src/akgentic/llm/providers.py +572 -0
  23. akgentic_llm-1.6.0/src/akgentic/llm/py.typed +1 -0
  24. akgentic_llm-1.6.0/tests/__init__.py +1 -0
  25. akgentic_llm-1.6.0/tests/loadtest/__init__.py +1 -0
  26. akgentic_llm-1.6.0/tests/loadtest/scenarios/sandpile-research.yaml +30 -0
  27. akgentic_llm-1.6.0/tests/loadtest/test_mock_react_agent.py +627 -0
  28. akgentic_llm-1.6.0/tests/test_aclose_and_loop.py +297 -0
  29. akgentic_llm-1.6.0/tests/test_agent.py +1312 -0
  30. akgentic_llm-1.6.0/tests/test_close_evicts_anyio_run_vars.py +244 -0
  31. akgentic_llm-1.6.0/tests/test_compaction.py +949 -0
  32. akgentic_llm-1.6.0/tests/test_config.py +487 -0
  33. akgentic_llm-1.6.0/tests/test_context.py +609 -0
  34. akgentic_llm-1.6.0/tests/test_event.py +106 -0
  35. akgentic_llm-1.6.0/tests/test_event_serialization.py +228 -0
  36. akgentic_llm-1.6.0/tests/test_exports.py +106 -0
  37. akgentic_llm-1.6.0/tests/test_heal_tool_calls.py +341 -0
  38. akgentic_llm-1.6.0/tests/test_mcp_memory_leak.py +292 -0
  39. akgentic_llm-1.6.0/tests/test_pricing.py +495 -0
  40. akgentic_llm-1.6.0/tests/test_prompts.py +62 -0
  41. akgentic_llm-1.6.0/tests/test_providers.py +813 -0
  42. akgentic_llm-1.6.0/tests/test_restore_fold.py +163 -0
  43. akgentic_llm-1.6.0/tests/test_system_prompt_event.py +430 -0
  44. akgentic_llm-1.6.0/tests/test_tool_events.py +532 -0
  45. akgentic_llm-1.6.0/tests/test_usage_event.py +343 -0
@@ -0,0 +1,57 @@
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
+
12
+ jobs:
13
+ quality:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - name: Checkout akgentic-llm
17
+ uses: actions/checkout@v6
18
+
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v8.1.0
21
+ with:
22
+ version: "latest"
23
+
24
+ - name: Set up Python 3.12
25
+ run: uv python install 3.12
26
+
27
+ - name: Install dependencies
28
+ run: uv sync --extra dev
29
+
30
+ - name: Type checking
31
+ run: uv run mypy src/
32
+
33
+ - name: Linting
34
+ run: uv run ruff check src/
35
+
36
+ - name: Run tests with coverage
37
+ run: >
38
+ uv run pytest tests/
39
+ --cov=akgentic.llm
40
+ --cov-report=term-missing
41
+ --cov-report=json:coverage.json
42
+ --cov-fail-under=80
43
+ env:
44
+ OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
45
+
46
+ - name: Update coverage badge
47
+ if: github.ref_name == 'master' && github.event_name == 'push'
48
+ run: |
49
+ COVERAGE=$(python -c "import json; print(int(json.load(open('coverage.json'))['totals']['percent_covered_display']))")
50
+ if [ "$COVERAGE" -ge 90 ]; then COLOR="brightgreen"
51
+ elif [ "$COVERAGE" -ge 80 ]; then COLOR="green"
52
+ elif [ "$COVERAGE" -ge 70 ]; then COLOR="yellow"
53
+ else COLOR="red"; fi
54
+ echo "{\"schemaVersion\":1,\"label\":\"coverage\",\"message\":\"${COVERAGE}%\",\"color\":\"${COLOR}\"}" > badge.json
55
+ gh gist edit dd80a44fe9e2e27b46f7f3431e19202f -f coverage.json badge.json
56
+ env:
57
+ 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/