Corvic MCP for GenAI Agent Testing
This example demonstrates how to build a lightweight GenAI testing framework using Corvic MCP and a Jupyter notebook. It reads structured test queries from a CSV file, invokes a Corvic-powered agent, and saves the responses alongside expected answers for comparison.
Use Case
You want to automatically evaluate the output of a Corvic agent across a list of test questions with known expected answers. This is useful for regression testing, QA, and validation of LLM-based applications.
Steps
- Configure Corvic Agent Endpoint:
- Set
MCP_URLto your deployed Corvic agent's endpoint. - Set the
HEADERSwith your Corvic API token.
- Set
- Prepare the Input Dataset:
- Create a CSV file with at least the following columns:
id,question,expected_answer. - Set the
INPUT_CSV_PATHto the location of this CSV file.
- Create a CSV file with at least the following columns:
- Configure Output:
- Set the
OUTPUT_PATHwhere the agent's responses will be written as an Excel file.
- Set the
Input Format (CSV)
Output
An Excel file containing the following columns:
idquestionexpected_answer(expected answer)response(from Corvic)
The following Python code (from the Jupyter Notebook) demonstrates the testing setup:
Corvic AI Agent Testing via API
Corvic AI agents deployed in production can be tested using APIs. This notebook demonstrates how to interact with deployed agents programmatically, enabling automated testing and integration into various workflows.
Querying ID 1: What is the NAICS code for wheat farming? Response: 111140 Querying ID 2: How is retail defined in NAICS? Response: Retail involves selling goods directly to customers,... ✅ Done. Results saved to /PATH_TO_STORE_RESPONSES/output.xlsx
Need help? Contact support@corvic.ai or visit https://www.corvic.ai.