๐งช Testing the Agent Module
Let's test our vision agent to make sure it works as expected. With Naptha, we can test our agent in a few different ways.
- Test the module locally without the Naptha Node
- Test the module on a local Naptha Node (with a local Hub)
- Test the module on a hosted Naptha Node (with the hosted Naptha Hub)
1. Local Development - Testing without a Naptha Node
You can test your agent directly by running the CLI command below:
This will run the module locally and output the results to the console.
Sample CLI output:
In the final course for this track, Publishing Your Agent to Naptha Hub, we'll cover:
- How to test the module on a local Naptha Node
- How to test the module on a hosted Naptha Node
Before moving on:
- Try testing with different images and questions
Debugging Strategies
- Enable debug logging in your module:
- Add debug statements in key areas:
Common Pitfalls To Avoid
- Missing dependencies
- Incorrect file paths
- API key issues
- Model availability
- Incorrect configuration
Security Best Practices
- API Key Management
- Never commit
.env
- Use environment variables
- Rotate keys regularly
- Validation
- Check file existence
- Validate URLs
- Sanitize inputs