Skip to main content

Step 4: Interact verifiably using a contract

You can interact with ollama2 enclave using contracts as well. A request can be sent to the following function of the relayer contract deployer at 0x5343579EB412f0F6CFb57c4E4f8567c3c5896076 which returns the requestId

interface IRelay {
function createRequest(
string memory modelName,
string memory prompt,
string memory request_context
) external returns(uint256 requestId);
}

A offchain component of relayer, relays the request to the ollama2 enclave and submits response along with signature from enclave to the relay contract. The response can be queried onchain using the following function

function requests(uint256 requestId) external view returns(
string modelName;
string prompt;
string request_context;
uint64 timestamp;
string response;
string response_context;
bytes sig;
)