Skip to content

Commit cbf7f68

Browse files
ryoppippiglebedel
andauthored
docs: add comprehensive LangChain integration section to README (#20)
* docs: add comprehensive LangChain integration section to README - Add detailed LangChain integration examples showing tool conversion and usage - Include CrewAI integration section demonstrating LangChain compatibility - Provide practical code examples for model binding and tool execution - Position section after Meta Tools for logical flow * docs: move Features section above examples for better structure - Relocated Features section to appear after Quick Start but before detailed examples - Improves README flow by highlighting key features early - Maintains logical progression from installation -> features -> examples * docs: restructure README sections and fix documentation links - Move Features section immediately after project overview - Restructure LangChain and CrewAI integrations into collapsible Integration Examples section - Reorder Meta Tools section to appear after Integration Examples - Replace broken docs/ links with working examples/ directory links - Consolidate documentation sections into single Examples section * docs: add PyPI and GitHub release badges to README - Add PyPI version badge linking to package page - Add GitHub release badge showing latest version - Improve README visual appeal and provide quick access to version info --------- Co-authored-by: Guillaume <[email protected]>
1 parent 8a87462 commit cbf7f68

File tree

1 file changed

+98
-26
lines changed

1 file changed

+98
-26
lines changed

README.md

Lines changed: 98 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
11
# StackOne AI SDK
22

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+
36
StackOne AI provides a unified interface for accessing various SaaS tools through AI-friendly APIs.
47

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+
521
## Installation
622

723
```bash
@@ -30,6 +46,77 @@ employee = employee_tool.call(id="employee-id")
3046
employee = employee_tool.execute({"id": "employee-id"})
3147
```
3248

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+
33120
## Meta Tools (Beta)
34121

35122
Meta tools enable dynamic tool discovery and execution without hardcoding tool names:
@@ -48,34 +135,19 @@ execute_tool = meta_tools.get_tool("meta_execute_tool")
48135
result = execute_tool.call(toolName="hris_list_employees", params={"limit": 10})
49136
```
50137

51-
## Features
52-
53-
- Unified interface for multiple SaaS tools
54-
- AI-friendly tool descriptions and parameters
55-
- **Tool Calling**: Direct method calling with `tool.call()` for intuitive usage
56-
- **Glob Pattern Filtering**: Advanced tool filtering with patterns like `"hris_*"` and exclusions `"!hris_delete_*"`
57-
- **Meta Tools** (Beta): Dynamic tool discovery and execution based on natural language queries
58-
- Integration with popular AI frameworks:
59-
- OpenAI Functions
60-
- LangChain Tools
61-
- CrewAI Tools
62-
- LangGraph Tool Node
63-
64-
## Documentation
65-
66-
For more examples and documentation, visit:
67-
68-
- [Error Handling](docs/error-handling.md)
69-
- [StackOne Account IDs](docs/stackone-account-ids.md)
70-
- [Available Tools](docs/available-tools.md)
71-
- [File Uploads](docs/file-uploads.md)
138+
## Examples
72139

73-
## AI Framework Integration
140+
For more examples, check out the [examples/](examples/) directory:
74141

75-
- [OpenAI Integration](docs/openai-integration.md)
76-
- [LangChain Integration](docs/langchain-integration.md)
77-
- [CrewAI Integration](docs/crewai-integration.md)
78-
- [LangGraph Tool Node](docs/langgraph-tool-node.md)
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)
79151

80152
## License
81153

0 commit comments

Comments
 (0)