cronos-agent-wallet 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -97,6 +97,25 @@ Thrown when a request fails or is blocked by policy.
|
|
|
97
97
|
* `HTTP_ERROR`: Server returned an error (details in `err.details`).
|
|
98
98
|
* `err.details`: The raw response body from the server.
|
|
99
99
|
|
|
100
|
+
## 🤝 Integration with AI Frameworks
|
|
101
|
+
|
|
102
|
+
The SDK includes a built-in adapter for LangChain-compatible frameworks (like Cronos AI SDK).
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
import { AgentClient, createPaymentTool } from "@cronos/agent-wallet";
|
|
106
|
+
|
|
107
|
+
// 1. Setup Wallet
|
|
108
|
+
const wallet = new AgentClient({ ...config });
|
|
109
|
+
|
|
110
|
+
// 2. Create Tool
|
|
111
|
+
const paymentTool = createPaymentTool(wallet);
|
|
112
|
+
|
|
113
|
+
// 3. Register with your Agent
|
|
114
|
+
myAgent.registerTool(paymentTool);
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
The tool is named `pay_for_resource`. It allows your LLM to autonomously decide when to pay for premium content.
|
|
118
|
+
|
|
100
119
|
## License
|
|
101
120
|
|
|
102
121
|
MIT
|