Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds chat with RAG deployment task #54

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}`);
});


Loading