Core base classes for Crypto.com Developer Platform tools
Project description
cryptocom-tools-core
Core base classes for Crypto.com Developer Platform tools.
Installation
pip install cryptocom-tools-core
Usage
from cryptocom_tools_core import CDPTool, BalanceResult
from pydantic import BaseModel, Field
class GetBalanceInput(BaseModel):
address: str = Field(description="Wallet address")
class GetBalanceTool(CDPTool):
name: str = "get_balance"
description: str = "Get native token balance"
args_schema: type[BaseModel] = GetBalanceInput
def _run(self, address: str) -> str:
# Your implementation
return str(BalanceResult(address=address, balance="100", unit="CRO"))
# Use with LangChain
tool = GetBalanceTool(api_key="your-api-key")
# Or export to OpenAI/Anthropic via adapters
from cryptocom_tool_adapters import to_openai_function
openai_tool = to_openai_function(tool)
Exports
CDPTool- Base class extending LangChain BaseTool with CDP API key injectionToolResult- Base class for structured tool outputsBalanceResult- Result type for balance queriesTransactionResult- Result type for transaction queriesTickerResult- Result type for exchange ticker queries
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
File details
Details for the file cryptocom_tools_core-2.0.0.tar.gz.
File metadata
- Download URL: cryptocom_tools_core-2.0.0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbb0492245548a8f387f517e7590f2a9f7f89e5247c5b87684325ffbbbe413f5
|
|
| MD5 |
c75d9b7610aee1269513a1e98053bc1c
|
|
| BLAKE2b-256 |
588566f7062492100ace404904aa23ea4d5fdcc0597e025426f7b1d6dceebed9
|