An integration package connecting AgbIntegration and LangChain
Project description
langchain-agb-integration
This package contains the LangChain integration with AGB platform, providing tools for file operations, code execution, and command execution within a secure cloud environment.
Installation
pip install -U langchain-agb-integration
You also need to install the agb package to interact with the AGB platform:
pip install -U agb
Configuration
To use the AGB integration, you need to configure your AGB API key as an environment variable:
export AGB_API_KEY="your-api-key"
You can obtain your API key from the AGB platform dashboard.
Tools
The integration provides several tools that allow you to interact with the AGB platform:
WriteFileTool
Write content to a file in the AGB session with either overwrite or append mode.
ReadFileTool
Read content from a file in the AGB session.
RunCodeTool
Execute Python or JavaScript code in a secure cloud environment with configurable timeout.
ExecuteCommandTool
Execute shell commands in the AGB session with timeout control.
Toolkit
The AgbIntegrationToolkit provides all the tools in a single package that can be easily added to LangChain agents:
from agb import AGB
from langchain_agb_integration import AgbIntegrationToolkit
# Create AGB session
agb = AGB()
result = agb.create()
session = result.session
# Create toolkit
toolkit = AgbIntegrationToolkit(session=session)
tools = toolkit.get_tools()
# Use with LangChain agents
from langchain.agents import AgentExecutor, create_tool_calling_agent
agent = create_tool_calling_agent(llm, tools, prompt)
agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True)
Individual Tool Usage
You can also use tools individually:
from agb import AGB
from langchain_agb_integration.tools import WriteFileTool, ReadFileTool, RunCodeTool, ExecuteCommandTool
# Create AGB session
agb = AGB()
result = agb.create()
session = result.session
# Create individual tools
write_tool = WriteFileTool(session=session)
read_tool = ReadFileTool(session=session)
code_tool = RunCodeTool(session=session)
command_tool = ExecuteCommandTool(session=session)
# Use tools
write_tool.invoke({"path": "/tmp/test.txt", "content": "Hello World", "mode": "overwrite"})
read_tool.invoke({"path": "/tmp/test.txt"})
code_tool.invoke({"code": "print('Hello from Python!')", "language": "python"})
command_tool.invoke({"command": "ls -la", "timeout_ms": 1000})
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 langchain_agb_integration-0.1.1.tar.gz.
File metadata
- Download URL: langchain_agb_integration-0.1.1.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.0 CPython/3.12.0 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c818e794364d01e64fd743f65974c9f6778e51fe44142f8c24ea90168d623adc
|
|
| MD5 |
6f903701c4a51f2d978a35a0062c6f58
|
|
| BLAKE2b-256 |
e4806d7ff6f0428577a22c17c628d3201752c846e211c5ac296707560f7f7d06
|
File details
Details for the file langchain_agb_integration-0.1.1-py3-none-any.whl.
File metadata
- Download URL: langchain_agb_integration-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.0 CPython/3.12.0 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dac2e7cd97bcb5cd815b0dc310618b00060420095ff1bf2d00d53c50418d373e
|
|
| MD5 |
5c9d88df80ce87ab3a98ab28d1b8cf58
|
|
| BLAKE2b-256 |
64329d5c89dcd6a21db0fb9e22e8149975005357bd7955112c2a8e8ade8ef04d
|