agents performing actions on your SaaS
Project description
StackOne AI SDK
StackOne AI provides a unified interface for accessing various SaaS tools through AI-friendly APIs.
Features
- Unified interface for multiple SaaS tools
- AI-friendly tool descriptions and parameters
- Tool Calling: Direct method calling with
tool.call()for intuitive usage - Glob Pattern Filtering: Advanced tool filtering with patterns like
"hris_*"and exclusions"!hris_delete_*" - Meta Tools (Beta): Dynamic tool discovery and execution based on natural language queries
- Integration with popular AI frameworks:
- OpenAI Functions
- LangChain Tools
- CrewAI Tools
- LangGraph Tool Node
Installation
pip install stackone-ai
Quick Start
from stackone_ai import StackOneToolSet
# Initialize with API key
toolset = StackOneToolSet() # Uses STACKONE_API_KEY env var
# Or explicitly: toolset = StackOneToolSet(api_key="your-api-key")
# Get HRIS-related tools with glob patterns
tools = toolset.get_tools("hris_*", account_id="your-account-id")
# Exclude certain tools with negative patterns
tools = toolset.get_tools(["hris_*", "!hris_delete_*"])
# Use a specific tool with the new call method
employee_tool = tools.get_tool("hris_get_employee")
# Call with keyword arguments
employee = employee_tool.call(id="employee-id")
# Or with traditional execute method
employee = employee_tool.execute({"id": "employee-id"})
Integration Examples
LangChain Integration
StackOne tools work seamlessly with LangChain, enabling powerful AI agent workflows:
from langchain_openai import ChatOpenAI
from stackone_ai import StackOneToolSet
# Initialize StackOne tools
toolset = StackOneToolSet()
tools = toolset.get_tools("hris_*", account_id="your-account-id")
# Convert to LangChain format
langchain_tools = tools.to_langchain()
# Use with LangChain models
model = ChatOpenAI(model="gpt-4o-mini")
model_with_tools = model.bind_tools(langchain_tools)
# Execute AI-driven tool calls
response = model_with_tools.invoke("Get employee information for ID: emp123")
# Handle tool calls
for tool_call in response.tool_calls:
tool = tools.get_tool(tool_call["name"])
if tool:
result = tool.execute(tool_call["args"])
print(f"Result: {result}")
CrewAI Integration
CrewAI uses LangChain tools natively, making integration seamless:
from crewai import Agent, Crew, Task
from stackone_ai import StackOneToolSet
# Get tools and convert to LangChain format
toolset = StackOneToolSet()
tools = toolset.get_tools("hris_*", account_id="your-account-id")
langchain_tools = tools.to_langchain()
# Create CrewAI agent with StackOne tools
agent = Agent(
role="HR Manager",
goal="Analyze employee data and generate insights",
backstory="Expert in HR analytics and employee management",
tools=langchain_tools,
llm="gpt-4o-mini"
)
# Define task and execute
task = Task(
description="Find all employees in the engineering department",
agent=agent,
expected_output="List of engineering employees with their details"
)
crew = Crew(agents=[agent], tasks=[task])
result = crew.kickoff()
Meta Tools (Beta)
Meta tools enable dynamic tool discovery and execution without hardcoding tool names:
# Get meta tools for dynamic discovery
tools = toolset.get_tools("hris_*")
meta_tools = tools.meta_tools()
# Search for relevant tools using natural language
filter_tool = meta_tools.get_tool("meta_search_tools")
results = filter_tool.call(query="manage employees", limit=5)
# Execute discovered tools dynamically
execute_tool = meta_tools.get_tool("meta_execute_tool")
result = execute_tool.call(toolName="hris_list_employees", params={"limit": 10})
Examples
For more examples, check out the examples/ directory:
- Error Handling
- StackOne Account IDs
- Available Tools
- File Uploads
- OpenAI Integration
- LangChain Integration
- CrewAI Integration
- LangGraph Tool Node
- Meta Tools
License
Apache 2.0 License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stackone_ai-0.3.1.tar.gz.
File metadata
- Download URL: stackone_ai-0.3.1.tar.gz
- Upload date:
- Size: 525.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f678f36171af0f43d748cfcfc4c9f41a3d781ca2f670934b017964995978ae08
|
|
| MD5 |
1519b71bd7fb6614bb4fd1b84acf62d6
|
|
| BLAKE2b-256 |
795ca7ddc0895640c4aa80b3d82dc67e798f4136d54c8a704aa2bd1c7091668b
|
File details
Details for the file stackone_ai-0.3.1-py3-none-any.whl.
File metadata
- Download URL: stackone_ai-0.3.1-py3-none-any.whl
- Upload date:
- Size: 136.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
760651cf2a12ac77c135bdcd63e215b51dce44476f5937c70794f2fc74ce090d
|
|
| MD5 |
823d271b62501e63a80bed1a2a36af0f
|
|
| BLAKE2b-256 |
8166fa1f6d295665973aef2d3a8155ae1601245b50eee953f216bb21c01509fe
|