-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.py
More file actions
105 lines (70 loc) · 2.19 KB
/
index.py
File metadata and controls
105 lines (70 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
"""
StackOne AI SDK provides an AI-friendly interface for accessing various SaaS tools through the StackOne API.
This SDK is available on [PyPI](https://pypi.org/project/stackone-ai/) for python projects. There is a node version in the works.
# Installation
```bash
# Using uv
uv add stackone-ai
# Using pip
pip install stackone-ai
```
# How to use these docs
All examples are complete and runnable.
We use [uv](https://docs.astral.sh/uv/getting-started/installation/) for easy python dependency management.
Install uv:
```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
```
To run this example, clone the repo, install the dependencies (one-time setup) and run the script:
```bash
git clone https://github.com/stackoneHQ/stackone-ai-python.git
cd stackone-ai-python
# Install dependencies
uv sync --all-extras
# Run the example
uv run examples/index.py
```
# Authentication
Set the `STACKONE_API_KEY` environment variable:
```bash
export STACKONE_API_KEY=<your-api-key>
```
or load from a .env file:
"""
from dotenv import load_dotenv
load_dotenv()
"""
# Account IDs
StackOne uses account IDs to identify different integrations.
See the example [stackone-account-ids.md](stackone-account-ids.md) for more details.
This example will hardcode the account ID:
"""
account_id = "45072196112816593343"
"""
# Quickstart
"""
from stackone_ai import StackOneToolSet
def quickstart():
toolset = StackOneToolSet()
# Get all BambooHR-related tools using MCP-backed fetch_tools()
tools = toolset.fetch_tools(actions=["bamboohr_*"], account_ids=[account_id])
# Use a specific tool
employee_tool = tools.get_tool("bamboohr_list_employees")
assert employee_tool is not None
employees = employee_tool.execute()
assert employees is not None
if __name__ == "__main__":
quickstart()
"""
# Next Steps
Check out some more documentation:
- [StackOne Account IDs](stackone-account-ids.md)
- [Error Handling](error-handling.md)
- [Available Tools](available-tools.md)
- [File Uploads](file-uploads.md)
Or get started with an integration:
- [OpenAI](openai-integration.md)
- [LangChain](langchain-integration.md)
- [CrewAI](crewai-integration.md)
- [LangGraph](langgraph-tool-node.md)
"""