Skip to content

Commit ebac59e

Browse files
authored
Add storage implementation and update README + version (#22)
* add initial Storage implementation * combine json upload and any filetype * read files async and stream upload, support directories * gateway_hostname in constructor, remove chunk_size tool, upload data if not a file * fix gateway_url * add storage to __init__.py * update to include information about storage * bump versions for new storage implementation --------- Signed-off-by: Cillian Berragan <[email protected]>
1 parent 5d466ee commit ebac59e

File tree

5 files changed

+24
-6
lines changed

5 files changed

+24
-6
lines changed

README.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ _AI Agents with Onchain Intelligence_
44

55
## 📖 Overview
66

7-
thirdweb AI is thirdweb's comprehensive toolkit for blockchain data analysis, wallet management, and AI agent interaction with blockchains. It simplifies complex blockchain operations into three core components: Insight for data analysis, Engine for wallet and contract operations, and Nebula for natural language-powered blockchain interactions.
7+
thirdweb AI is thirdweb's comprehensive toolkit for blockchain data analysis, wallet management, and AI agent interaction with blockchains. It simplifies complex blockchain operations into four core components: Insight for data analysis, Engine for wallet and contract operations, Storage for decentralized file management, and Nebula for natural language-powered blockchain interactions.
88

99
## 🌐 Features
1010

@@ -23,6 +23,11 @@ Core blockchain interaction capabilities:
2323
- **Read**: Read operations for smart contracts and blockchain data
2424
- **Write**: Transaction creation and contract interaction
2525

26+
### Storage
27+
Decentralized storage capabilities:
28+
- **Upload**: Upload files, directories, and JSON data to IPFS
29+
- **Fetch**: Retrieve content from IPFS using thirdweb gateway
30+
2631
### Nebula
2732
AI agent blockchain interaction:
2833
- **Natural Language Agent Action**: Completing blockchain tasks through natural language instructions
@@ -68,18 +73,20 @@ See the list of [supported framework and installation guides](python/thirdweb-ai
6873
#### Basic Usage
6974

7075
```python
71-
from thirdweb_ai import Engine, Insight, Nebula, Tool
76+
from thirdweb_ai import Engine, Insight, Nebula, Storage, Tool
7277

7378
# Initialize services
7479
insight = Insight(secret_key=...)
7580
nebula = Nebula(secret_key=...)
7681
engine = Engine(...)
82+
storage = Storage(secret_key=...)
7783

7884
# Example: Create tools for AI agents
7985
tools = [
8086
*insight.get_tools(),
8187
*nebula.get_tools(),
8288
*engine.get_tools(),
89+
*storage.get_tools(),
8390
# Or pick an individual tool from the services
8491
]
8592

python/thirdweb-ai/README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ With thirdweb-ai, your AI agents can:
1212
- Deploy and interact with smart contracts
1313
- Manage wallets and transactions
1414
- Retrieve on-chain data
15+
- Store and retrieve data on decentralized storage (IPFS)
1516
- Access thirdweb's suite of web3 services
1617

1718
## Installation
@@ -48,12 +49,13 @@ pip install "thirdweb-ai[pydantic-ai]" # For Pydantic AI
4849
thirdweb-ai provides a set of tools that can be integrated with various AI agent frameworks. Here's a basic example:
4950

5051
```python
51-
from thirdweb_ai import Engine, Insight, Nebula, Tool
52+
from thirdweb_ai import Engine, Insight, Nebula, Storage, Tool
5253

5354
# Initialize thirdweb services
5455
insight = Insight(secret_key=...)
5556
nebula = Nebula(secret_key=...)
5657
engine = Engine(secret_key=...)
58+
storage = Storage(secret_key=...)
5759

5860
# Get available tools
5961
tools = [
@@ -62,6 +64,7 @@ tools = [
6264
*insight.get_tools(),
6365
*nebula.get_tools(),
6466
*engine.get_tools(),
67+
*storage.get_tools(),
6568
# Or pick an individual tool from the services
6669
]
6770
```

python/thirdweb-ai/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "thirdweb-ai"
3-
version = "0.1.7"
3+
version = "0.1.8"
44
description = "thirdweb AI"
55
authors = [{ name = "thirdweb", email = "[email protected]" }]
66
requires-python = ">=3.10,<4.0"

python/thirdweb-mcp/README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ thirdweb MCP provides a unified interface to access thirdweb's suite of blockcha
99
- **Nebula**: Autonomous onchain execution - real-time on-chain analysis, code generation and contract interactions
1010
- **Insight**: Blockchain data analysis capabilities for real-time on-chain data
1111
- **Engine**: Integration with thirdweb's backend infrastructure for contract deployments and interactions
12+
- **Storage**: Decentralized storage capabilities for uploading and retrieving data via IPFS
1213

1314
## Installation
1415

@@ -44,7 +45,7 @@ uv sync
4445

4546
The thirdweb MCP server requires configuration based on which services you want to enable:
4647

47-
1. **thirdweb Secret Key**: Required for Nebula and Insight services. Obtain from the [thirdweb dashboard](https://thirdweb.com/dashboard).
48+
1. **thirdweb Secret Key**: Required for Nebula, Insight, and Storage services. Obtain from the [thirdweb dashboard](https://thirdweb.com/dashboard).
4849
2. **Chain IDs**: Blockchain network IDs to connect to (e.g., 1 for Ethereum mainnet, 137 for Polygon).
4950
3. **Engine Configuration**: If using the Engine service, you'll need the Engine URL and authentication JWT.
5051

@@ -141,6 +142,13 @@ Integrates with thirdweb's backend infrastructure:
141142
- Interact with deployed contracts
142143
- Manage wallet connections and transactions
143144

145+
### Storage
146+
147+
Provides decentralized storage functionality:
148+
- Upload files, directories, and JSON data to IPFS
149+
- Retrieve content from IPFS using thirdweb gateway
150+
- Preserve directory structures when uploading
151+
144152
## License
145153

146154
[Apache-2.0 License](LICENSE)

python/thirdweb-mcp/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "thirdweb-mcp"
3-
version = "0.1.10"
3+
version = "0.1.11"
44
description = "thirdweb MCP"
55
authors = [{ name = "thirdweb", email = "[email protected]" }]
66
requires-python = "~=3.10"

0 commit comments

Comments
 (0)