[SC-15520] Expose qualitative text agent to vm library#493
[SC-15520] Expose qualitative text agent to vm library#493
Conversation
Made-with: Cursor
Made-with: Cursor
|
Pull requests must include at least one of the required labels: |
Made-with: Cursor
|
Pull requests must include at least one of the required labels: |
Made-with: Cursor
|
Pull requests must include at least one of the required labels: |
Made-with: Cursor
|
Pull requests must include at least one of the required labels: |
PR SummaryThis PR introduces comprehensive support for programmatically generating and logging qualitative documentation text using the ValidMind library. Key functional changes include:
Overall, these changes streamline the integration of AI-generated qualitative content with documentation tests and enhance the end-to-end automated documentation workflow in the ValidMind Library. Test Suggestions
|
There was a problem hiding this comment.
The content_id for model_overview_text should be model_overview, otherwise you would not be reusing the pre-existing block:
Similarly, I get an error for:
vm.run_text_generation(
content_id="dataset_description_text",
context={"content_ids": vm.get_content_ids("data_description")},
).log()
Error:
SectionNotFoundError: Section for content dataset_description_text not found
[NOTE] During task with name 'qualitative_text_generation' and id '028072b6-3431-e084-5f94-a0f6ec353894'
The correct content_id should be dataset_summary_text:
Similarly, the last cell should be fixed so it can run on the current version of the chun template, without modifications. This will require 2 changes:
- Using the correct
content_idsi.e.model_overviewinstead ofmodel_overview_text - Adding a small improvement to the current feature (I know it adds a bit of scope) so that we can pre-assign a content block if the given
content_iddoes not exist in the template. For example, the blockintended_use_textdoes not exist in the template, so we should be able to specify thesection_idwhere it should be appended. Note that this is already supported by test results blocks, e.g.:
perf_comparison_result.log(section_id="model_evaluation")
roc_curve_result.log(section_id="model_evaluation")For the case of intended_use_text we could call .log(section_id="intended_use").
With these changes in place we should be able to populate 100% of the churn document with this notebook.
Pull Request Description
What and why?
Implemented programmatic qualitative text generation in the ValidMind library so documentation text blocks can now be generated from code instead of only through the UI. This adds support for generating text for a single
content_id, customizing generation with a prompt and narrowing the generation context to selected sections.Before this change, users had to manually write text or trigger AI generation section by section in the UI; after this change, they can generate and log qualitative documentation directly from Python in the same workflow used to run quantitative tests.
How to test
pytest tests/test_api_client.py tests/test_client.py tests/test_results.py.notebooks/how_to/qualitative_text/qualitative_text_generation.ipynband run the notebook end to end against a model with the Customer Churn template applied.vm.run_text_generation()works for a single text block with default behavior, with a custom prompt, and with section-specific context.customer_churn_template.yaml
What needs special review?
Dependencies, breaking changes, and deployment notes
https://github.com/validmind/frontend/pull/2390
https://github.com/validmind/backend/pull/2925
Release notes
Added support for programmatic AI generation of qualitative documentation text through the ValidMind library. Users can now generate and log text for individual documentation blocks, customize the output with prompts, control generation context with selected sections, and populate qualitative sections directly from notebooks.
Checklist