๐งช Testing Your Nobel Prize KB Module
Testing involves three main stages: local testing, local node testing, and hosted node testing.
Testing Stages
After making changes to your KB module, testing involves the following steps:
๐ฅ๏ธ Local Testing Without Node
You can run the module directly using:
Sample output for querying:
You can modify the inputs_dict
in run.py
usage implementation section to test different operations:
After testing, iterate on your module and commit your changes as needed.
๐ Testing on Local or Hosted Node
Prerequisites for Local Node
- Set up your local Naptha Node and Hub:
- Clone the Naptha Node repository (Note: Currently private - please request access in the Naptha community)
- Set
LOCAL_HUB=True
in the node repository's.env
file
- Configure the Naptha SDK:
- Install using the SDK instructions
- Set in your
.env
file:
Publishing to GitHub
- Add a version tag:
- Verify your
deployment.json
configuration. Make sure it includes all required fields necessary for a kb module:
- Register on Naptha Hub:
- Verify module registration:
Once your module is published, you can test all KB operations:
Basic Operations
Initialize the KB:
List the first 10 entries:
Data Management
Add a new laureate:
Query the KB:
Cleanup Operations
Delete a specific entry:
Delete the entire KB:
Test each operation in sequence to verify your KB's full functionality.
Ready to enhance your KB module? Let's move on to the next lesson!