The current Metamask model logic assumes that the LLM JSON response is correct to initiate Metamask transactions.
Data validation is necessary to ensure that the LLM JSON response is correct and valid, because:
Base-model training is done up to a set date i.e. they may not have seen the latest updates to Metamask (or other API specs) and could return methods, format etc. that is no longer supported
Base-model hallucinations can cause a high confidence response of incorrect data.
The following PR is a proposed solution that builds on our existing logic with minimal changes to code base: These include:
[ ] TransactionParams: Created a new class called TransactionParams that checks the validity of the JSON response from LLM against Metamask specs
[ ] TransactionRequest: Updated TransactionRequest class to incorporate TransactionParams. Also updated TransactionRequest to validate the method response from LLM is a valid Metamask method (and one that Morpheus wants to support) by adding a field_validator to check TransactionMethods dict
[ ] TransactionMethods: Created a dictionary of supported Metamask Transaction methods. This also allows us to control the functionality we want to offer users as we test and scale LLM performance/capabilities.
The current Metamask model logic assumes that the LLM JSON response is correct to initiate Metamask transactions.
Data validation is necessary to ensure that the LLM JSON response is correct and valid, because:
The following PR is a proposed solution that builds on our existing logic with minimal changes to code base: These include: