Skip to content

Commit

Permalink
Updates deployed contracts addresses (#113)
Browse files Browse the repository at this point in the history
* Updates deployed contracts addresses
* Adds Claude e2e test
  • Loading branch information
kgrofelnik authored Jun 27, 2024
1 parent 6dd25fb commit c823cce
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
30 changes: 30 additions & 0 deletions contracts/tasks/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,18 @@ task("e2e", "Runs all e2e tests")
testResults["Groq gemma-7b-it"] = truncateMessage(e.message)
}

try {
let result = await runLlm(
contractAddress,
"claude-3-5-sonnet-20240620",
"Who is the president of USA?",
hre,
)
testResults["Anthropic claude-3-5-sonnet-20240620"] = result.error ? truncateMessage(result.error) : "✅";
} catch (e: any) {
testResults["Anthropic claude-3-5-sonnet-20240620"] = truncateMessage(e.message)
}

try {
let result = await runTaskWithTimeout(
"image_generation",
Expand Down Expand Up @@ -282,6 +294,24 @@ async function runGroq(
return result;
}

async function runLlm(
contractAddress: string,
model: string,
message: string,
hre: HardhatRuntimeEnvironment,
) {
let result = await runTaskWithTimeout(
"llm",
{
contractAddress,
model,
message,
},
hre,
)
return result;
}

function truncateMessage(message: string) {
return message.length > MAX_ERROR_LEN ? message.slice(0, MAX_ERROR_LEN - 3) + '...' : message;
}
8 changes: 4 additions & 4 deletions examples/template.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CHAIN_ID=696969
RPC_URL="https://devnet.galadriel.com/"
PRIVATE_KEY=""

CHAT_CONTRACT_ADDRESS="0xbb28197bccAA45A19dBedC67eFf63c86Ac92Fd2b"
CHAT_VISION_CONTRACT_ADDRESS="0xA6c0C615BD367A858Ba208718CAb59d05D39EFa8"
AGENT_CONTRACT_ADDRESS="0xF757B73165820b1DD00E4F0a36a6ea17aD89A15a"
ANTROPIC_CONTRACT_ADDRESS=""
CHAT_CONTRACT_ADDRESS="0x04a26CFf9Ef76c98C1487f5F77F5a30458B999a2"
CHAT_VISION_CONTRACT_ADDRESS="0x785578B0dA5F21F8321590981E15F618BBc1915c"
AGENT_CONTRACT_ADDRESS="0x9496b155e6e2BCdf5aC0d64F36d344E5B8e49d60"
ANTROPIC_CONTRACT_ADDRESS="0xCfd9463d6452c396eD0a56005C22D7171D0B5f2c"

0 comments on commit c823cce

Please sign in to comment.