stackone-ai 0.0.4__tar.gz → 0.3.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.
Files changed (79) hide show
  1. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/.github/workflows/docs.yml +3 -3
  2. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/.github/workflows/lint.yml +3 -3
  3. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/.github/workflows/release.yml +3 -3
  4. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/.github/workflows/test.yml +2 -2
  5. stackone_ai-0.3.1/.mcp.json +12 -0
  6. stackone_ai-0.3.1/.release-please-manifest.json +3 -0
  7. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/CHANGELOG.md +23 -0
  8. stackone_ai-0.3.1/CLAUDE.md +120 -0
  9. stackone_ai-0.3.1/PKG-INFO +184 -0
  10. stackone_ai-0.3.1/README.md +154 -0
  11. stackone_ai-0.3.1/examples/meta_tools_example.py +247 -0
  12. stackone_ai-0.3.1/examples/test_examples.py +85 -0
  13. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/pyproject.toml +8 -1
  14. stackone_ai-0.3.1/stackone_ai/__init__.py +7 -0
  15. stackone_ai-0.3.1/stackone_ai/meta_tools.py +277 -0
  16. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/stackone_ai/models.py +88 -0
  17. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/stackone_ai/toolset.py +2 -2
  18. stackone_ai-0.3.1/tests/test_meta_tools.py +268 -0
  19. stackone_ai-0.3.1/tests/test_tool_calling.py +161 -0
  20. stackone_ai-0.3.1/uv.lock +4038 -0
  21. stackone_ai-0.0.4/.release-please-manifest.json +0 -3
  22. stackone_ai-0.0.4/PKG-INFO +0 -84
  23. stackone_ai-0.0.4/README.md +0 -56
  24. stackone_ai-0.0.4/examples/test_examples.py +0 -39
  25. stackone_ai-0.0.4/stackone_ai/__init__.py +0 -6
  26. stackone_ai-0.0.4/uv.lock +0 -3496
  27. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/.cursor/rules/cursor-rules-location.mdc +0 -0
  28. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/.cursor/rules/examples-standards.mdc +0 -0
  29. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/.cursor/rules/no-relative-imports.mdc +0 -0
  30. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/.cursor/rules/package-installation.mdc +0 -0
  31. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/.cursor/rules/release-please-standards.mdc +0 -0
  32. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/.cursor/rules/uv-scripts.mdc +0 -0
  33. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/.env_example +0 -0
  34. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/.gitignore +0 -0
  35. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/.pre-commit-config.yaml +0 -0
  36. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/.release-please-config.json +0 -0
  37. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/.vscode/settings.json +0 -0
  38. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/LICENSE +0 -0
  39. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/Makefile +0 -0
  40. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/examples/available_tools.py +0 -0
  41. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/examples/crewai_integration.py +0 -0
  42. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/examples/custom_base_url.py +0 -0
  43. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/examples/error_handling.py +0 -0
  44. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/examples/file_uploads.py +0 -0
  45. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/examples/index.py +0 -0
  46. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/examples/langchain_integration.py +0 -0
  47. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/examples/langgraph_tool_node.py +0 -0
  48. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/examples/mcp_server.py +0 -0
  49. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/examples/openai_integration.py +0 -0
  50. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/examples/stackone_account_ids.py +0 -0
  51. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/mkdocs.yml +0 -0
  52. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/py.typed +0 -0
  53. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/scripts/build_docs.py +0 -0
  54. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/scripts/pull_oas.py +0 -0
  55. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/scripts/update_version.py +0 -0
  56. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/stackone_ai/constants.py +0 -0
  57. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/stackone_ai/oas/ats.json +0 -0
  58. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/stackone_ai/oas/core.json +0 -0
  59. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/stackone_ai/oas/crm.json +0 -0
  60. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/stackone_ai/oas/documents.json +0 -0
  61. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/stackone_ai/oas/hris.json +0 -0
  62. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/stackone_ai/oas/iam.json +0 -0
  63. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/stackone_ai/oas/lms.json +0 -0
  64. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/stackone_ai/oas/marketing.json +0 -0
  65. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/stackone_ai/py.typed +0 -0
  66. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/stackone_ai/server.py +0 -0
  67. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/stackone_ai/specs/loader.py +0 -0
  68. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/stackone_ai/specs/parser.py +0 -0
  69. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/tests/snapshots/test_parser/test_parse_all_oas_specs/ats_tools.json +0 -0
  70. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/tests/snapshots/test_parser/test_parse_all_oas_specs/core_tools.json +0 -0
  71. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/tests/snapshots/test_parser/test_parse_all_oas_specs/crm_tools.json +0 -0
  72. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/tests/snapshots/test_parser/test_parse_all_oas_specs/documents_tools.json +0 -0
  73. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/tests/snapshots/test_parser/test_parse_all_oas_specs/hris_tools.json +0 -0
  74. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/tests/snapshots/test_parser/test_parse_all_oas_specs/iam_tools.json +0 -0
  75. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/tests/snapshots/test_parser/test_parse_all_oas_specs/lms_tools.json +0 -0
  76. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/tests/snapshots/test_parser/test_parse_all_oas_specs/marketing_tools.json +0 -0
  77. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/tests/test_models.py +0 -0
  78. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/tests/test_parser.py +0 -0
  79. {stackone_ai-0.0.4 → stackone_ai-0.3.1}/tests/test_toolset.py +0 -0
