Class representing a document loader for loading data from the SortXYZ blockchain using the SortXYZ API.

Example

const blockchainLoader = new SortXYZBlockchainLoader({
apiKey: "YOUR_SORTXYZ_API_KEY",
query: {
type: "NFTMetadata",
blockchain: "ethereum",
contractAddress: "0x887F3909C14DAbd9e9510128cA6cBb448E932d7f".toLowerCase(),
},
});

const blockchainData = await blockchainLoader.load();

const prompt =
"Describe the character with the attributes from the following json document in a 4 sentence story. ";
const model = new ChatOpenAI({ temperature: 0.9 })
const response = await model.invoke(
prompt + JSON.stringify(blockchainData[0], null, 2),
);
console.log(`user > ${prompt}`);
console.log(`chatgpt > ${response}`);

Hierarchy

Constructors

Properties

apiKey: string
blockchain: string
contractAddress: string
limit: number
queryType: string
sql: string

Methods

Generated using TypeDoc