-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.py
More file actions
91 lines (61 loc) · 1.83 KB
/
index.py
File metadata and controls
91 lines (61 loc) · 1.83 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
"""
StackOne AI provides a unified interface for accessing various SaaS tools through AI-friendly APIs.
## Installation
```bash
# Using pip
pip install stackone-ai
# Using uv
uv add 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 python dependency management.
To run this example, install the dependencies (one-time setup) and run the script:
```bash
uv sync --all-extras
uv run examples/index.py
```
## Package Usage
"""
from stackone_ai import StackOneToolSet
"""
## 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"
def quickstart():
toolset = StackOneToolSet()
# Get all HRIS-related tools
tools = toolset.get_tools("hris_*", account_id=account_id)
# Use a specific tool
employee_tool = tools.get_tool("hris_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 Integration](openai-integration.md)
- [LangChain Integration](langchain-integration.md)
- [CrewAI Integration](crewai-integration.md)
- [LangGraph Tool Node](langgraph-tool-node.md)
"""