From eafa75c6d9737fe91909b4cf7d4b92d0c7a2b1e9 Mon Sep 17 00:00:00 2001 From: kgrofelnik Date: Fri, 5 Jul 2024 14:14:01 +0200 Subject: [PATCH] Adds system prompt as constructor arg --- contracts/contracts/AiTownAgent.sol | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/contracts/contracts/AiTownAgent.sol b/contracts/contracts/AiTownAgent.sol index 258c1a1..016568d 100644 --- a/contracts/contracts/AiTownAgent.sol +++ b/contracts/contracts/AiTownAgent.sol @@ -29,14 +29,18 @@ contract AiTownAgent { // @notice Address of the oracle contract address public oracleAddress; + // @notice System prompt for the agent + string public systemPrompt; + // @notice Event emitted when the oracle address is updated event OracleAddressUpdated(address indexed newOracleAddress); // @param initialOracleAddress Initial address of the oracle contract // @param systemPrompt System prompt for the run - constructor(address initialOracleAddress) { + constructor(address initialOracleAddress, string memory _systemPrompt) { owner = msg.sender; oracleAddress = initialOracleAddress; + systemPrompt = _systemPrompt; } // @notice Ensures the caller is the contract owner @@ -56,7 +60,7 @@ contract AiTownAgent { emit OracleAddressUpdated(newOracleAddress); } - function startChat(string memory conversationId, string memory systemPrompt, string memory message) public returns (uint) { + function startChat(string memory conversationId, string memory message) public returns (uint) { ChatRun storage run = chatRuns[chatRunsCount]; conversationIdToChatRun[conversationId] = chatRunsCount; run.owner = msg.sender;