From 5e8ccecd72d215c2b97c107551460b6bfcff6a2c Mon Sep 17 00:00:00 2001 From: kgrofelnik Date: Tue, 2 Jul 2024 15:04:08 +0200 Subject: [PATCH] Updates `examples` ABIs --- contracts/contracts/AnthropicSimpleLLM.sol | 6 +- examples/abis/Agent.json | 53 +++---- examples/abis/ChatGpt.json | 156 ++++----------------- 3 files changed, 64 insertions(+), 151 deletions(-) diff --git a/contracts/contracts/AnthropicSimpleLLM.sol b/contracts/contracts/AnthropicSimpleLLM.sol index 5df343d..11df071 100644 --- a/contracts/contracts/AnthropicSimpleLLM.sol +++ b/contracts/contracts/AnthropicSimpleLLM.sol @@ -5,13 +5,15 @@ pragma solidity ^0.8.13; import "./interfaces/IOracle.sol"; contract SimpleLLM { - address private oracleAddress = 0x68EC9556830AD097D661Df2557FBCeC166a0A075; // use latest: https://docs.galadriel.com/oracle-address + address private oracleAddress; // use latest: https://docs.galadriel.com/oracle-address uint private runId = 0; string public message; string public response; IOracle.LlmRequest private config; - constructor() { + constructor(address initialOracleAddress) { + oracleAddress = initialOracleAddress; + config = IOracle.LlmRequest({ model: "claude-3-5-sonnet-20240620", // "claude-3-5-sonnet-20240620", "claude-3-opus-20240229", "claude-3-sonnet-20240229", "claude-3-haiku-20240307", "claude-2.1", "claude-2.0", "claude-instant-1.2" frequencyPenalty: 21, // > 20 for null diff --git a/examples/abis/Agent.json b/examples/abis/Agent.json index f89e2ae..7f917fb 100644 --- a/examples/abis/Agent.json +++ b/examples/abis/Agent.json @@ -89,31 +89,36 @@ "type": "uint256" } ], - "name": "getMessageHistoryContents", + "name": "getMessageHistory", "outputs": [ { - "internalType": "string[]", - "name": "", - "type": "string[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "agentId", - "type": "uint256" - } - ], - "name": "getMessageHistoryRoles", - "outputs": [ - { - "internalType": "string[]", + "components": [ + { + "internalType": "string", + "name": "role", + "type": "string" + }, + { + "components": [ + { + "internalType": "string", + "name": "contentType", + "type": "string" + }, + { + "internalType": "string", + "name": "value", + "type": "string" + } + ], + "internalType": "struct IOracle.Content[]", + "name": "content", + "type": "tuple[]" + } + ], + "internalType": "struct IOracle.Message[]", "name": "", - "type": "string[]" + "type": "tuple[]" } ], "stateMutability": "view", @@ -284,7 +289,7 @@ "outputs": [ { "internalType": "uint256", - "name": "i", + "name": "", "type": "uint256" } ], @@ -304,4 +309,4 @@ "stateMutability": "nonpayable", "type": "function" } -] +] \ No newline at end of file diff --git a/examples/abis/ChatGpt.json b/examples/abis/ChatGpt.json index b719af7..24f17f8 100644 --- a/examples/abis/ChatGpt.json +++ b/examples/abis/ChatGpt.json @@ -1,4 +1,4 @@ -[ + [ { "inputs": [ { @@ -97,31 +97,36 @@ "type": "uint256" } ], - "name": "getMessageHistoryContents", + "name": "getMessageHistory", "outputs": [ { - "internalType": "string[]", + "components": [ + { + "internalType": "string", + "name": "role", + "type": "string" + }, + { + "components": [ + { + "internalType": "string", + "name": "contentType", + "type": "string" + }, + { + "internalType": "string", + "name": "value", + "type": "string" + } + ], + "internalType": "struct IOracle.Content[]", + "name": "content", + "type": "tuple[]" + } + ], + "internalType": "struct IOracle.Message[]", "name": "", - "type": "string[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "chatId", - "type": "uint256" - } - ], - "name": "getMessageHistoryRoles", - "outputs": [ - { - "internalType": "string[]", - "name": "", - "type": "string[]" + "type": "tuple[]" } ], "stateMutability": "view", @@ -140,29 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "runId", - "type": "uint256" - }, - { - "internalType": "string", - "name": "response", - "type": "string" - }, - { - "internalType": "string", - "name": "errorMessage", - "type": "string" - } - ], - "name": "onOracleFunctionResponse", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -194,70 +176,13 @@ "type": "uint256" }, { - "components": [ - { - "internalType": "string", - "name": "id", - "type": "string" - }, - { - "internalType": "string", - "name": "content", - "type": "string" - }, - { - "internalType": "string", - "name": "functionName", - "type": "string" - }, - { - "internalType": "string", - "name": "functionArguments", - "type": "string" - }, - { - "internalType": "uint64", - "name": "created", - "type": "uint64" - }, - { - "internalType": "string", - "name": "model", - "type": "string" - }, - { - "internalType": "string", - "name": "systemFingerprint", - "type": "string" - }, - { - "internalType": "string", - "name": "object", - "type": "string" - }, - { - "internalType": "uint32", - "name": "completionTokens", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "promptTokens", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "totalTokens", - "type": "uint32" - } - ], - "internalType": "struct IOracle.LlmResponse", + "internalType": "string", "name": "response", - "type": "tuple" + "type": "string" }, { "internalType": "string", - "name": "errorMessage", + "name": "", "type": "string" } ], @@ -310,24 +235,5 @@ ], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "toolRunning", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" } ] \ No newline at end of file