From 0f16f43ae31ead8905c7c29133d35d0a1be989fa Mon Sep 17 00:00:00 2001 From: Emma Van Der Heide Date: Tue, 11 Aug 2026 16:57:03 -0400 Subject: [PATCH 1/5] Add inventory record type prompt to notebook templating [sc-16131] Ask for Model/Agent/Use Case/Tool (or custom free text, defaulting to Model) and fill {record-type} placeholders in install and next-steps mini-templates so newly generated notebooks can target different inventory record types. Co-authored-by: Cursor --- notebooks/templates/README.md | 4 + notebooks/templates/e2e-notebook.ipynb | 35 +++++- notebooks/templates/e2e_template.py | 102 ++++++++++++++++++ ..._install-initialize-with-development.ipynb | 36 +++---- .../_install-initialize-with-monitoring.ipynb | 36 +++---- .../_install-initialize-with-validation.ipynb | 36 +++---- .../next-steps/_next-steps-development.ipynb | 4 +- .../next-steps/_next-steps-monitoring.ipynb | 4 +- .../next-steps/_next-steps-validation.ipynb | 4 +- 9 files changed, 196 insertions(+), 65 deletions(-) diff --git a/notebooks/templates/README.md b/notebooks/templates/README.md index f2d53cd83..85a08a453 100644 --- a/notebooks/templates/README.md +++ b/notebooks/templates/README.md @@ -8,6 +8,10 @@ The same functionality is also accesible [in our root directory Makefile](../../ make notebook ``` +During generation you'll choose: + +1. A **role / document type** (development, validation, or monitoring) that selects which mini-template variants to append. +2. An **inventory record type** (Model by default, Agent, Use Case, Tool, or custom free text) that fills `{record-type}` placeholders in install and next-steps mini-templates. ## Mini-templates The template generation script/notebook draws from the following mini-templates, should you need to revise them or grab the information from them manually: diff --git a/notebooks/templates/e2e-notebook.ipynb b/notebooks/templates/e2e-notebook.ipynb index e165dd628..518cf0f64 100644 --- a/notebooks/templates/e2e-notebook.ipynb +++ b/notebooks/templates/e2e-notebook.ipynb @@ -20,6 +20,7 @@ " - [Designate the filename](#toc1_2__) \n", " - [Set the title](#toc1_3__) \n", " - [Set a role / document type](#toc1_4__) \n", + " - [Set an inventory record type](#toc1_5__) \n", "- [Single-sourcing from mini-templates](#toc2__) \n", " - [Insert information about ValidMind](#toc2_1__) \n", " - [Insert setup instructions](#toc2_2__) \n", @@ -139,6 +140,34 @@ "tm.select_document()" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "\n", + "### Set an inventory record type\n", + "\n", + "Next, you'll be asked to set the inventory record type the notebook deals with. That value is logged and used to fill `{record-type}` placeholders in later mini-templates (for example registration and next-steps instructions):\n", + "\n", + "1. Model (default — press Enter)\n", + "2. Agent\n", + "3. Use Case\n", + "4. Tool\n", + "5. Custom (enter free text)\n", + "\n", + "You can also type a custom record type name directly instead of choosing a numbered option." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tm.select_record_type()" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -199,9 +228,11 @@ "*Install ValidMind* includes information for:\n", "\n", "- Installing the ValidMind Library\n", - "- OPTIONAL — Initializing the ValidMind Library (registering a sample model, (skippable) applying a documentation template, retrieving the code snippet, (skippable) previewing the applied template)\n", + "- OPTIONAL — Initializing the ValidMind Library (registering a sample `{record-type}`, (skippable) applying a documentation template, retrieving the code snippet, (skippable) previewing the applied template)\n", + "\n", + "**You'll be prompted to enter a `{template}` here if you choose to include the initialization instructions.** Typing in `SKIP` for those prompts will remove those sections from the generated notebook if they're not relevant.\n", "\n", - "**You'll be prompted to enter a `{template}` here if you choose to include the initialization instructions.** Typing in `SKIP` for those prompts will remove those sections from the generated notebook if they're not relevant." + "`{record-type}` placeholders from your earlier inventory record type selection are filled in automatically when setup and next-steps mini-templates are appended." ] }, { diff --git a/notebooks/templates/e2e_template.py b/notebooks/templates/e2e_template.py index 77fd9e5ad..e54cc3f0b 100644 --- a/notebooks/templates/e2e_template.py +++ b/notebooks/templates/e2e_template.py @@ -14,12 +14,22 @@ "3": "monitoring", } +RECORD_TYPES = { + "1": "Model", + "2": "Agent", + "3": "Use Case", + "4": "Tool", +} + +DEFAULT_RECORD_TYPE = "Model" + INSTALL_CHOICE = { "1": "install_only", "2": "install_and_initialize", } _selected_document: Optional[str] = None +_selected_record: Optional[str] = None _selected_install: Optional[str] = None def ensure_ids(notebook): @@ -319,6 +329,96 @@ def select_document(): print(f"Selected: {labels[_selected_document]}") return _selected_document + +def select_record_type( + *, + input_func: Callable[[str], str] = input, + print_func: Callable[[str], None] = print, + record_type_value: Optional[str] = None, +) -> Optional[str]: + """Requests the inventory record type used to fill `{record-type}` placeholders. + + Fixed options are Model, Agent, Use Case, and Tool. Users can also enter a + custom value. Pressing Enter with no input defaults to Model. + + Stores the selection in the module-level `_selected_record` variable for + downstream placeholder replacement. + + Returns: + The selected record type string. + """ + global _selected_record + + if record_type_value is not None: + selected = record_type_value.strip() or DEFAULT_RECORD_TYPE + _selected_record = selected + print_func(f"Selected record type: {_selected_record}") + return _selected_record + + choice = input_func( + "Select an inventory record type — " + "[1: Model (default)], " + "[2: Agent], " + "[3: Use Case], " + "[4: Tool], " + "[5: Custom (enter free text)], " + "or press Enter for Model: " + ).strip() + + if not choice: + selected = DEFAULT_RECORD_TYPE + elif choice in RECORD_TYPES: + selected = RECORD_TYPES[choice] + elif choice == "5": + custom = input_func("Enter a custom inventory record type: ").strip() + if not custom: + print_func( + f"No custom value entered; defaulting to {DEFAULT_RECORD_TYPE}." + ) + selected = DEFAULT_RECORD_TYPE + else: + selected = custom + else: + # Allow typing a known label or any free-text record type directly. + selected = choice + + _selected_record = selected + print_func(f"Selected record type: {_selected_record}") + return _selected_record + + +def replace_record_type( + filepath: str, + *, + record_type_value: Optional[str] = None, + print_func: Callable[[str], None] = print, +) -> None: + """Replace `{record-type}` placeholders in a notebook file. + + Uses `record_type_value` when provided; otherwise falls back to the value + stored by `select_record_type()`. Defaults to Model when neither is set. + """ + value = (record_type_value or _selected_record or DEFAULT_RECORD_TYPE).strip() + if not value: + value = DEFAULT_RECORD_TYPE + + try: + with open(filepath, "r", encoding="utf-8") as f: + content = f.read() + + if "{record-type}" not in content: + return + + content = content.replace("{record-type}", value) + with open(filepath, "w", encoding="utf-8") as f: + if not content.endswith("\n"): + content += "\n" + f.write(content) + print_func(f"Replaced {{record-type}} with '{value}' in '{filepath}'") + except Exception as e: + print_func(f"Error replacing record type placeholders in file: {e}") + + def add_about(filepath): """Appends an about-validmind notebook based on the document type selected via select_document().""" about_files = { @@ -609,6 +709,7 @@ def _append_notebook(filepath, relative_path): print(f"Error appending notebooks: {e}") return False + replace_record_type(filepath) return True @@ -744,6 +845,7 @@ def add_copyright(filepath: str) -> None: if filepath: set_title(filepath) select_document() + select_record_type() add_about(filepath) select_install() add_install(filepath) diff --git a/notebooks/templates/install-validmind/_install-initialize-with-development.ipynb b/notebooks/templates/install-validmind/_install-initialize-with-development.ipynb index b3a4b923c..d536d6361 100644 --- a/notebooks/templates/install-validmind/_install-initialize-with-development.ipynb +++ b/notebooks/templates/install-validmind/_install-initialize-with-development.ipynb @@ -45,23 +45,22 @@ "id": "register-model", "metadata": {}, "source": [ - "#### Register sample model\n", + "#### Register sample {record-type}\n", "\n", - "Let's first register a sample record (model) for use with this notebook.\n", + "Let's first register a sample record ({record-type}) for use with this notebook.\n", "\n", "1. In a browser, [log in to ValidMind](https://docs.validmind.ai/guide/access/log-in-to-validmind.html).\n", "\n", "2. In the left sidebar, select **Inventory**.\n", "\n", - "3. Select `Model` by clicking on **{Record} Inventory**, where `{Record}` is the currently active type of record. (Learn more: [Register records in the inventory](https://docs.validmind.ai/guide/inventory/register-records-in-inventory.html))\n", - - "4. Click **+ Register Model**.\n", - "\n", - "5. Enter the model details and click **Next >** to continue to assignment of inventory record stakeholders.\n", - "\n", - "6. Select your own name under the **Record Owner** drop-down.\n", - "\n", - "7. Click **Register Model** to add the model to your inventory." + "3. Select `{record-type}` by clicking on **{Record} Inventory**, where `{Record}` is the currently active type of record. (Learn more: [Register records in the inventory](https://docs.validmind.ai/guide/inventory/register-records-in-inventory.html))\n", + "4. Click **+ Register {record-type}**.\n", + "\n", + "5. Enter the {record-type} details and click **Next >** to continue to assignment of inventory record stakeholders.\n", + "\n", + "6. Select your own name under the **Record Owner** drop-down.\n", + "\n", + "7. Click **Register {record-type}** to add the {record-type} to your inventory." ] }, { @@ -71,11 +70,11 @@ "source": [ "#### Apply documentation template\n", "\n", - "Once you've registered your model, let's select a documentation template. A template predefines sections for your documentation and provides a general outline to follow, making the documentation process much easier.\n", + "Once you've registered your {record-type}, let's select a documentation template. A template predefines sections for your documentation and provides a general outline to follow, making the documentation process much easier.\n", "\n", - "1. In the left sidebar that appears for your model, click **Documents** and select **Development**.\n", + "1. In the left sidebar that appears for your {record-type}, click **Documents** and select **Development**.\n", "\n", - " If you cannot locate your Development document, make sure Development type documents are enabled for model records and create a new document. (**Learn more:** [Manage documents](https://docs.validmind.ai/guide/templates/manage-documents.html#add-record-documents))\n", + " If you cannot locate your Development document, make sure Development type documents are enabled for {record-type} records and create a new document. (**Learn more:** [Manage documents](https://docs.validmind.ai/guide/templates/manage-documents.html#add-record-documents))\n", "\n", "2. Under **Template**, select `{template}`.\n", "\n", @@ -91,12 +90,11 @@ "\n", "Initialize the ValidMind Library with the *code snippet* unique to each record per document, ensuring your test results are uploaded to the correct record and automatically populated in the right document in the ValidMind Platform when you run the Library.\n", "\n", - "1. On the left sidebar that appears for your model, select **Getting Started** and select `Development` from the **Document** drop-down menu.\n", + "1. On the left sidebar that appears for your {record-type}, select **Getting Started** and select `Development` from the **Document** drop-down menu.\n", "\n", "2. Click **Copy snippet to clipboard**.\n", "\n", - "3. Next, [load your model identifier credentials from an `.env` file](https://docs.validmind.ai/developer/quickstart/store-credentials-in-env-file.html) or replace the placeholder with your own code snippet:", - "\n", + "3. Next, [load your model identifier credentials from an `.env` file](https://docs.validmind.ai/developer/quickstart/store-credentials-in-env-file.html) or replace the placeholder with your own code snippet:\n", "If your organization authenticates with OAuth 2.0 / OIDC instead of API keys, see [Authenticate with OIDC device flow](https://docs.validmind.ai/developer/quickstart/authenticate-with-oidc-device-flow.html) or try the [OIDC device-flow quickstart notebook](https://docs.validmind.ai/notebooks/quickstart/quickstart_model_documentation_oidc_device_flow.html).\n" ] }, @@ -132,9 +130,9 @@ "source": [ "### Preview the documentation template\n", "\n", - "Let's verify that you have connected the ValidMind Library to the ValidMind Platform and that the appropriate *template* is selected for your model.\n", + "Let's verify that you have connected the ValidMind Library to the ValidMind Platform and that the appropriate *template* is selected for your {record-type}.\n", "\n", - "You will upload documentation and test results unique to your model based on this template later on. For now, **take a look at the default structure that the template provides with [the `vm.preview_template()` function](https://docs.validmind.ai/validmind/validmind.html#preview_template)** from the ValidMind library and note the empty sections:" + "You will upload documentation and test results unique to your {record-type} based on this template later on. For now, **take a look at the default structure that the template provides with [the `vm.preview_template()` function](https://docs.validmind.ai/validmind/validmind.html#preview_template)** from the ValidMind library and note the empty sections:" ] }, { diff --git a/notebooks/templates/install-validmind/_install-initialize-with-monitoring.ipynb b/notebooks/templates/install-validmind/_install-initialize-with-monitoring.ipynb index 8e0c9b353..2ca2714f8 100644 --- a/notebooks/templates/install-validmind/_install-initialize-with-monitoring.ipynb +++ b/notebooks/templates/install-validmind/_install-initialize-with-monitoring.ipynb @@ -45,23 +45,22 @@ "id": "register-model", "metadata": {}, "source": [ - "#### Register sample model\n", + "#### Register sample {record-type}\n", "\n", - "Let's first register a sample record (model) for use with this notebook.\n", + "Let's first register a sample record ({record-type}) for use with this notebook.\n", "\n", "1. In a browser, [log in to ValidMind](https://docs.validmind.ai/guide/access/log-in-to-validmind.html).\n", "\n", "2. In the left sidebar, select **Inventory**.\n", "\n", - "3. Select `Model` by clicking on **{Record} Inventory**, where `{Record}` is the currently active type of record. (Learn more: [Register records in the inventory](https://docs.validmind.ai/guide/inventory/register-records-in-inventory.html))\n", - - "4. Click **+ Register Model**.\n", - "\n", - "5. Enter the model details and click **Next >** to continue to assignment of inventory record stakeholders.\n", - "\n", - "6. Select your own name under the **Record Owner** drop-down.\n", - "\n", - "7. Click **Register Model** to add the model to your inventory." + "3. Select `{record-type}` by clicking on **{Record} Inventory**, where `{Record}` is the currently active type of record. (Learn more: [Register records in the inventory](https://docs.validmind.ai/guide/inventory/register-records-in-inventory.html))\n", + "4. Click **+ Register {record-type}**.\n", + "\n", + "5. Enter the {record-type} details and click **Next >** to continue to assignment of inventory record stakeholders.\n", + "\n", + "6. Select your own name under the **Record Owner** drop-down.\n", + "\n", + "7. Click **Register {record-type}** to add the {record-type} to your inventory." ] }, { @@ -71,11 +70,11 @@ "source": [ "#### Apply monitoring report template\n", "\n", - "Once you've registered your model, let's select a monitoring report template. A template predefines sections for your monitoring report and provides a general outline to follow, making the monitoring process much easier.\n", + "Once you've registered your {record-type}, let's select a monitoring report template. A template predefines sections for your monitoring report and provides a general outline to follow, making the monitoring process much easier.\n", "\n", - "1. In the left sidebar that appears for your model, click **Documents** and select **Monitoring**.\n", + "1. In the left sidebar that appears for your {record-type}, click **Documents** and select **Monitoring**.\n", "\n", - " If you cannot locate your Monitoring document, make sure Monitoring type documents are enabled for model records and create a new document. (**Learn more:** [Manage documents](https://docs.validmind.ai/guide/templates/manage-documents.html#add-record-documents))\n", + " If you cannot locate your Monitoring document, make sure Monitoring type documents are enabled for {record-type} records and create a new document. (**Learn more:** [Manage documents](https://docs.validmind.ai/guide/templates/manage-documents.html#add-record-documents))\n", "\n", "2. Under **Template**, select `{template}`.\n", "\n", @@ -91,12 +90,11 @@ "\n", "Initialize the ValidMind Library with the *code snippet* unique to each record per document, ensuring your test results are uploaded to the correct record and automatically populated in the right document in the ValidMind Platform when you run the Library.\n", "\n", - "1. On the left sidebar that appears for your model, select **Getting Started** and select `Monitoring` from the **Document** drop-down menu.\n", + "1. On the left sidebar that appears for your {record-type}, select **Getting Started** and select `Monitoring` from the **Document** drop-down menu.\n", "\n", "2. Click **Copy snippet to clipboard**.\n", "\n", - "3. Next, [load your model identifier credentials from an `.env` file](https://docs.validmind.ai/developer/quickstart/store-credentials-in-env-file.html) or replace the placeholder with your own code snippet:", - "\n", + "3. Next, [load your model identifier credentials from an `.env` file](https://docs.validmind.ai/developer/quickstart/store-credentials-in-env-file.html) or replace the placeholder with your own code snippet:\n", "If your organization authenticates with OAuth 2.0 / OIDC instead of API keys, see [Authenticate with OIDC device flow](https://docs.validmind.ai/developer/quickstart/authenticate-with-oidc-device-flow.html) or try the [OIDC device-flow quickstart notebook](https://docs.validmind.ai/notebooks/quickstart/quickstart_model_documentation_oidc_device_flow.html).\n" ] }, @@ -132,9 +130,9 @@ "source": [ "### Preview the monitoring report template\n", "\n", - "Let's verify that you have connected the ValidMind Library to the ValidMind Platform and that the appropriate *template* is selected for your model.\n", + "Let's verify that you have connected the ValidMind Library to the ValidMind Platform and that the appropriate *template* is selected for your {record-type}.\n", "\n", - "You will upload documentation and test results unique to your model based on this template later on. For now, **take a look at the default structure that the template provides with [the `vm.preview_template()` function](https://docs.validmind.ai/validmind/validmind.html#preview_template)** from the ValidMind library and note the empty sections:" + "You will upload documentation and test results unique to your {record-type} based on this template later on. For now, **take a look at the default structure that the template provides with [the `vm.preview_template()` function](https://docs.validmind.ai/validmind/validmind.html#preview_template)** from the ValidMind library and note the empty sections:" ] }, { diff --git a/notebooks/templates/install-validmind/_install-initialize-with-validation.ipynb b/notebooks/templates/install-validmind/_install-initialize-with-validation.ipynb index 14320562d..28d669f1e 100644 --- a/notebooks/templates/install-validmind/_install-initialize-with-validation.ipynb +++ b/notebooks/templates/install-validmind/_install-initialize-with-validation.ipynb @@ -13,25 +13,24 @@ "id": "register-model", "metadata": {}, "source": [ - "### Register a sample model\n", + "### Register a sample {record-type}\n", "\n", "In a usual lifecycle, a champion will have been independently registered in your inventory and submitted to you for validation by your development team as part of the effective challenge process. (**Learn more:** [Submit documents](https://docs.validmind.ai/guide/documentation/submit-documents.html))\n", "\n", - "For this notebook, we'll have you register a dummy record (model) in the ValidMind Platform inventory and assign yourself as the validator to familiarize you with the ValidMind interface and circumvent the need for an existing model:\n", + "For this notebook, we'll have you register a dummy record ({record-type}) in the ValidMind Platform inventory and assign yourself as the validator to familiarize you with the ValidMind interface and circumvent the need for an existing {record-type}:\n", "\n", "1. In a browser, [log in to ValidMind](https://docs.validmind.ai/guide/access/log-in-to-validmind.html).\n", "\n", "2. In the left sidebar, select **Inventory**.\n", "\n", - "3. Select `Model` by clicking on **{Record} Inventory**, where `{Record}` is the currently active type of record. (Learn more: [Register records in the inventory](https://docs.validmind.ai/guide/inventory/register-records-in-inventory.html))\n", - - "4. Click **+ Register Model**.\n", - "\n", - "5. Enter the model details and click **Next >** to continue to assignment of inventory record stakeholders.\n", - "\n", - "6. Select your own name under the **Record Owner** drop-down — don’t worry, we’ll adjust these permissions next for validation.\n", - "\n", - "7. Click **Register Model** to add the model to your inventory." + "3. Select `{record-type}` by clicking on **{Record} Inventory**, where `{Record}` is the currently active type of record. (Learn more: [Register records in the inventory](https://docs.validmind.ai/guide/inventory/register-records-in-inventory.html))\n", + "4. Click **+ Register {record-type}**.\n", + "\n", + "5. Enter the {record-type} details and click **Next >** to continue to assignment of inventory record stakeholders.\n", + "\n", + "6. Select your own name under the **Record Owner** drop-down — don’t worry, we’ll adjust these permissions next for validation.\n", + "\n", + "7. Click **Register {record-type}** to add the {record-type} to your inventory." ] }, { @@ -41,18 +40,18 @@ "source": [ "#### Assign validator credentials\n", "\n", - "In order to log tests as a validator instead of as a developer, on the details page that appears after you've successfully registered your sample model:\n", + "In order to log tests as a validator instead of as a developer, on the details page that appears after you've successfully registered your sample {record-type}:\n", "\n", "1. Remove yourself as an owner:\n", "\n", " - Click on the **Owners** tile.\n", - " - Click the **x** next to your name to remove yourself from that model's role.\n", + " - Click the **x** next to your name to remove yourself from that {record-type}'s role.\n", " - Click **Save** to apply your changes to that role.\n", "\n", "2. Remove yourself as a developer:\n", "\n", " - Click on the **Developers** tile.\n", - " - Click the **x** next to your name to remove yourself from that model's role.\n", + " - Click the **x** next to your name to remove yourself from that {record-type}'s role.\n", " - Click **Save** to apply your changes to that role.\n", "\n", "3. Add yourself as a validator:\n", @@ -71,9 +70,9 @@ "\n", "Next, let's select a validation report template. A template predefines sections for your report and provides a general outline to follow, making the validation process much easier.\n", "\n", - "1. In the left sidebar that appears for your model, click **Documents** and select **Validation**.\n", + "1. In the left sidebar that appears for your {record-type}, click **Documents** and select **Validation**.\n", "\n", - " If you cannot locate your Validation document, make sure Validation type documents are enabled for model records and create a new document. (**Learn more:** [Manage documents](https://docs.validmind.ai/guide/templates/manage-documents.html#add-record-documents))\n", + " If you cannot locate your Validation document, make sure Validation type documents are enabled for {record-type} records and create a new document. (**Learn more:** [Manage documents](https://docs.validmind.ai/guide/templates/manage-documents.html#add-record-documents))\n", "\n", "2. Under **Template**, select `{template}`.\n", "\n", @@ -121,12 +120,11 @@ "\n", "Initialize the ValidMind Library with the *code snippet* unique to each record per document, ensuring your test results are uploaded to the correct record and automatically populated in the right document in the ValidMind Platform when you run the Library.\n", "\n", - "1. On the left sidebar that appears for your model, select **Getting Started** and select `Validation` from the **Document** drop-down menu.\n", + "1. On the left sidebar that appears for your {record-type}, select **Getting Started** and select `Validation` from the **Document** drop-down menu.\n", "\n", "2. Click **Copy snippet to clipboard**.\n", "\n", - "3. Next, [load your model identifier credentials from an `.env` file](https://docs.validmind.ai/developer/quickstart/store-credentials-in-env-file.html) or replace the placeholder with your own code snippet:", - "\n", + "3. Next, [load your model identifier credentials from an `.env` file](https://docs.validmind.ai/developer/quickstart/store-credentials-in-env-file.html) or replace the placeholder with your own code snippet:\n", "If your organization authenticates with OAuth 2.0 / OIDC instead of API keys, see [Authenticate with OIDC device flow](https://docs.validmind.ai/developer/quickstart/authenticate-with-oidc-device-flow.html) or try the [OIDC device-flow quickstart notebook](https://docs.validmind.ai/notebooks/quickstart/quickstart_model_documentation_oidc_device_flow.html).\n" ] }, diff --git a/notebooks/templates/next-steps/_next-steps-development.ipynb b/notebooks/templates/next-steps/_next-steps-development.ipynb index 11086e10f..dbc87f104 100644 --- a/notebooks/templates/next-steps/_next-steps-development.ipynb +++ b/notebooks/templates/next-steps/_next-steps-development.ipynb @@ -17,9 +17,9 @@ "source": [ "### Work with your documentation\n", "\n", - "1. From the **Inventory** in the ValidMind Platform, go to the model you registered earlier. (Learn more: [Working with the inventory](https://docs.validmind.ai/guide/inventory/working-with-the-inventory.html))\n", + "1. From the **Inventory** in the ValidMind Platform, go to the {record-type} you registered earlier. (Learn more: [Working with the inventory](https://docs.validmind.ai/guide/inventory/working-with-the-inventory.html))\n", "\n", - "2. In the left sidebar that appears for your model, click **Development** under Documents.\n", + "2. In the left sidebar that appears for your {record-type}, click **Development** under Documents.\n", "\n", "What you see is the full draft of your documentation in a more easily consumable version. From here, you can make qualitative edits to documentation, view guidelines, collaborate with validators, and submit your documentation for approval when it's ready. (**Learn more:** [Working with documentation](https://docs.validmind.ai/guide/documentation/working-with-documentation.html))" ] diff --git a/notebooks/templates/next-steps/_next-steps-monitoring.ipynb b/notebooks/templates/next-steps/_next-steps-monitoring.ipynb index e3f69efd4..516b5cd69 100644 --- a/notebooks/templates/next-steps/_next-steps-monitoring.ipynb +++ b/notebooks/templates/next-steps/_next-steps-monitoring.ipynb @@ -17,9 +17,9 @@ "source": [ "### Work with your monitoring report\n", "\n", - "1. From the **Inventory** in the ValidMind Platform, go to the model you registered earlier. (Learn more: [Working with the inventory](https://docs.validmind.ai/guide/inventory/working-with-the-inventory.html))\n", + "1. From the **Inventory** in the ValidMind Platform, go to the {record-type} you registered earlier. (Learn more: [Working with the inventory](https://docs.validmind.ai/guide/inventory/working-with-the-inventory.html))\n", "\n", - "2. In the left sidebar that appears for your model, click **Monitoring** under Documents.\n", + "2. In the left sidebar that appears for your {record-type}, click **Monitoring** under Documents.\n", "\n", "What you see is the full draft of your monitoring report in a more easily consumable version. From here, you can make qualitative edits to monitoring reports, view guidelines, review monitoring results, and submit your monitoring report for approval when it's ready. (**Learn more:** [Ongoing monitoring](https://docs.validmind.ai/guide/monitoring/ongoing-monitoring.html))" ] diff --git a/notebooks/templates/next-steps/_next-steps-validation.ipynb b/notebooks/templates/next-steps/_next-steps-validation.ipynb index 52426c733..9d28e2893 100644 --- a/notebooks/templates/next-steps/_next-steps-validation.ipynb +++ b/notebooks/templates/next-steps/_next-steps-validation.ipynb @@ -19,9 +19,9 @@ "\n", "Now that you've logged all your test results and verified the work done by the development team, head to the ValidMind Platform to wrap up your validation report:\n", "\n", - "1. From the **Inventory** in the ValidMind Platform, go to the model you connected to earlier.\n", + "1. From the **Inventory** in the ValidMind Platform, go to the {record-type} you connected to earlier.\n", "\n", - "2. In the left sidebar that appears for your model, click **Validation** under Documents.\n", + "2. In the left sidebar that appears for your {record-type}, click **Validation** under Documents.\n", "\n", "Include your logged test results as evidence, create risk assessment notes, add artifacts, and assess compliance, then submit your report for review when it's ready. (**Learn more:** [Preparing validation reports](https://docs.validmind.ai/guide/validation/preparing-validation-reports.html))" ] From 07a2825c69917bc99797d7f65c92432eb2fb8542 Mon Sep 17 00:00:00 2001 From: Emma Van Der Heide Date: Tue, 11 Aug 2026 17:37:53 -0400 Subject: [PATCH 2/5] Clarify record wording in notebook mini-templates [sc-16131] Reword the "record" key concept so it no longer defines a record via "such as a model" (and keep Key concepts free of variables), and genericize "model identifier credentials" to "{record-type} identifier credentials" in the code-snippet step so it follows the selected inventory record type. Co-authored-by: Cursor --- .../about-validmind/_about-validmind-developers.ipynb | 2 +- .../about-validmind/_about-validmind-monitoring.ipynb | 2 +- .../about-validmind/_about-validmind-validators.ipynb | 2 +- .../_install-initialize-with-development.ipynb | 4 ++-- .../_install-initialize-with-monitoring.ipynb | 4 ++-- .../_install-initialize-with-validation.ipynb | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/notebooks/templates/about-validmind/_about-validmind-developers.ipynb b/notebooks/templates/about-validmind/_about-validmind-developers.ipynb index 3259c50f6..7cd754532 100644 --- a/notebooks/templates/about-validmind/_about-validmind-developers.ipynb +++ b/notebooks/templates/about-validmind/_about-validmind-developers.ipynb @@ -45,7 +45,7 @@ "source": [ "### Key concepts\n", "\n", - "**record**: A tool tracked in the ValidMind inventory, such as a model. Records include traditional statistical models, legacy systems, artificial intelligence/machine learning models, large language models (LLMs), agentic AI systems, and other documentable items that benefit from oversight, testing, and lifecycle management.\n", + "**record**: A tool tracked in the ValidMind inventory. Records include traditional statistical models, legacy systems, artificial intelligence/machine learning models, large language models (LLMs), agentic AI systems, and other documentable items that benefit from oversight, testing, and lifecycle management.\n", "\n", "**model**: [SR 26-2](https://www.federalreserve.gov/supervisionreg/srletters/SR2602.htm) (which supersedes SR 11-7) defines a model as a \"complex quantitative method, system, or approach that applies statistical, economic, or financial theories to process input data into quantitative estimates.\" Simple arithmetic, deterministic rule-based processes, or software without statistical, economic, or financial theories underpinning their design or use are generally outside SR 26-2’s definition of a model. Within ValidMind, a model is a type of record tracked in the inventory.\n", "\n", diff --git a/notebooks/templates/about-validmind/_about-validmind-monitoring.ipynb b/notebooks/templates/about-validmind/_about-validmind-monitoring.ipynb index 5fdb4d43c..d792ea252 100644 --- a/notebooks/templates/about-validmind/_about-validmind-monitoring.ipynb +++ b/notebooks/templates/about-validmind/_about-validmind-monitoring.ipynb @@ -44,7 +44,7 @@ "source": [ "### Key concepts\n", "\n", - "**record**: A tool tracked in the ValidMind inventory, such as a model. Records include traditional statistical models, legacy systems, artificial intelligence/machine learning models, large language models (LLMs), agentic AI systems, and other documentable items that benefit from oversight, testing, and lifecycle management.\n", + "**record**: A tool tracked in the ValidMind inventory. Records include traditional statistical models, legacy systems, artificial intelligence/machine learning models, large language models (LLMs), agentic AI systems, and other documentable items that benefit from oversight, testing, and lifecycle management.\n", "\n", "**model**: [SR 26-2](https://www.federalreserve.gov/supervisionreg/srletters/SR2602.htm) (which supersedes SR 11-7) defines a model as a \"complex quantitative method, system, or approach that applies statistical, economic, or financial theories to process input data into quantitative estimates.\" Simple arithmetic, deterministic rule-based processes, or software without statistical, economic, or financial theories underpinning their design or use are generally outside SR 26-2’s definition of a model. Within ValidMind, a model is a type of record tracked in the inventory.\n", "\n", diff --git a/notebooks/templates/about-validmind/_about-validmind-validators.ipynb b/notebooks/templates/about-validmind/_about-validmind-validators.ipynb index 79bf0adc8..3c1f3933b 100644 --- a/notebooks/templates/about-validmind/_about-validmind-validators.ipynb +++ b/notebooks/templates/about-validmind/_about-validmind-validators.ipynb @@ -44,7 +44,7 @@ "source": [ "### Key concepts\n", "\n", - "**record**: A tool tracked in the ValidMind inventory, such as a model. Records include traditional statistical models, legacy systems, artificial intelligence/machine learning models, large language models (LLMs), agentic AI systems, and other documentable items that benefit from oversight, testing, and lifecycle management.\n", + "**record**: A tool tracked in the ValidMind inventory. Records include traditional statistical models, legacy systems, artificial intelligence/machine learning models, large language models (LLMs), agentic AI systems, and other documentable items that benefit from oversight, testing, and lifecycle management.\n", "\n", "**model**: [SR 26-2](https://www.federalreserve.gov/supervisionreg/srletters/SR2602.htm) (which supersedes SR 11-7) defines a model as a \"complex quantitative method, system, or approach that applies statistical, economic, or financial theories to process input data into quantitative estimates.\" Simple arithmetic, deterministic rule-based processes, or software without statistical, economic, or financial theories underpinning their design or use are generally outside SR 26-2’s definition of a model. Within ValidMind, a model is a type of record tracked in the inventory.\n", "\n", diff --git a/notebooks/templates/install-validmind/_install-initialize-with-development.ipynb b/notebooks/templates/install-validmind/_install-initialize-with-development.ipynb index d536d6361..6e1afc8b9 100644 --- a/notebooks/templates/install-validmind/_install-initialize-with-development.ipynb +++ b/notebooks/templates/install-validmind/_install-initialize-with-development.ipynb @@ -94,7 +94,7 @@ "\n", "2. Click **Copy snippet to clipboard**.\n", "\n", - "3. Next, [load your model identifier credentials from an `.env` file](https://docs.validmind.ai/developer/quickstart/store-credentials-in-env-file.html) or replace the placeholder with your own code snippet:\n", + "3. Next, [load your {record-type} identifier credentials from an `.env` file](https://docs.validmind.ai/developer/quickstart/store-credentials-in-env-file.html) or replace the placeholder with your own code snippet:\n", "If your organization authenticates with OAuth 2.0 / OIDC instead of API keys, see [Authenticate with OIDC device flow](https://docs.validmind.ai/developer/quickstart/authenticate-with-oidc-device-flow.html) or try the [OIDC device-flow quickstart notebook](https://docs.validmind.ai/notebooks/quickstart/quickstart_model_documentation_oidc_device_flow.html).\n" ] }, @@ -105,7 +105,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Load your model identifier credentials from an `.env` file\n", + "# Load your {record-type} identifier credentials from an `.env` file\n", "\n", "%load_ext dotenv\n", "%dotenv .env\n", diff --git a/notebooks/templates/install-validmind/_install-initialize-with-monitoring.ipynb b/notebooks/templates/install-validmind/_install-initialize-with-monitoring.ipynb index 2ca2714f8..38a0ef572 100644 --- a/notebooks/templates/install-validmind/_install-initialize-with-monitoring.ipynb +++ b/notebooks/templates/install-validmind/_install-initialize-with-monitoring.ipynb @@ -94,7 +94,7 @@ "\n", "2. Click **Copy snippet to clipboard**.\n", "\n", - "3. Next, [load your model identifier credentials from an `.env` file](https://docs.validmind.ai/developer/quickstart/store-credentials-in-env-file.html) or replace the placeholder with your own code snippet:\n", + "3. Next, [load your {record-type} identifier credentials from an `.env` file](https://docs.validmind.ai/developer/quickstart/store-credentials-in-env-file.html) or replace the placeholder with your own code snippet:\n", "If your organization authenticates with OAuth 2.0 / OIDC instead of API keys, see [Authenticate with OIDC device flow](https://docs.validmind.ai/developer/quickstart/authenticate-with-oidc-device-flow.html) or try the [OIDC device-flow quickstart notebook](https://docs.validmind.ai/notebooks/quickstart/quickstart_model_documentation_oidc_device_flow.html).\n" ] }, @@ -105,7 +105,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Load your model identifier credentials from an `.env` file\n", + "# Load your {record-type} identifier credentials from an `.env` file\n", "\n", "%load_ext dotenv\n", "%dotenv .env\n", diff --git a/notebooks/templates/install-validmind/_install-initialize-with-validation.ipynb b/notebooks/templates/install-validmind/_install-initialize-with-validation.ipynb index 28d669f1e..6d1db926e 100644 --- a/notebooks/templates/install-validmind/_install-initialize-with-validation.ipynb +++ b/notebooks/templates/install-validmind/_install-initialize-with-validation.ipynb @@ -124,7 +124,7 @@ "\n", "2. Click **Copy snippet to clipboard**.\n", "\n", - "3. Next, [load your model identifier credentials from an `.env` file](https://docs.validmind.ai/developer/quickstart/store-credentials-in-env-file.html) or replace the placeholder with your own code snippet:\n", + "3. Next, [load your {record-type} identifier credentials from an `.env` file](https://docs.validmind.ai/developer/quickstart/store-credentials-in-env-file.html) or replace the placeholder with your own code snippet:\n", "If your organization authenticates with OAuth 2.0 / OIDC instead of API keys, see [Authenticate with OIDC device flow](https://docs.validmind.ai/developer/quickstart/authenticate-with-oidc-device-flow.html) or try the [OIDC device-flow quickstart notebook](https://docs.validmind.ai/notebooks/quickstart/quickstart_model_documentation_oidc_device_flow.html).\n" ] }, @@ -135,7 +135,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Load your model identifier credentials from an `.env` file\n", + "# Load your {record-type} identifier credentials from an `.env` file\n", "\n", "%load_ext dotenv\n", "%dotenv .env\n", From 5e1a50a645fa6a6cd50f5d94f27d180808eb6bbc Mon Sep 17 00:00:00 2001 From: Juan Date: Fri, 2 Oct 2026 10:27:33 +0200 Subject: [PATCH 3/5] Harden record type prompt in notebook templating [sc-16131] - Escape the record type before writing it into the notebook, so a custom value with quotes or backslashes no longer produces an unreadable file - Re-prompt on input other than 1-5 or Enter instead of taking a typo as a custom record type - Name the inventory directly in the register step now that the record type is known Co-Authored-By: Claude Opus 5.5 --- notebooks/templates/e2e_template.py | 10 ++++++---- .../_install-initialize-with-development.ipynb | 2 +- .../_install-initialize-with-monitoring.ipynb | 2 +- .../_install-initialize-with-validation.ipynb | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/notebooks/templates/e2e_template.py b/notebooks/templates/e2e_template.py index e54cc3f0b..276ff20df 100644 --- a/notebooks/templates/e2e_template.py +++ b/notebooks/templates/e2e_template.py @@ -364,6 +364,10 @@ def select_record_type( "[5: Custom (enter free text)], " "or press Enter for Model: " ).strip() + while choice and choice not in RECORD_TYPES and choice != "5": + choice = input_func( + f"'{choice}' is not an option. Enter 1-5, or press Enter for Model: " + ).strip() if not choice: selected = DEFAULT_RECORD_TYPE @@ -378,9 +382,6 @@ def select_record_type( selected = DEFAULT_RECORD_TYPE else: selected = custom - else: - # Allow typing a known label or any free-text record type directly. - selected = choice _selected_record = selected print_func(f"Selected record type: {_selected_record}") @@ -409,7 +410,8 @@ def replace_record_type( if "{record-type}" not in content: return - content = content.replace("{record-type}", value) + # Escape for the notebook's JSON so quotes or backslashes in a custom value don't break the file + content = content.replace("{record-type}", json.dumps(value, ensure_ascii=False)[1:-1]) with open(filepath, "w", encoding="utf-8") as f: if not content.endswith("\n"): content += "\n" diff --git a/notebooks/templates/install-validmind/_install-initialize-with-development.ipynb b/notebooks/templates/install-validmind/_install-initialize-with-development.ipynb index 6e1afc8b9..0ca2d5989 100644 --- a/notebooks/templates/install-validmind/_install-initialize-with-development.ipynb +++ b/notebooks/templates/install-validmind/_install-initialize-with-development.ipynb @@ -53,7 +53,7 @@ "\n", "2. In the left sidebar, select **Inventory**.\n", "\n", - "3. Select `{record-type}` by clicking on **{Record} Inventory**, where `{Record}` is the currently active type of record. (Learn more: [Register records in the inventory](https://docs.validmind.ai/guide/inventory/register-records-in-inventory.html))\n", + "3. Click **{record-type} Inventory**. (Learn more: [Register records in the inventory](https://docs.validmind.ai/guide/inventory/register-records-in-inventory.html))\n", "4. Click **+ Register {record-type}**.\n", "\n", "5. Enter the {record-type} details and click **Next >** to continue to assignment of inventory record stakeholders.\n", diff --git a/notebooks/templates/install-validmind/_install-initialize-with-monitoring.ipynb b/notebooks/templates/install-validmind/_install-initialize-with-monitoring.ipynb index 38a0ef572..2a6331aeb 100644 --- a/notebooks/templates/install-validmind/_install-initialize-with-monitoring.ipynb +++ b/notebooks/templates/install-validmind/_install-initialize-with-monitoring.ipynb @@ -53,7 +53,7 @@ "\n", "2. In the left sidebar, select **Inventory**.\n", "\n", - "3. Select `{record-type}` by clicking on **{Record} Inventory**, where `{Record}` is the currently active type of record. (Learn more: [Register records in the inventory](https://docs.validmind.ai/guide/inventory/register-records-in-inventory.html))\n", + "3. Click **{record-type} Inventory**. (Learn more: [Register records in the inventory](https://docs.validmind.ai/guide/inventory/register-records-in-inventory.html))\n", "4. Click **+ Register {record-type}**.\n", "\n", "5. Enter the {record-type} details and click **Next >** to continue to assignment of inventory record stakeholders.\n", diff --git a/notebooks/templates/install-validmind/_install-initialize-with-validation.ipynb b/notebooks/templates/install-validmind/_install-initialize-with-validation.ipynb index 6d1db926e..82e3aa1dd 100644 --- a/notebooks/templates/install-validmind/_install-initialize-with-validation.ipynb +++ b/notebooks/templates/install-validmind/_install-initialize-with-validation.ipynb @@ -23,7 +23,7 @@ "\n", "2. In the left sidebar, select **Inventory**.\n", "\n", - "3. Select `{record-type}` by clicking on **{Record} Inventory**, where `{Record}` is the currently active type of record. (Learn more: [Register records in the inventory](https://docs.validmind.ai/guide/inventory/register-records-in-inventory.html))\n", + "3. Click **{record-type} Inventory**. (Learn more: [Register records in the inventory](https://docs.validmind.ai/guide/inventory/register-records-in-inventory.html))\n", "4. Click **+ Register {record-type}**.\n", "\n", "5. Enter the {record-type} details and click **Next >** to continue to assignment of inventory record stakeholders.\n", From b0384b6cb1cabcb7e084cdf7c8ac2f1c48dc7265 Mon Sep 17 00:00:00 2001 From: Juan Date: Fri, 2 Oct 2026 10:38:08 +0200 Subject: [PATCH 4/5] Use lowercase record type in notebook prose [sc-16131] - Add a {record-type-lower} placeholder for sentences ("your agent") and keep {record-type} for UI labels ("Register Agent") - Lowercase only the built-in types; custom values stay as typed - Document both placeholders in the templates README Co-Authored-By: Claude Opus 5.5 --- notebooks/templates/README.md | 2 +- notebooks/templates/e2e_template.py | 10 ++++++--- ..._install-initialize-with-development.ipynb | 22 +++++++++---------- .../_install-initialize-with-monitoring.ipynb | 22 +++++++++---------- .../_install-initialize-with-validation.ipynb | 22 +++++++++---------- .../next-steps/_next-steps-development.ipynb | 4 ++-- .../next-steps/_next-steps-monitoring.ipynb | 4 ++-- .../next-steps/_next-steps-validation.ipynb | 4 ++-- 8 files changed, 47 insertions(+), 43 deletions(-) diff --git a/notebooks/templates/README.md b/notebooks/templates/README.md index 85a08a453..66dd45d44 100644 --- a/notebooks/templates/README.md +++ b/notebooks/templates/README.md @@ -11,7 +11,7 @@ make notebook During generation you'll choose: 1. A **role / document type** (development, validation, or monitoring) that selects which mini-template variants to append. -2. An **inventory record type** (Model by default, Agent, Use Case, Tool, or custom free text) that fills `{record-type}` placeholders in install and next-steps mini-templates. +2. An **inventory record type** (Model by default, Agent, Use Case, Tool, or custom free text) that fills placeholders in install and next-steps mini-templates: `{record-type}` for UI labels (for example, **Register Agent**) and `{record-type-lower}` in sentences (for example, "your agent"). Custom values are used as typed in both. ## Mini-templates The template generation script/notebook draws from the following mini-templates, should you need to revise them or grab the information from them manually: diff --git a/notebooks/templates/e2e_template.py b/notebooks/templates/e2e_template.py index 276ff20df..6de57a2fb 100644 --- a/notebooks/templates/e2e_template.py +++ b/notebooks/templates/e2e_template.py @@ -394,7 +394,7 @@ def replace_record_type( record_type_value: Optional[str] = None, print_func: Callable[[str], None] = print, ) -> None: - """Replace `{record-type}` placeholders in a notebook file. + """Replace `{record-type}` (UI labels) and `{record-type-lower}` (prose) placeholders in a notebook file. Uses `record_type_value` when provided; otherwise falls back to the value stored by `select_record_type()`. Defaults to Model when neither is set. @@ -403,15 +403,19 @@ def replace_record_type( if not value: value = DEFAULT_RECORD_TYPE + # Built-in types are capitalised for UI labels; lowercase them in prose. Custom values stay as typed. + lower = value.lower() if value in RECORD_TYPES.values() else value + try: with open(filepath, "r", encoding="utf-8") as f: content = f.read() - if "{record-type}" not in content: + if "{record-type" not in content: return # Escape for the notebook's JSON so quotes or backslashes in a custom value don't break the file - content = content.replace("{record-type}", json.dumps(value, ensure_ascii=False)[1:-1]) + for placeholder, text in (("{record-type-lower}", lower), ("{record-type}", value)): + content = content.replace(placeholder, json.dumps(text, ensure_ascii=False)[1:-1]) with open(filepath, "w", encoding="utf-8") as f: if not content.endswith("\n"): content += "\n" diff --git a/notebooks/templates/install-validmind/_install-initialize-with-development.ipynb b/notebooks/templates/install-validmind/_install-initialize-with-development.ipynb index 0ca2d5989..44c42dc80 100644 --- a/notebooks/templates/install-validmind/_install-initialize-with-development.ipynb +++ b/notebooks/templates/install-validmind/_install-initialize-with-development.ipynb @@ -47,7 +47,7 @@ "source": [ "#### Register sample {record-type}\n", "\n", - "Let's first register a sample record ({record-type}) for use with this notebook.\n", + "Let's first register a sample record ({record-type-lower}) for use with this notebook.\n", "\n", "1. In a browser, [log in to ValidMind](https://docs.validmind.ai/guide/access/log-in-to-validmind.html).\n", "\n", @@ -56,11 +56,11 @@ "3. Click **{record-type} Inventory**. (Learn more: [Register records in the inventory](https://docs.validmind.ai/guide/inventory/register-records-in-inventory.html))\n", "4. Click **+ Register {record-type}**.\n", "\n", - "5. Enter the {record-type} details and click **Next >** to continue to assignment of inventory record stakeholders.\n", + "5. Enter the {record-type-lower} details and click **Next >** to continue to assignment of inventory record stakeholders.\n", "\n", "6. Select your own name under the **Record Owner** drop-down.\n", "\n", - "7. Click **Register {record-type}** to add the {record-type} to your inventory." + "7. Click **Register {record-type}** to add the {record-type-lower} to your inventory." ] }, { @@ -70,11 +70,11 @@ "source": [ "#### Apply documentation template\n", "\n", - "Once you've registered your {record-type}, let's select a documentation template. A template predefines sections for your documentation and provides a general outline to follow, making the documentation process much easier.\n", + "Once you've registered your {record-type-lower}, let's select a documentation template. A template predefines sections for your documentation and provides a general outline to follow, making the documentation process much easier.\n", "\n", - "1. In the left sidebar that appears for your {record-type}, click **Documents** and select **Development**.\n", + "1. In the left sidebar that appears for your {record-type-lower}, click **Documents** and select **Development**.\n", "\n", - " If you cannot locate your Development document, make sure Development type documents are enabled for {record-type} records and create a new document. (**Learn more:** [Manage documents](https://docs.validmind.ai/guide/templates/manage-documents.html#add-record-documents))\n", + " If you cannot locate your Development document, make sure Development type documents are enabled for {record-type-lower} records and create a new document. (**Learn more:** [Manage documents](https://docs.validmind.ai/guide/templates/manage-documents.html#add-record-documents))\n", "\n", "2. Under **Template**, select `{template}`.\n", "\n", @@ -90,11 +90,11 @@ "\n", "Initialize the ValidMind Library with the *code snippet* unique to each record per document, ensuring your test results are uploaded to the correct record and automatically populated in the right document in the ValidMind Platform when you run the Library.\n", "\n", - "1. On the left sidebar that appears for your {record-type}, select **Getting Started** and select `Development` from the **Document** drop-down menu.\n", + "1. On the left sidebar that appears for your {record-type-lower}, select **Getting Started** and select `Development` from the **Document** drop-down menu.\n", "\n", "2. Click **Copy snippet to clipboard**.\n", "\n", - "3. Next, [load your {record-type} identifier credentials from an `.env` file](https://docs.validmind.ai/developer/quickstart/store-credentials-in-env-file.html) or replace the placeholder with your own code snippet:\n", + "3. Next, [load your {record-type-lower} identifier credentials from an `.env` file](https://docs.validmind.ai/developer/quickstart/store-credentials-in-env-file.html) or replace the placeholder with your own code snippet:\n", "If your organization authenticates with OAuth 2.0 / OIDC instead of API keys, see [Authenticate with OIDC device flow](https://docs.validmind.ai/developer/quickstart/authenticate-with-oidc-device-flow.html) or try the [OIDC device-flow quickstart notebook](https://docs.validmind.ai/notebooks/quickstart/quickstart_model_documentation_oidc_device_flow.html).\n" ] }, @@ -105,7 +105,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Load your {record-type} identifier credentials from an `.env` file\n", + "# Load your {record-type-lower} identifier credentials from an `.env` file\n", "\n", "%load_ext dotenv\n", "%dotenv .env\n", @@ -130,9 +130,9 @@ "source": [ "### Preview the documentation template\n", "\n", - "Let's verify that you have connected the ValidMind Library to the ValidMind Platform and that the appropriate *template* is selected for your {record-type}.\n", + "Let's verify that you have connected the ValidMind Library to the ValidMind Platform and that the appropriate *template* is selected for your {record-type-lower}.\n", "\n", - "You will upload documentation and test results unique to your {record-type} based on this template later on. For now, **take a look at the default structure that the template provides with [the `vm.preview_template()` function](https://docs.validmind.ai/validmind/validmind.html#preview_template)** from the ValidMind library and note the empty sections:" + "You will upload documentation and test results unique to your {record-type-lower} based on this template later on. For now, **take a look at the default structure that the template provides with [the `vm.preview_template()` function](https://docs.validmind.ai/validmind/validmind.html#preview_template)** from the ValidMind library and note the empty sections:" ] }, { diff --git a/notebooks/templates/install-validmind/_install-initialize-with-monitoring.ipynb b/notebooks/templates/install-validmind/_install-initialize-with-monitoring.ipynb index 2a6331aeb..36187920e 100644 --- a/notebooks/templates/install-validmind/_install-initialize-with-monitoring.ipynb +++ b/notebooks/templates/install-validmind/_install-initialize-with-monitoring.ipynb @@ -47,7 +47,7 @@ "source": [ "#### Register sample {record-type}\n", "\n", - "Let's first register a sample record ({record-type}) for use with this notebook.\n", + "Let's first register a sample record ({record-type-lower}) for use with this notebook.\n", "\n", "1. In a browser, [log in to ValidMind](https://docs.validmind.ai/guide/access/log-in-to-validmind.html).\n", "\n", @@ -56,11 +56,11 @@ "3. Click **{record-type} Inventory**. (Learn more: [Register records in the inventory](https://docs.validmind.ai/guide/inventory/register-records-in-inventory.html))\n", "4. Click **+ Register {record-type}**.\n", "\n", - "5. Enter the {record-type} details and click **Next >** to continue to assignment of inventory record stakeholders.\n", + "5. Enter the {record-type-lower} details and click **Next >** to continue to assignment of inventory record stakeholders.\n", "\n", "6. Select your own name under the **Record Owner** drop-down.\n", "\n", - "7. Click **Register {record-type}** to add the {record-type} to your inventory." + "7. Click **Register {record-type}** to add the {record-type-lower} to your inventory." ] }, { @@ -70,11 +70,11 @@ "source": [ "#### Apply monitoring report template\n", "\n", - "Once you've registered your {record-type}, let's select a monitoring report template. A template predefines sections for your monitoring report and provides a general outline to follow, making the monitoring process much easier.\n", + "Once you've registered your {record-type-lower}, let's select a monitoring report template. A template predefines sections for your monitoring report and provides a general outline to follow, making the monitoring process much easier.\n", "\n", - "1. In the left sidebar that appears for your {record-type}, click **Documents** and select **Monitoring**.\n", + "1. In the left sidebar that appears for your {record-type-lower}, click **Documents** and select **Monitoring**.\n", "\n", - " If you cannot locate your Monitoring document, make sure Monitoring type documents are enabled for {record-type} records and create a new document. (**Learn more:** [Manage documents](https://docs.validmind.ai/guide/templates/manage-documents.html#add-record-documents))\n", + " If you cannot locate your Monitoring document, make sure Monitoring type documents are enabled for {record-type-lower} records and create a new document. (**Learn more:** [Manage documents](https://docs.validmind.ai/guide/templates/manage-documents.html#add-record-documents))\n", "\n", "2. Under **Template**, select `{template}`.\n", "\n", @@ -90,11 +90,11 @@ "\n", "Initialize the ValidMind Library with the *code snippet* unique to each record per document, ensuring your test results are uploaded to the correct record and automatically populated in the right document in the ValidMind Platform when you run the Library.\n", "\n", - "1. On the left sidebar that appears for your {record-type}, select **Getting Started** and select `Monitoring` from the **Document** drop-down menu.\n", + "1. On the left sidebar that appears for your {record-type-lower}, select **Getting Started** and select `Monitoring` from the **Document** drop-down menu.\n", "\n", "2. Click **Copy snippet to clipboard**.\n", "\n", - "3. Next, [load your {record-type} identifier credentials from an `.env` file](https://docs.validmind.ai/developer/quickstart/store-credentials-in-env-file.html) or replace the placeholder with your own code snippet:\n", + "3. Next, [load your {record-type-lower} identifier credentials from an `.env` file](https://docs.validmind.ai/developer/quickstart/store-credentials-in-env-file.html) or replace the placeholder with your own code snippet:\n", "If your organization authenticates with OAuth 2.0 / OIDC instead of API keys, see [Authenticate with OIDC device flow](https://docs.validmind.ai/developer/quickstart/authenticate-with-oidc-device-flow.html) or try the [OIDC device-flow quickstart notebook](https://docs.validmind.ai/notebooks/quickstart/quickstart_model_documentation_oidc_device_flow.html).\n" ] }, @@ -105,7 +105,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Load your {record-type} identifier credentials from an `.env` file\n", + "# Load your {record-type-lower} identifier credentials from an `.env` file\n", "\n", "%load_ext dotenv\n", "%dotenv .env\n", @@ -130,9 +130,9 @@ "source": [ "### Preview the monitoring report template\n", "\n", - "Let's verify that you have connected the ValidMind Library to the ValidMind Platform and that the appropriate *template* is selected for your {record-type}.\n", + "Let's verify that you have connected the ValidMind Library to the ValidMind Platform and that the appropriate *template* is selected for your {record-type-lower}.\n", "\n", - "You will upload documentation and test results unique to your {record-type} based on this template later on. For now, **take a look at the default structure that the template provides with [the `vm.preview_template()` function](https://docs.validmind.ai/validmind/validmind.html#preview_template)** from the ValidMind library and note the empty sections:" + "You will upload documentation and test results unique to your {record-type-lower} based on this template later on. For now, **take a look at the default structure that the template provides with [the `vm.preview_template()` function](https://docs.validmind.ai/validmind/validmind.html#preview_template)** from the ValidMind library and note the empty sections:" ] }, { diff --git a/notebooks/templates/install-validmind/_install-initialize-with-validation.ipynb b/notebooks/templates/install-validmind/_install-initialize-with-validation.ipynb index 82e3aa1dd..cdf8f1bc1 100644 --- a/notebooks/templates/install-validmind/_install-initialize-with-validation.ipynb +++ b/notebooks/templates/install-validmind/_install-initialize-with-validation.ipynb @@ -17,7 +17,7 @@ "\n", "In a usual lifecycle, a champion will have been independently registered in your inventory and submitted to you for validation by your development team as part of the effective challenge process. (**Learn more:** [Submit documents](https://docs.validmind.ai/guide/documentation/submit-documents.html))\n", "\n", - "For this notebook, we'll have you register a dummy record ({record-type}) in the ValidMind Platform inventory and assign yourself as the validator to familiarize you with the ValidMind interface and circumvent the need for an existing {record-type}:\n", + "For this notebook, we'll have you register a dummy record ({record-type-lower}) in the ValidMind Platform inventory and assign yourself as the validator to familiarize you with the ValidMind interface and circumvent the need for an existing {record-type-lower}:\n", "\n", "1. In a browser, [log in to ValidMind](https://docs.validmind.ai/guide/access/log-in-to-validmind.html).\n", "\n", @@ -26,11 +26,11 @@ "3. Click **{record-type} Inventory**. (Learn more: [Register records in the inventory](https://docs.validmind.ai/guide/inventory/register-records-in-inventory.html))\n", "4. Click **+ Register {record-type}**.\n", "\n", - "5. Enter the {record-type} details and click **Next >** to continue to assignment of inventory record stakeholders.\n", + "5. Enter the {record-type-lower} details and click **Next >** to continue to assignment of inventory record stakeholders.\n", "\n", "6. Select your own name under the **Record Owner** drop-down — don’t worry, we’ll adjust these permissions next for validation.\n", "\n", - "7. Click **Register {record-type}** to add the {record-type} to your inventory." + "7. Click **Register {record-type}** to add the {record-type-lower} to your inventory." ] }, { @@ -40,18 +40,18 @@ "source": [ "#### Assign validator credentials\n", "\n", - "In order to log tests as a validator instead of as a developer, on the details page that appears after you've successfully registered your sample {record-type}:\n", + "In order to log tests as a validator instead of as a developer, on the details page that appears after you've successfully registered your sample {record-type-lower}:\n", "\n", "1. Remove yourself as an owner:\n", "\n", " - Click on the **Owners** tile.\n", - " - Click the **x** next to your name to remove yourself from that {record-type}'s role.\n", + " - Click the **x** next to your name to remove yourself from that {record-type-lower}'s role.\n", " - Click **Save** to apply your changes to that role.\n", "\n", "2. Remove yourself as a developer:\n", "\n", " - Click on the **Developers** tile.\n", - " - Click the **x** next to your name to remove yourself from that {record-type}'s role.\n", + " - Click the **x** next to your name to remove yourself from that {record-type-lower}'s role.\n", " - Click **Save** to apply your changes to that role.\n", "\n", "3. Add yourself as a validator:\n", @@ -70,9 +70,9 @@ "\n", "Next, let's select a validation report template. A template predefines sections for your report and provides a general outline to follow, making the validation process much easier.\n", "\n", - "1. In the left sidebar that appears for your {record-type}, click **Documents** and select **Validation**.\n", + "1. In the left sidebar that appears for your {record-type-lower}, click **Documents** and select **Validation**.\n", "\n", - " If you cannot locate your Validation document, make sure Validation type documents are enabled for {record-type} records and create a new document. (**Learn more:** [Manage documents](https://docs.validmind.ai/guide/templates/manage-documents.html#add-record-documents))\n", + " If you cannot locate your Validation document, make sure Validation type documents are enabled for {record-type-lower} records and create a new document. (**Learn more:** [Manage documents](https://docs.validmind.ai/guide/templates/manage-documents.html#add-record-documents))\n", "\n", "2. Under **Template**, select `{template}`.\n", "\n", @@ -120,11 +120,11 @@ "\n", "Initialize the ValidMind Library with the *code snippet* unique to each record per document, ensuring your test results are uploaded to the correct record and automatically populated in the right document in the ValidMind Platform when you run the Library.\n", "\n", - "1. On the left sidebar that appears for your {record-type}, select **Getting Started** and select `Validation` from the **Document** drop-down menu.\n", + "1. On the left sidebar that appears for your {record-type-lower}, select **Getting Started** and select `Validation` from the **Document** drop-down menu.\n", "\n", "2. Click **Copy snippet to clipboard**.\n", "\n", - "3. Next, [load your {record-type} identifier credentials from an `.env` file](https://docs.validmind.ai/developer/quickstart/store-credentials-in-env-file.html) or replace the placeholder with your own code snippet:\n", + "3. Next, [load your {record-type-lower} identifier credentials from an `.env` file](https://docs.validmind.ai/developer/quickstart/store-credentials-in-env-file.html) or replace the placeholder with your own code snippet:\n", "If your organization authenticates with OAuth 2.0 / OIDC instead of API keys, see [Authenticate with OIDC device flow](https://docs.validmind.ai/developer/quickstart/authenticate-with-oidc-device-flow.html) or try the [OIDC device-flow quickstart notebook](https://docs.validmind.ai/notebooks/quickstart/quickstart_model_documentation_oidc_device_flow.html).\n" ] }, @@ -135,7 +135,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Load your {record-type} identifier credentials from an `.env` file\n", + "# Load your {record-type-lower} identifier credentials from an `.env` file\n", "\n", "%load_ext dotenv\n", "%dotenv .env\n", diff --git a/notebooks/templates/next-steps/_next-steps-development.ipynb b/notebooks/templates/next-steps/_next-steps-development.ipynb index dbc87f104..cb29c0d81 100644 --- a/notebooks/templates/next-steps/_next-steps-development.ipynb +++ b/notebooks/templates/next-steps/_next-steps-development.ipynb @@ -17,9 +17,9 @@ "source": [ "### Work with your documentation\n", "\n", - "1. From the **Inventory** in the ValidMind Platform, go to the {record-type} you registered earlier. (Learn more: [Working with the inventory](https://docs.validmind.ai/guide/inventory/working-with-the-inventory.html))\n", + "1. From the **Inventory** in the ValidMind Platform, go to the {record-type-lower} you registered earlier. (Learn more: [Working with the inventory](https://docs.validmind.ai/guide/inventory/working-with-the-inventory.html))\n", "\n", - "2. In the left sidebar that appears for your {record-type}, click **Development** under Documents.\n", + "2. In the left sidebar that appears for your {record-type-lower}, click **Development** under Documents.\n", "\n", "What you see is the full draft of your documentation in a more easily consumable version. From here, you can make qualitative edits to documentation, view guidelines, collaborate with validators, and submit your documentation for approval when it's ready. (**Learn more:** [Working with documentation](https://docs.validmind.ai/guide/documentation/working-with-documentation.html))" ] diff --git a/notebooks/templates/next-steps/_next-steps-monitoring.ipynb b/notebooks/templates/next-steps/_next-steps-monitoring.ipynb index 516b5cd69..610ac2c56 100644 --- a/notebooks/templates/next-steps/_next-steps-monitoring.ipynb +++ b/notebooks/templates/next-steps/_next-steps-monitoring.ipynb @@ -17,9 +17,9 @@ "source": [ "### Work with your monitoring report\n", "\n", - "1. From the **Inventory** in the ValidMind Platform, go to the {record-type} you registered earlier. (Learn more: [Working with the inventory](https://docs.validmind.ai/guide/inventory/working-with-the-inventory.html))\n", + "1. From the **Inventory** in the ValidMind Platform, go to the {record-type-lower} you registered earlier. (Learn more: [Working with the inventory](https://docs.validmind.ai/guide/inventory/working-with-the-inventory.html))\n", "\n", - "2. In the left sidebar that appears for your {record-type}, click **Monitoring** under Documents.\n", + "2. In the left sidebar that appears for your {record-type-lower}, click **Monitoring** under Documents.\n", "\n", "What you see is the full draft of your monitoring report in a more easily consumable version. From here, you can make qualitative edits to monitoring reports, view guidelines, review monitoring results, and submit your monitoring report for approval when it's ready. (**Learn more:** [Ongoing monitoring](https://docs.validmind.ai/guide/monitoring/ongoing-monitoring.html))" ] diff --git a/notebooks/templates/next-steps/_next-steps-validation.ipynb b/notebooks/templates/next-steps/_next-steps-validation.ipynb index 9d28e2893..52b63ac93 100644 --- a/notebooks/templates/next-steps/_next-steps-validation.ipynb +++ b/notebooks/templates/next-steps/_next-steps-validation.ipynb @@ -19,9 +19,9 @@ "\n", "Now that you've logged all your test results and verified the work done by the development team, head to the ValidMind Platform to wrap up your validation report:\n", "\n", - "1. From the **Inventory** in the ValidMind Platform, go to the {record-type} you connected to earlier.\n", + "1. From the **Inventory** in the ValidMind Platform, go to the {record-type-lower} you connected to earlier.\n", "\n", - "2. In the left sidebar that appears for your {record-type}, click **Validation** under Documents.\n", + "2. In the left sidebar that appears for your {record-type-lower}, click **Validation** under Documents.\n", "\n", "Include your logged test results as evidence, create risk assessment notes, add artifacts, and assess compliance, then submit your report for review when it's ready. (**Learn more:** [Preparing validation reports](https://docs.validmind.ai/guide/validation/preparing-validation-reports.html))" ] From fe87b135fadc960354da726c59646ce4e50e0832 Mon Sep 17 00:00:00 2001 From: Juan Date: Fri, 2 Oct 2026 19:57:22 +0200 Subject: [PATCH 5/5] Accept a typed custom record type and point step 3 at the inventory dropdown Co-Authored-By: Claude Opus 5.5 (1M context) --- notebooks/templates/e2e-notebook.ipynb | 2 +- notebooks/templates/e2e_template.py | 7 +++++-- .../_install-initialize-with-development.ipynb | 2 +- .../_install-initialize-with-monitoring.ipynb | 2 +- .../_install-initialize-with-validation.ipynb | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/notebooks/templates/e2e-notebook.ipynb b/notebooks/templates/e2e-notebook.ipynb index 518cf0f64..f1372e9fa 100644 --- a/notebooks/templates/e2e-notebook.ipynb +++ b/notebooks/templates/e2e-notebook.ipynb @@ -156,7 +156,7 @@ "4. Tool\n", "5. Custom (enter free text)\n", "\n", - "You can also type a custom record type name directly instead of choosing a numbered option." + "You can also type a custom record type name (for example, `Agent System`) directly instead of choosing a number." ] }, { diff --git a/notebooks/templates/e2e_template.py b/notebooks/templates/e2e_template.py index 6de57a2fb..ccc1c8813 100644 --- a/notebooks/templates/e2e_template.py +++ b/notebooks/templates/e2e_template.py @@ -364,9 +364,10 @@ def select_record_type( "[5: Custom (enter free text)], " "or press Enter for Model: " ).strip() - while choice and choice not in RECORD_TYPES and choice != "5": + # Any non-numeric text is taken as a custom record type; only unknown numbers re-prompt. + while choice.isdigit() and choice not in RECORD_TYPES and choice != "5": choice = input_func( - f"'{choice}' is not an option. Enter 1-5, or press Enter for Model: " + f"'{choice}' is not an option. Enter 1-5, a custom name, or press Enter for Model: " ).strip() if not choice: @@ -382,6 +383,8 @@ def select_record_type( selected = DEFAULT_RECORD_TYPE else: selected = custom + else: + selected = choice _selected_record = selected print_func(f"Selected record type: {_selected_record}") diff --git a/notebooks/templates/install-validmind/_install-initialize-with-development.ipynb b/notebooks/templates/install-validmind/_install-initialize-with-development.ipynb index 44c42dc80..c491213a8 100644 --- a/notebooks/templates/install-validmind/_install-initialize-with-development.ipynb +++ b/notebooks/templates/install-validmind/_install-initialize-with-development.ipynb @@ -53,7 +53,7 @@ "\n", "2. In the left sidebar, select **Inventory**.\n", "\n", - "3. Click **{record-type} Inventory**. (Learn more: [Register records in the inventory](https://docs.validmind.ai/guide/inventory/register-records-in-inventory.html))\n", + "3. From the dropdown at the top of the page, select **{record-type} Inventory**. (Learn more: [Register records in the inventory](https://docs.validmind.ai/guide/inventory/register-records-in-inventory.html))\n", "4. Click **+ Register {record-type}**.\n", "\n", "5. Enter the {record-type-lower} details and click **Next >** to continue to assignment of inventory record stakeholders.\n", diff --git a/notebooks/templates/install-validmind/_install-initialize-with-monitoring.ipynb b/notebooks/templates/install-validmind/_install-initialize-with-monitoring.ipynb index 36187920e..4de321846 100644 --- a/notebooks/templates/install-validmind/_install-initialize-with-monitoring.ipynb +++ b/notebooks/templates/install-validmind/_install-initialize-with-monitoring.ipynb @@ -53,7 +53,7 @@ "\n", "2. In the left sidebar, select **Inventory**.\n", "\n", - "3. Click **{record-type} Inventory**. (Learn more: [Register records in the inventory](https://docs.validmind.ai/guide/inventory/register-records-in-inventory.html))\n", + "3. From the dropdown at the top of the page, select **{record-type} Inventory**. (Learn more: [Register records in the inventory](https://docs.validmind.ai/guide/inventory/register-records-in-inventory.html))\n", "4. Click **+ Register {record-type}**.\n", "\n", "5. Enter the {record-type-lower} details and click **Next >** to continue to assignment of inventory record stakeholders.\n", diff --git a/notebooks/templates/install-validmind/_install-initialize-with-validation.ipynb b/notebooks/templates/install-validmind/_install-initialize-with-validation.ipynb index cdf8f1bc1..6d45f328b 100644 --- a/notebooks/templates/install-validmind/_install-initialize-with-validation.ipynb +++ b/notebooks/templates/install-validmind/_install-initialize-with-validation.ipynb @@ -23,7 +23,7 @@ "\n", "2. In the left sidebar, select **Inventory**.\n", "\n", - "3. Click **{record-type} Inventory**. (Learn more: [Register records in the inventory](https://docs.validmind.ai/guide/inventory/register-records-in-inventory.html))\n", + "3. From the dropdown at the top of the page, select **{record-type} Inventory**. (Learn more: [Register records in the inventory](https://docs.validmind.ai/guide/inventory/register-records-in-inventory.html))\n", "4. Click **+ Register {record-type}**.\n", "\n", "5. Enter the {record-type-lower} details and click **Next >** to continue to assignment of inventory record stakeholders.\n",