Near 区块链
概览
此笔记本的意图是提供一种测试Langchain 文档加载器(用于Near区块链)功能性的方法。
起初,此加载器支持:
- 加载来自NFT智能合约(NEP-171和NEP-177)的NFT作为文档
- 以下是翻译后的HTML内容,保持了原始的HTML结构和标签名称不变。
- Mintbase的Graph API
如果社区认为这个加载器有价值,那么它可以扩展。具体来说:
- 可以添加其他API(例如交易相关的API)
此文档加载器需要:
- 一个免费的 Mintbase API密钥
The output takes the following format:
- pageContent= 单个NFT
- metadata={'source': 'nft.yearofchef.near', 'blockchain': 'mainnet', 'tokenId': '1846'}
加载NFT到文档加载器
# get MINTBASE_API_KEY from https://docs.mintbase.xyz/dev/mintbase-graph/
mintbaseApiKey = "..."
Option 1: Ethereum 主网(默认区块链类型)
from MintbaseLoader import MintbaseDocumentLoader
contractAddress = "nft.yearofchef.near" # Year of chef contract address
blockchainLoader = MintbaseDocumentLoader(
contract_address=contractAddress, blockchain_type="mainnet", api_key="omni-site"
)
nfts = blockchainLoader.load()
print(nfts[:1])
for doc in blockchainLoader.lazy_load():
print()
print(type(doc))
print(doc)