Skip to content

Commit

Permalink
Updates examples ABIs
Browse files Browse the repository at this point in the history
  • Loading branch information
kgrofelnik committed Jul 2, 2024
1 parent 5f66aff commit 5e8ccec
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 151 deletions.
6 changes: 4 additions & 2 deletions contracts/contracts/AnthropicSimpleLLM.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
53 changes: 29 additions & 24 deletions examples/abis/Agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -284,7 +289,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "i",
"name": "",
"type": "uint256"
}
],
Expand All @@ -304,4 +309,4 @@
"stateMutability": "nonpayable",
"type": "function"
}
]
]
156 changes: 31 additions & 125 deletions examples/abis/ChatGpt.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[
[
{
"inputs": [
{
Expand Down Expand Up @@ -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",
Expand All @@ -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": [
{
Expand Down Expand Up @@ -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"
}
],
Expand Down Expand Up @@ -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"
}
]

0 comments on commit 5e8ccec

Please sign in to comment.