Skip to content

Commit

Permalink
Adds chat with RAG deployment task (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
kgrofelnik authored Apr 2, 2024
1 parent 07f0e1e commit 7cc5e1d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {HardhatUserConfig} from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
import "./tasks/whitelist";
import "./tasks/deployChatWithRAG";

require('dotenv').config()

Expand Down
14 changes: 14 additions & 0 deletions contracts/tasks/deployChatWithRAG.ts
Original file line number Diff line number Diff line change
@@ -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}`);
});


0 comments on commit 7cc5e1d

Please sign in to comment.