-
Notifications
You must be signed in to change notification settings - Fork 145
feat: add agent-helper CLI commands for schema introspection and type discovery #329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
4ff6a5a
feat: add agent-context CLI introspection
johnnygreco e6a42c8
fix: correct agent-context field descriptions in column configs
johnnygreco bf47dfd
feat: enhance pydantic and method inspectors with richer field details
johnnygreco 84f51c8
feat: add Field descriptions and docstrings to config models
johnnygreco 3689979
feat: enhance formatters with rich field display, dedup, and new form…
johnnygreco 1c3ff18
feat: add discovery for namespace tree, interface classes, and imports
johnnygreco fbae7e0
refactor: rename agent-context CLI to introspect and add new subcommands
johnnygreco b8efb5b
test: add CLI usage scenario integration tests
johnnygreco b0797b6
refactor: replace introspect command with types and reference command…
johnnygreco 0abeafb
refactor: update formatters and tests for new types/reference CLI str…
johnnygreco dd315e8
drop stale review
johnnygreco 7806b2b
refactor: replace hardcoded discovery functions with introspection-ba…
johnnygreco ef57f80
fix: improve introspection defaults and depth checks
johnnygreco 277a66f
fix: align enum output across text/json and remove dead try/except
johnnygreco 6e5ebc7
fix: surface namespace import failures in debug logs
johnnygreco 072af89
sort
johnnygreco a0a62d8
refactor introspection discovery and normalize typed schema output
johnnygreco 2a90c97
feat: add data-designer list-assets agent-helper command
johnnygreco 078894e
refactor: replace types/reference commands with inspect agent-helper
johnnygreco 78d897f
feat: add list agent-helper command group
johnnygreco b73ac3c
docs: clarify that constraints apply only to sampler columns
johnnygreco 90a3f6d
refactor: rename inspect "builder" subcommand to "config_builder"
johnnygreco 63762a7
docs: improve agent-helper CLI help descriptions for agent consumption
johnnygreco 87cba7b
fix: use hyphenated config-builder for CLI subcommand name
johnnygreco e550a69
docs: tighten agent-helper CLI help descriptions
johnnygreco 4707728
docs: use column header names in list command tips for clarity
johnnygreco 1a055f0
docs: sharpen inspect and list group-level help descriptions
johnnygreco f5fa650
refactor: remove related_inspect_tip from inspect command output
johnnygreco 8668ab2
refactor: remove dead code from introspection services
johnnygreco 152cc5f
fix: harden introspection service layer
johnnygreco 5c44caa
refactor: clean up IntrospectionController
johnnygreco 352be20
fix: harden ListController and eliminate DRY violation
johnnygreco aae3e6a
docs: polish help text and field description consistency
johnnygreco 0b9ea11
test: add coverage for introspection edge cases and crash paths
johnnygreco 3572057
refactor: simplify introspection inspectors without changing output
johnnygreco 8479392
refactor: lazy-load inspect CLI commands
johnnygreco c121a08
fix: restore agent-helper list CLI commands
johnnygreco File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,11 +56,22 @@ class SamplerColumnConfig(SingleColumnConfig): | |
| ``` | ||
| """ | ||
|
|
||
| sampler_type: SamplerType | ||
| params: Annotated[SamplerParamsT, Discriminator("sampler_type")] | ||
| conditional_params: dict[str, Annotated[SamplerParamsT, Discriminator("sampler_type")]] = {} | ||
| convert_to: str | None = None | ||
| column_type: Literal["sampler"] = "sampler" | ||
| sampler_type: SamplerType = Field( | ||
| description="Type of sampler to use (e.g., uuid, category, uniform, gaussian, person, datetime)" | ||
| ) | ||
| params: Annotated[SamplerParamsT, Discriminator("sampler_type")] = Field( | ||
| description="Parameters specific to the chosen sampler type" | ||
| ) | ||
| conditional_params: dict[str, Annotated[SamplerParamsT, Discriminator("sampler_type")]] = Field( | ||
| default_factory=dict, | ||
| description="Optional dictionary for conditional parameters; keys are conditions, values are params to use when met", | ||
| ) | ||
| convert_to: str | None = Field( | ||
| default=None, description="Optional type conversion after sampling: 'float', 'int', or 'str'" | ||
| ) | ||
| column_type: Literal["sampler"] = Field( | ||
| default="sampler", description="Discriminator field, always 'sampler' for this configuration type" | ||
| ) | ||
|
|
||
| @staticmethod | ||
| def get_column_emoji() -> str: | ||
|
|
@@ -136,14 +147,28 @@ class LLMTextColumnConfig(SingleColumnConfig): | |
| column_type: Discriminator field, always "llm-text" for this configuration type. | ||
| """ | ||
|
|
||
| prompt: str | ||
| model_alias: str | ||
| system_prompt: str | None = None | ||
| multi_modal_context: list[ImageContext] | None = None | ||
| tool_alias: str | None = None | ||
| with_trace: TraceType = TraceType.NONE | ||
| extract_reasoning_content: bool = False | ||
| column_type: Literal["llm-text"] = "llm-text" | ||
| prompt: str = Field( | ||
| description="Jinja2 template for the LLM prompt; can reference other columns via {{ column_name }}" | ||
| ) | ||
| model_alias: str = Field(description="Alias of the model configuration to use for generation") | ||
| system_prompt: str | None = Field( | ||
| default=None, description="Optional system prompt to set model behavior and constraints" | ||
| ) | ||
| multi_modal_context: list[ImageContext] | None = Field( | ||
| default=None, description="Optional list of ImageContext for vision model inputs" | ||
| ) | ||
| tool_alias: str | None = Field( | ||
| default=None, description="Optional alias of the tool configuration to use for MCP tool calls" | ||
| ) | ||
| with_trace: TraceType = Field( | ||
| default=TraceType.NONE, description="Trace capture mode: NONE, LAST_MESSAGE, or ALL_MESSAGES" | ||
| ) | ||
| extract_reasoning_content: bool = Field( | ||
| default=False, description="If True, capture chain-of-thought in {name}__reasoning_content column" | ||
| ) | ||
| column_type: Literal["llm-text"] = Field( | ||
| default="llm-text", description="Discriminator field, always 'llm-text' for this configuration type" | ||
| ) | ||
|
|
||
| @staticmethod | ||
| def get_column_emoji() -> str: | ||
|
|
@@ -219,8 +244,12 @@ class LLMCodeColumnConfig(LLMTextColumnConfig): | |
| column containing the reasoning content from the final assistant response. | ||
| """ | ||
|
|
||
| code_lang: CodeLang | ||
| column_type: Literal["llm-code"] = "llm-code" | ||
| code_lang: CodeLang = Field( | ||
| description="Target programming language or SQL dialect for code extraction from LLM response" | ||
| ) | ||
| column_type: Literal["llm-code"] = Field( | ||
| default="llm-code", description="Discriminator field, always 'llm-code' for this configuration type" | ||
| ) | ||
|
|
||
| @staticmethod | ||
| def get_column_emoji() -> str: | ||
|
|
@@ -252,8 +281,12 @@ class LLMStructuredColumnConfig(LLMTextColumnConfig): | |
| column containing the reasoning content from the final assistant response. | ||
| """ | ||
|
|
||
| output_format: dict | type[BaseModel] | ||
| column_type: Literal["llm-structured"] = "llm-structured" | ||
| output_format: dict | type[BaseModel] = Field( | ||
| description="Pydantic model or JSON schema dict defining the expected structured output shape" | ||
| ) | ||
| column_type: Literal["llm-structured"] = Field( | ||
| default="llm-structured", description="Discriminator field, always 'llm-structured' for this configuration type" | ||
| ) | ||
|
|
||
| @staticmethod | ||
| def get_column_emoji() -> str: | ||
|
|
@@ -317,8 +350,12 @@ class LLMJudgeColumnConfig(LLMTextColumnConfig): | |
| column containing the reasoning content from the final assistant response. | ||
| """ | ||
|
|
||
| scores: list[Score] = Field(..., min_length=1) | ||
| column_type: Literal["llm-judge"] = "llm-judge" | ||
| scores: list[Score] = Field( | ||
| ..., min_length=1, description="List of Score objects defining rubric criteria for LLM judge evaluation" | ||
| ) | ||
| column_type: Literal["llm-judge"] = Field( | ||
| default="llm-judge", description="Discriminator field, always 'llm-judge' for this configuration type" | ||
| ) | ||
|
|
||
| @staticmethod | ||
| def get_column_emoji() -> str: | ||
|
|
@@ -341,10 +378,13 @@ class ExpressionColumnConfig(SingleColumnConfig): | |
| column_type: Discriminator field, always "expression" for this configuration type. | ||
| """ | ||
|
|
||
| name: str | ||
| expr: str | ||
| dtype: Literal["int", "float", "str", "bool"] = "str" | ||
| column_type: Literal["expression"] = "expression" | ||
| expr: str = Field(description="Jinja2 expression to compute the column value from other columns") | ||
| dtype: Literal["int", "float", "str", "bool"] = Field( | ||
| default="str", description="Data type for expression result: 'int', 'float', 'str', or 'bool'" | ||
| ) | ||
| column_type: Literal["expression"] = Field( | ||
| default="expression", description="Discriminator field, always 'expression' for this configuration type" | ||
| ) | ||
|
|
||
| @staticmethod | ||
| def get_column_emoji() -> str: | ||
|
|
@@ -410,11 +450,13 @@ class ValidationColumnConfig(SingleColumnConfig): | |
| column_type: Discriminator field, always "validation" for this configuration type. | ||
| """ | ||
|
|
||
| target_columns: list[str] | ||
| validator_type: ValidatorType | ||
| validator_params: ValidatorParamsT | ||
| target_columns: list[str] = Field(description="List of column names to validate") | ||
| validator_type: ValidatorType = Field(description="Validation method: 'code', 'local_callable', or 'remote'") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is |
||
| validator_params: ValidatorParamsT = Field(description="Validator-specific parameters (e.g., CodeValidatorParams)") | ||
| batch_size: int = Field(default=10, ge=1, description="Number of records to process in each batch") | ||
| column_type: Literal["validation"] = "validation" | ||
| column_type: Literal["validation"] = Field( | ||
| default="validation", description="Discriminator field, always 'validation' for this configuration type" | ||
| ) | ||
|
|
||
| @staticmethod | ||
| def get_column_emoji() -> str: | ||
|
|
@@ -441,7 +483,9 @@ class SeedDatasetColumnConfig(SingleColumnConfig): | |
| column_type: Discriminator field, always "seed-dataset" for this configuration type. | ||
| """ | ||
|
|
||
| column_type: Literal["seed-dataset"] = "seed-dataset" | ||
| column_type: Literal["seed-dataset"] = Field( | ||
| default="seed-dataset", description="Discriminator field, always 'seed-dataset' for this configuration type" | ||
| ) | ||
|
|
||
| @staticmethod | ||
| def get_column_emoji() -> str: | ||
|
|
@@ -468,9 +512,11 @@ class EmbeddingColumnConfig(SingleColumnConfig): | |
| column_type: Discriminator field, always "embedding" for this configuration type. | ||
| """ | ||
|
|
||
| target_column: str | ||
| model_alias: str | ||
| column_type: Literal["embedding"] = "embedding" | ||
| target_column: str = Field(description="Name of the text column to generate embeddings for") | ||
| model_alias: str = Field(description="Alias of the model to use for embedding generation") | ||
| column_type: Literal["embedding"] = Field( | ||
| default="embedding", description="Discriminator field, always 'embedding' for this configuration type" | ||
| ) | ||
|
|
||
| @staticmethod | ||
| def get_column_emoji() -> str: | ||
|
|
@@ -502,10 +548,16 @@ class ImageColumnConfig(SingleColumnConfig): | |
| column_type: Discriminator field, always "image" for this configuration type. | ||
| """ | ||
|
|
||
| prompt: str | ||
| model_alias: str | ||
| multi_modal_context: list[ImageContext] | None = None | ||
| column_type: Literal["image"] = "image" | ||
| prompt: str = Field( | ||
| description="Jinja2 template for the image generation prompt; can reference other columns via {{ column_name }}" | ||
| ) | ||
| model_alias: str = Field(description="Alias of the model to use for image generation") | ||
| multi_modal_context: list[ImageContext] | None = Field( | ||
| default=None, description="Optional list of ImageContext for image-to-image generation inputs" | ||
| ) | ||
| column_type: Literal["image"] = Field( | ||
| default="image", description="Discriminator field, always 'image' for this configuration type" | ||
| ) | ||
|
|
||
| @staticmethod | ||
| def get_column_emoji() -> str: | ||
|
|
@@ -562,7 +614,9 @@ class CustomColumnConfig(SingleColumnConfig): | |
| default=None, | ||
| description="Optional typed configuration object passed as second argument to generator function", | ||
| ) | ||
| column_type: Literal["custom"] = "custom" | ||
| column_type: Literal["custom"] = Field( | ||
| default="custom", description="Discriminator field, always 'custom' for this configuration type" | ||
| ) | ||
|
|
||
| @field_validator("generator_function") | ||
| @classmethod | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it worth warning here or somewhere else about providing fstrings here that could mess up the jinja template? I've found that cursor likes to auto convert this to
f""