From 3fed8471383c707b5de04663489109e2a3d36f9f Mon Sep 17 00:00:00 2001 From: Shreya Shankar Date: Fri, 27 Sep 2024 13:25:10 -0700 Subject: [PATCH] Remove unnecessary name parameter from parallel map operation. --- docetl/operations/map.py | 8 +------- docs/operators/parallel-map.md | 1 - mkdocs.yml | 10 +++++----- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/docetl/operations/map.py b/docetl/operations/map.py index a4afd7f8..01f02a78 100644 --- a/docetl/operations/map.py +++ b/docetl/operations/map.py @@ -260,18 +260,12 @@ def syntax_check(self) -> None: if not isinstance(prompt_config, dict): raise TypeError(f"Prompt configuration {i} must be a dictionary") - required_keys = ["name", "prompt", "output_keys"] + required_keys = ["prompt", "output_keys"] for key in required_keys: if key not in prompt_config: raise ValueError( f"Missing required key '{key}' in prompt configuration {i}" ) - - if not isinstance(prompt_config["name"], str): - raise TypeError( - f"'name' in prompt configuration {i} must be a string" - ) - if not isinstance(prompt_config["prompt"], str): raise TypeError( f"'prompt' in prompt configuration {i} must be a string" diff --git a/docs/operators/parallel-map.md b/docs/operators/parallel-map.md index 8b8ac95a..20551b71 100644 --- a/docs/operators/parallel-map.md +++ b/docs/operators/parallel-map.md @@ -23,7 +23,6 @@ The output schema should include all the fields generated by the individual prom Each prompt configuration in the `prompts` list should contain: -- `name`: A unique name for the prompt - `prompt`: The prompt template to use for the transformation - `output_keys`: List of keys that this prompt will generate - `model` (optional): The language model to use for this specific prompt diff --git a/mkdocs.yml b/mkdocs.yml index 34f79b8c..fa8bab6f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -45,17 +45,17 @@ nav: # - User-Defined Functions: advanced/custom-operators.md # - Extending Optimizer Agents: advanced/extending-agents.md # - Performance Tuning: advanced/performance-tuning.md + - Examples: + - Reporting on Themes from Presidential Debates: examples/presidential-debate-themes.md + - Mining Product Reviews for Polarizing Features: examples/mining-product-reviews.md + # - Annotating Legal Documents: examples/annotating-legal-documents.md + # - Characterizing Troll Behavior on Wikipedia: examples/characterizing-troll-behavior.md - API Reference: - docetl: api-reference/docetl.md - docetl.cli: api-reference/cli.md - docetl.operations: api-reference/operations.md - docetl.optimizers: api-reference/optimizers.md - Python API: api-reference/python.md - - Examples: - - Reporting on Themes from Presidential Debates: examples/presidential-debate-themes.md - - Mining Product Reviews for Polarizing Features: examples/mining-product-reviews.md - # - Annotating Legal Documents: examples/annotating-legal-documents.md - # - Characterizing Troll Behavior on Wikipedia: examples/characterizing-troll-behavior.md - Community: - Community: community/index.md - Roadmap: community/roadmap.md