@@ -12,10 +12,10 @@ jobs:
12
12
  deploy:
13
13
  runs-on: ubuntu-latest
14
14
  steps:
15
- - uses: actions/checkout@v4
15
+ - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
16
16
 
17
17
  - name: Install uv
18
- uses: astral-sh/setup-uv@v4
18
+ uses: astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc # v6.4.3
19
19
  with:
20
20
  python-version: "3.11"
21
21
  enable-cache: true
@@ -30,7 +30,7 @@ jobs:
30
30
 
31
31
  - name: Deploy to GitHub Pages
32
32
  if: github.ref == 'refs/heads/main'
33
- uses: peaceiris/actions-gh-pages@v3
33
+ uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
34
34
  with:
35
35
  github_token: ${{ secrets.GITHUB_TOKEN }}
36
36
  publish_dir: ./site
@@ -9,10 +9,10 @@ jobs:
9
9
  lint:
10
10
  runs-on: ubuntu-latest
11
11
  steps:
12
- - uses: actions/checkout@v4
12
+ - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
13
13
 
14
14
  - name: Install uv
15
- uses: astral-sh/setup-uv@v5
15
+ uses: astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc # v6.4.3
16
16
  with:
17
17
  python-version: "3.11"
18
18
  enable-cache: true
@@ -21,7 +21,7 @@ jobs:
21
21
  run: uv sync --all-extras
22
22
 
23
23
  - name: Run Ruff
24
- uses: astral-sh/ruff-action@v3
24
+ uses: astral-sh/ruff-action@0c50076f12c38c3d0115b7b519b54a91cb9cf0ad # v3.5.0
25
25
  with:
26
26
  args: check .
27
27
 
@@ -13,19 +13,19 @@ jobs:
13
13
  release-please:
14
14
  runs-on: ubuntu-latest
15
15
  steps:
16
- - uses: google-github-actions/release-please-action@v4
16
+ - uses: google-github-actions/release-please-action@e4dc86ba9405554aeba3c6bb2d169500e7d3b4ee # v4.1.1
17
17
  id: release
18
18
  with:
19
19
  config-file: .release-please-config.json
20
20
  manifest-file: .release-please-manifest.json
21
21
 
22
22
  # Only release to PyPI when a new release is created
23
- - uses: actions/checkout@v4
23
+ - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
24
24
  if: ${{ steps.release.outputs.release_created }}
25
25
 
