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})
Metadata
Release files for langchain-agb-integration 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| langchain_agb_integration-0.1.1.tar.gz | 4.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_agb_integration-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.0 kB
Release files / langchain_agb_integration-0.1.1.tar.gz
| Download URL | langchain_agb_integration-0.1.1.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c818e794364d01e64fd743f65974c9f6778e51fe44142f8c24ea90168d623adc
|
|
BLAKE2b-256 checksum How to use checksums |
e4806d7ff6f0428577a22c17c628d3201752c846e211c5ac296707560f7f7d06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.0 CPython/3.12.0 Darwin/24.6.0
|
Release files / langchain_agb_integration-0.1.1-py3-none-any.whl
| Download URL | langchain_agb_integration-0.1.1-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dac2e7cd97bcb5cd815b0dc310618b00060420095ff1bf2d00d53c50418d373e
|
|
BLAKE2b-256 checksum How to use checksums |
64329d5c89dcd6a21db0fb9e22e8149975005357bd7955112c2a8e8ade8ef04d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.0 CPython/3.12.0 Darwin/24.6.0
|