diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index c08cda5..8c6981c 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -1,6 +1,7 @@ import {HardhatUserConfig} from "hardhat/config"; import "@nomicfoundation/hardhat-toolbox"; import "./tasks/whitelist"; +import "./tasks/deployChatWithRAG"; require('dotenv').config() diff --git a/contracts/tasks/deployChatWithRAG.ts b/contracts/tasks/deployChatWithRAG.ts new file mode 100644 index 0000000..05b3853 --- /dev/null +++ b/contracts/tasks/deployChatWithRAG.ts @@ -0,0 +1,14 @@ +import { task } from "hardhat/config"; + +task("deployChatWithRAG", "Deploys the chat contract with knowledge base") + .addParam("oracleAddress", "The address of the Oracle contract") + .addParam("cid", "Knowledge base CID") + .setAction(async (taskArgs, hre) => { + const oracleAddress = taskArgs.oracleAddress; + const knowledgeBaseCID = taskArgs.cid; + const contract = await hre.ethers.deployContract("ChatGpt", [oracleAddress, knowledgeBaseCID], {}); + await contract.waitForDeployment(); + console.log(`RAG deployed to: ${contract.target}`); + }); + +