26
26
  - name: Install uv
27
27
  if: ${{ steps.release.outputs.release_created }}
28
- uses: astral-sh/setup-uv@v5
28
+ uses: astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc # v6.4.3
29
29
  with:
30
30
  python-version: "3.11"
31
31
  enable-cache: true
@@ -12,10 +12,10 @@ jobs:
12
12
  STACKONE_API_KEY: ${{ secrets.STACKONE_API_KEY }}
13
13
  OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
14
14
  steps:
15
- - uses: actions/checkout@v4
15
+ - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
16
16
 
17
17
  - name: Install uv
18
- uses: astral-sh/setup-uv@v5
18
+ uses: astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc # v6.4.3
19
19
  with:
20
20
  python-version: "3.11"
21
21
  enable-cache: true
@@ -0,0 +1,12 @@
1
+ {
2
+ "mcpServers": {
3
+ "context7": {
4
+ "type": "http",
5
+ "url": "https://mcp.context7.com/mcp"
6
+ },
7
+ "grep": {
8
+ "type": "http",
9
+ "url": "https://mcp.grep.app"
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.3.1"
3
+ }
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.1](https://github.com/StackOneHQ/stackone-ai-python/compare/stackone-ai-v0.3.0...stackone-ai-v0.3.1) (2025-08-19)
4
+
5
+
6
+ ### Documentation
7
+
8
+ * add comprehensive LangChain integration section to README ([#20](https://github.com/StackOneHQ/stackone-ai-python/issues/20)) ([cbf7f68](https://github.com/StackOneHQ/stackone-ai-python/commit/cbf7f68e889839f9a501ad8f2cd47c468ffff47e))
9
+ * rename meta tools ([#27](https://github.com/StackOneHQ/stackone-ai-python/issues/27)) ([a9ebc03](https://github.com/StackOneHQ/stackone-ai-python/commit/a9ebc032f784863913b28d4ad3850b80bafee5f4))
10
+
11
+ ## [0.3.0](https://github.com/StackOneHQ/stackone-ai-python/compare/stackone-ai-v0.0.4...stackone-ai-v0.3.0) (2025-08-19)
12
+
13
+
14
+ ### Features
15
+
16
+ * add CLAUDE.md for Claude Code guidance ([#15](https://github.com/StackOneHQ/stackone-ai-python/issues/15)) ([ac9fe98](https://github.com/StackOneHQ/stackone-ai-python/commit/ac9fe9857f44c19394654dfcbe23fecc5cf9fbb0))
17
+ * bring Python SDK to feature parity with Node SDK ([#17](https://github.com/StackOneHQ/stackone-ai-python/issues/17)) ([8b6de99](https://github.com/StackOneHQ/stackone-ai-python/commit/8b6de99184227cb7f1580964dc3eae14f8f60fc1))
18
+ * remove automatic STACKONE_ACCOUNT_ID environment variable loading ([#23](https://github.com/StackOneHQ/stackone-ai-python/issues/23)) ([aa0aaf6](https://github.com/StackOneHQ/stackone-ai-python/commit/aa0aaf6d6bf528f8e29def9b008db23cf94b97c7))
19
+ * simplify meta tool function names to match Node SDK ([#19](https://github.com/StackOneHQ/stackone-ai-python/issues/19)) ([4572609](https://github.com/StackOneHQ/stackone-ai-python/commit/4572609a9b85a88fc3067be12f821ec0bc54e769))
20
+
21
+
22
+ ### Miscellaneous Chores
23
+
24
+ * release 0.3.0 ([#24](https://github.com/StackOneHQ/stackone-ai-python/issues/24)) ([beea911](https://github.com/StackOneHQ/stackone-ai-python/commit/beea91165ed2ba3eb5f5ad6ca8656344561b0b43))
25
+
3
26
  ## [0.0.4](https://github.com/StackOneHQ/stackone-ai-python/compare/stackone-ai-v0.0.3...stackone-ai-v0.0.4) (2025-03-05)
4
27
 
5
28
 
@@ -0,0 +1,120 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Cursor Rules
6
+
7
+ - @./.cursor/rules/package-installation
8
+ - @./.cursor/rules/no-relative-imports
9
+ - @./.cursor/rules/uv-scripts
10
+ - @./.cursor/rules/release-please-standards
11
+ - @./.cursor/rules/examples-standards
12
+
13
+ ## Project Overview
14
+
15
+ StackOne AI SDK is a Python library that provides a unified interface for accessing various SaaS tools through AI-friendly APIs. It acts as a bridge between AI applications and multiple SaaS platforms (HRIS, CRM, ATS, LMS, Marketing, etc.) with support for OpenAI, LangChain, CrewAI, and Model Context Protocol (MCP).
16
+
17
+ ## Essential Development Commands
18
+
19
+ ```bash
20
+ # Setup and installation
21
+ make install # Install dependencies and pre-commit hooks
22
+
23
+ # Code quality
24
+ make lint # Run ruff linting
25
+ make lint-fix # Auto-fix linting issues
26
+ make mypy # Run type checking
27
+
28
+ # Testing
29
+ make test # Run all tests
30
+ make test-tools # Run tool-specific tests
31
+ make test-examples # Run example tests
32
+
33
+ # Documentation
34
+ make docs-serve # Build and serve docs locally (http://localhost:8000)
35
+ make docs-build # Build docs for deployment
36
+
37
+ # MCP Development
38
+ make mcp-inspector # Run MCP server inspector for debugging
39
+ ```
40
+
41
+ ## Code Architecture
42
+
43
+ ### Core Components
44
+
45
+ 1. **StackOneToolSet** (`stackone_ai/toolset.py`): Main entry point
46
+ - Handles authentication (API key + optional account ID)
47
+ - Manages tool loading with glob pattern filtering
48
+ - Provides format converters for OpenAI/LangChain
49
+
50
+ 2. **Models** (`stackone_ai/models.py`): Data structures
51
+ - `StackOneTool`: Base class with execution logic
52
+ - `Tools`: Container for managing multiple tools
53
+ - Format converters for different AI frameworks
54
+
55
+ 3. **OpenAPI Parser** (`stackone_ai/specs/parser.py`): Spec conversion
56
+ - Converts OpenAPI specs to tool definitions
57
+ - Handles file upload detection (`format: binary` → `type: file`)
58
+ - Resolves schema references
59
+
60
+ 4. **MCP Server** (`stackone_ai/server.py`): Protocol implementation
61
+ - Async tool execution
62
+ - CLI interface via `stackmcp` command
63
+
64
+ ### OpenAPI Specifications
65
+
66
+ All tool definitions are generated from OpenAPI specs in `stackone_ai/oas/`:
67
+ - `core.json`, `ats.json`, `crm.json`, `documents.json`, `hris.json`, `iam.json`, `lms.json`, `marketing.json`
68
+
69
+ ## Key Development Patterns
70
+
71
+ ### Tool Filtering
72
+ ```python
73
+ # Use glob patterns for tool selection
74
+ tools = StackOneToolSet(include_tools=["hris_*", "!hris_create_*"])
75
+ ```
76
+
77
+ ### Authentication
78
+ ```python
79
+ # Uses environment variables or direct configuration
80
+ toolset = StackOneToolSet(
81
+ api_key="your-api-key", # or STACKONE_API_KEY env var
82
+ account_id="optional-id" # explicit account ID required
83
+ )
84
+ ```
85
+
86
+ ### Type Safety
87
+ - Full type annotations required (Python 3.11+)
88
+ - Strict mypy configuration
89
+ - Use generics for better IDE support
90
+
91
+ ### Testing
92
+ - Snapshot testing for tool parsing (`tests/snapshots/`)
93
+ - Async tests use `pytest-asyncio`
94
+ - Example validation: See @./.cursor/rules/examples-standards
95
+
96
+ ## Important Considerations
97
+
98
+ 1. **Dependencies**: See @./.cursor/rules/package-installation for uv dependency management
99
+ 2. **Pre-commit**: Hooks configured for ruff and mypy - run on all commits
100
+ 3. **Python Version**: Requires Python >=3.11
101
+ 4. **Error Handling**: Custom exceptions (`StackOneError`, `StackOneAPIError`)
102
+ 5. **File Uploads**: Binary parameters auto-detected from OpenAPI specs
103
+ 6. **Context Window**: Tool loading warns when loading all tools (large context)
104
+
105
+ ## Common Tasks
106
+
107
+ ### Adding New SaaS Integration
108
+ 1. Add OpenAPI spec to `stackone_ai/oas/`
109
+ 2. Parser automatically converts to tool definitions
110
+ 3. Test with `make test-tools`
111
+
112
+ ### Modifying Tool Behavior
113
+ - Core execution logic in `StackOneTool.execute()` method
114
+ - HTTP configuration via `ExecuteConfig` class
115
+ - Response handling in `_process_response()`
116
+
117
+ ### Updating Documentation
118
+ - Examples requirements: See @./.cursor/rules/examples-standards
119
+ - Run `make docs-serve` to preview changes
120
+ - MkDocs config in `mkdocs.yml`
@@ -0,0 +1,184 @@
1
+ Metadata-Version: 2.4
2
+ Name: stackone-ai
3
+ Version: 0.3.1
4
+ Summary: agents performing actions on your SaaS
5
+ Author-email: StackOne <support@stackone.com>
6
+ License-File: LICENSE
7
+ Classifier: Development Status :: 4 - Beta
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
13
+ Requires-Python: >=3.11
14
+ Requires-Dist: bm25s>=0.2.2
15
+ Requires-Dist: langchain-core>=0.1.0
16
+ Requires-Dist: mcp[cli]>=1.3.0
17
+ Requires-Dist: numpy>=1.24.0
18
+ Requires-Dist: pydantic>=2.10.6
19
+ Requires-Dist: requests>=2.32.3
20
+ Provides-Extra: docs
21
+ Requires-Dist: mkdocs-terminal>=4.7.0; extra == 'docs'
22
+ Requires-Dist: pygments>=2.12; extra == 'docs'
23
+ Requires-Dist: pymdown-extensions; extra == 'docs'
24
+ Provides-Extra: examples
25
+ Requires-Dist: crewai>=0.102.0; extra == 'examples'
26
+ Requires-Dist: langchain-openai>=0.3.6; extra == 'examples'
27
+ Requires-Dist: openai>=1.63.2; extra == 'examples'
28
+ Requires-Dist: python-dotenv>=1.0.1; extra == 'examples'
29
+ Description-Content-Type: text/markdown
30
+
31
+ # StackOne AI SDK
32
+
33
+ [![PyPI version](https://badge.fury.io/py/stackone-ai.svg)](https://badge.fury.io/py/stackone-ai)
34
+ [![GitHub release (latest by date)](https://img.shields.io/github/v/release/StackOneHQ/stackone-ai-python)](https://github.com/StackOneHQ/stackone-ai-python/releases)
35
+
36
+ StackOne AI provides a unified interface for accessing various SaaS tools through AI-friendly APIs.
37
+
38
+ ## Features
39
+
40
+ - Unified interface for multiple SaaS tools
41
+ - AI-friendly tool descriptions and parameters
42
+ - **Tool Calling**: Direct method calling with `tool.call()` for intuitive usage
43
+ - **Glob Pattern Filtering**: Advanced tool filtering with patterns like `"hris_*"` and exclusions `"!hris_delete_*"`
44
+ - **Meta Tools** (Beta): Dynamic tool discovery and execution based on natural language queries
45
+ - Integration with popular AI frameworks:
46
+ - OpenAI Functions
47
+ - LangChain Tools
48
+ - CrewAI Tools
49
+ - LangGraph Tool Node
50
+
51
+ ## Installation
52
+
53
+ ```bash
54
+ pip install stackone-ai
55
+ ```
56
+
57
+ ## Quick Start
58
+
59
+ ```python
60
+ from stackone_ai import StackOneToolSet
61
+
62
+ # Initialize with API key
63
+ toolset = StackOneToolSet() # Uses STACKONE_API_KEY env var
64
+ # Or explicitly: toolset = StackOneToolSet(api_key="your-api-key")
65
+
66
+ # Get HRIS-related tools with glob patterns
67
+ tools = toolset.get_tools("hris_*", account_id="your-account-id")
68
+ # Exclude certain tools with negative patterns
69
+ tools = toolset.get_tools(["hris_*", "!hris_delete_*"])
70
+
71
+ # Use a specific tool with the new call method
72
+ employee_tool = tools.get_tool("hris_get_employee")
73
+ # Call with keyword arguments
74
+ employee = employee_tool.call(id="employee-id")
75
+ # Or with traditional execute method
76
+ employee = employee_tool.execute({"id": "employee-id"})
77
+ ```
78
+
79
+ ## Integration Examples
80
+
81
+ <details>
82
+ <summary>LangChain Integration</summary>
83
+
84
+ StackOne tools work seamlessly with LangChain, enabling powerful AI agent workflows:
85
+
86
+ ```python
87
+ from langchain_openai import ChatOpenAI
88
+ from stackone_ai import StackOneToolSet
89
+
90
+ # Initialize StackOne tools
91
+ toolset = StackOneToolSet()
92
+ tools = toolset.get_tools("hris_*", account_id="your-account-id")
93
+
94
+ # Convert to LangChain format
95
+ langchain_tools = tools.to_langchain()
96
+
97
+ # Use with LangChain models
98
+ model = ChatOpenAI(model="gpt-4o-mini")
99
+ model_with_tools = model.bind_tools(langchain_tools)
100
+
101
+ # Execute AI-driven tool calls
102
+ response = model_with_tools.invoke("Get employee information for ID: emp123")
103
+
104
+ # Handle tool calls
105
+ for tool_call in response.tool_calls:
106
+ tool = tools.get_tool(tool_call["name"])
107
+ if tool:
108
+ result = tool.execute(tool_call["args"])
109
+ print(f"Result: {result}")
110
+ ```
111
+
112
+ </details>
113
+
114
+ <details>
115
+ <summary>CrewAI Integration</summary>
116
+
117
+ CrewAI uses LangChain tools natively, making integration seamless:
118
+
119
+ ```python
120
+ from crewai import Agent, Crew, Task
121
+ from stackone_ai import StackOneToolSet
122
+
123
+ # Get tools and convert to LangChain format
124
+ toolset = StackOneToolSet()
125
+ tools = toolset.get_tools("hris_*", account_id="your-account-id")
126
+ langchain_tools = tools.to_langchain()
127
+
128
+ # Create CrewAI agent with StackOne tools
129
+ agent = Agent(
130
+ role="HR Manager",
131
+ goal="Analyze employee data and generate insights",
132
+ backstory="Expert in HR analytics and employee management",
133
+ tools=langchain_tools,
134
+ llm="gpt-4o-mini"
135
+ )
136
+
137
+ # Define task and execute
138
+ task = Task(
139
+ description="Find all employees in the engineering department",
140
+ agent=agent,
141
+ expected_output="List of engineering employees with their details"
142
+ )
143
+
144
+ crew = Crew(agents=[agent], tasks=[task])
145
+ result = crew.kickoff()
146
+ ```
147
+
148
+ </details>
149
+
150
+ ## Meta Tools (Beta)
151
+
152
+ Meta tools enable dynamic tool discovery and execution without hardcoding tool names:
153
+
154
+ ```python
155
+ # Get meta tools for dynamic discovery
156
+ tools = toolset.get_tools("hris_*")
157
+ meta_tools = tools.meta_tools()
158
+
159
+ # Search for relevant tools using natural language
160
+ filter_tool = meta_tools.get_tool("meta_search_tools")
161
+ results = filter_tool.call(query="manage employees", limit=5)
162
+
163
+ # Execute discovered tools dynamically
164
+ execute_tool = meta_tools.get_tool("meta_execute_tool")
165
+ result = execute_tool.call(toolName="hris_list_employees", params={"limit": 10})
166
+ ```
167
+
168
+ ## Examples
169
+
170
+ For more examples, check out the [examples/](examples/) directory:
171
+
172
+ - [Error Handling](examples/error_handling.py)
173
+ - [StackOne Account IDs](examples/stackone_account_ids.py)
174
+ - [Available Tools](examples/available_tools.py)
175
+ - [File Uploads](examples/file_uploads.py)
176
+ - [OpenAI Integration](examples/openai_integration.py)
177
+ - [LangChain Integration](examples/langchain_integration.py)
178
+ - [CrewAI Integration](examples/crewai_integration.py)
179
+ - [LangGraph Tool Node](examples/langgraph_tool_node.py)
180
+ - [Meta Tools](examples/meta_tools_example.py)
181
+
182
+ ## License
183
+
184
+ Apache 2.0 License
@@ -0,0 +1,154 @@
1
+ # StackOne AI SDK
2
+
3
+ [![PyPI version](https://badge.fury.io/py/stackone-ai.svg)](https://badge.fury.io/py/stackone-ai)
4
+ [![GitHub release (latest by date)](https://img.shields.io/github/v/release/StackOneHQ/stackone-ai-python)](https://github.com/StackOneHQ/stackone-ai-python/releases)
5
+
6
+ StackOne AI provides a unified interface for accessing various SaaS tools through AI-friendly APIs.
7
+
8
+ ## Features
9
+
10
+ - Unified interface for multiple SaaS tools
11
+ - AI-friendly tool descriptions and parameters
12
+ - **Tool Calling**: Direct method calling with `tool.call()` for intuitive usage
13
+ - **Glob Pattern Filtering**: Advanced tool filtering with patterns like `"hris_*"` and exclusions `"!hris_delete_*"`
14
+ - **Meta Tools** (Beta): Dynamic tool discovery and execution based on natural language queries
15
+ - Integration with popular AI frameworks:
16
+ - OpenAI Functions
17
+ - LangChain Tools
18
+ - CrewAI Tools
19
+ - LangGraph Tool Node
20
+
21
+ ## Installation
22
+
23
+ ```bash
24
+ pip install stackone-ai
25
+ ```
26
+
27
+ ## Quick Start
28
+
29
+ ```python
30
+ from stackone_ai import StackOneToolSet
31
+
32
+ # Initialize with API key
33
+ toolset = StackOneToolSet() # Uses STACKONE_API_KEY env var
34
+ # Or explicitly: toolset = StackOneToolSet(api_key="your-api-key")
35
+
36
+ # Get HRIS-related tools with glob patterns
37
+ tools = toolset.get_tools("hris_*", account_id="your-account-id")
38
+ # Exclude certain tools with negative patterns
39
+ tools = toolset.get_tools(["hris_*", "!hris_delete_*"])
40
+
41
+ # Use a specific tool with the new call method
42
+ employee_tool = tools.get_tool("hris_get_employee")
43
+ # Call with keyword arguments
44
+ employee = employee_tool.call(id="employee-id")
45
+ # Or with traditional execute method
46
+ employee = employee_tool.execute({"id": "employee-id"})
47
+ ```
48
+
49
+ ## Integration Examples
50
+
51
+ <details>
52
+ <summary>LangChain Integration</summary>
53
+
54
+ StackOne tools work seamlessly with LangChain, enabling powerful AI agent workflows:
55
+
56
+ ```python
57
+ from langchain_openai import ChatOpenAI
58
+ from stackone_ai import StackOneToolSet
59
+
60
+ # Initialize StackOne tools
61
+ toolset = StackOneToolSet()
62
+ tools = toolset.get_tools("hris_*", account_id="your-account-id")
63
+
64
+ # Convert to LangChain format
65
+ langchain_tools = tools.to_langchain()
66
+
67
+ # Use with LangChain models
68
+ model = ChatOpenAI(model="gpt-4o-mini")
69
+ model_with_tools = model.bind_tools(langchain_tools)
70
+
71
+ # Execute AI-driven tool calls
72
+ response = model_with_tools.invoke("Get employee information for ID: emp123")
73
+
74
+ # Handle tool calls
75
+ for tool_call in response.tool_calls:
76
+ tool = tools.get_tool(tool_call["name"])
77
+ if tool:
78
+ result = tool.execute(tool_call["args"])
79
+ print(f"Result: {result}")
80
+ ```
81
+
82
+ </details>
83
+
84
+ <details>
85
+ <summary>CrewAI Integration</summary>
86
+
87
+ CrewAI uses LangChain tools natively, making integration seamless:
88
+
89
+ ```python
90
+ from crewai import Agent, Crew, Task
91
+ from stackone_ai import StackOneToolSet
92
+
93
+ # Get tools and convert to LangChain format
94
+ toolset = StackOneToolSet()
95
+ tools = toolset.get_tools("hris_*", account_id="your-account-id")
96
+ langchain_tools = tools.to_langchain()
97
+
98
+ # Create CrewAI agent with StackOne tools
99
+ agent = Agent(
100
+ role="HR Manager",
101
+ goal="Analyze employee data and generate insights",
102
+ backstory="Expert in HR analytics and employee management",
103
+ tools=langchain_tools,
104
+ llm="gpt-4o-mini"
105
+ )
106
+
107
+ # Define task and execute
108
+ task = Task(
109
+ description="Find all employees in the engineering department",
110
+ agent=agent,
111
+ expected_output="List of engineering employees with their details"
112
+ )
113
+
114
+ crew = Crew(agents=[agent], tasks=[task])
115
+ result = crew.kickoff()
116
+ ```
117
+
118
+ </details>
119
+
120
+ ## Meta Tools (Beta)
121
+
122
+ Meta tools enable dynamic tool discovery and execution without hardcoding tool names:
123
+
124
+ ```python
125
+ # Get meta tools for dynamic discovery
126
+ tools = toolset.get_tools("hris_*")
127
+ meta_tools = tools.meta_tools()
128
+
129
+ # Search for relevant tools using natural language
130
+ filter_tool = meta_tools.get_tool("meta_search_tools")
131
+ results = filter_tool.call(query="manage employees", limit=5)
132
+
133
+ # Execute discovered tools dynamically
134
+ execute_tool = meta_tools.get_tool("meta_execute_tool")
135
+ result = execute_tool.call(toolName="hris_list_employees", params={"limit": 10})
136
+ ```
137
+
138
+ ## Examples
139
+
140
+ For more examples, check out the [examples/](examples/) directory:
141
+
142
+ - [Error Handling](examples/error_handling.py)
143
+ - [StackOne Account IDs](examples/stackone_account_ids.py)
144
+ - [Available Tools](examples/available_tools.py)
145
+ - [File Uploads](examples/file_uploads.py)
146
+ - [OpenAI Integration](examples/openai_integration.py)
147
+ - [LangChain Integration](examples/langchain_integration.py)
148
+ - [CrewAI Integration](examples/crewai_integration.py)
149
+ - [LangGraph Tool Node](examples/langgraph_tool_node.py)
150
+ - [Meta Tools](examples/meta_tools_example.py)
151
+
152
+ ## License
153
+
154
+ Apache 2.0 License