-
Notifications
You must be signed in to change notification settings - Fork 63
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
Open
johnnygreco
wants to merge
37
commits into
main
Choose a base branch
from
johnny/feat/agent-context
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
e89279f
feat: add agent-context CLI introspection
johnnygreco e0ef33d
fix: correct agent-context field descriptions in column configs
johnnygreco 914f3c4
feat: enhance pydantic and method inspectors with richer field details
johnnygreco ac91dc5
feat: add Field descriptions and docstrings to config models
johnnygreco 311201c
feat: enhance formatters with rich field display, dedup, and new form…
johnnygreco 55bb914
feat: add discovery for namespace tree, interface classes, and imports
johnnygreco de03cdb
refactor: rename agent-context CLI to introspect and add new subcommands
johnnygreco f18506c
test: add CLI usage scenario integration tests
johnnygreco fe2d87e
refactor: replace introspect command with types and reference command…
johnnygreco 37ae075
refactor: update formatters and tests for new types/reference CLI str…
johnnygreco 78950d9
drop stale review
johnnygreco 52fd3aa
refactor: replace hardcoded discovery functions with introspection-ba…
johnnygreco 35d10e2
fix: improve introspection defaults and depth checks
johnnygreco f7fa98d
fix: align enum output across text/json and remove dead try/except
johnnygreco 93e0a61
fix: surface namespace import failures in debug logs
johnnygreco 2ae47e7
sort
johnnygreco 37a3c6c
refactor introspection discovery and normalize typed schema output
johnnygreco 7496c8c
feat: add data-designer list-assets agent-helper command
johnnygreco 221e1cc
refactor: replace types/reference commands with inspect agent-helper
johnnygreco b1778a7
feat: add list agent-helper command group
johnnygreco 03db803
docs: clarify that constraints apply only to sampler columns
johnnygreco ea03168
refactor: rename inspect "builder" subcommand to "config_builder"
johnnygreco 98288c6
docs: improve agent-helper CLI help descriptions for agent consumption
johnnygreco d11aa41
fix: use hyphenated config-builder for CLI subcommand name
johnnygreco 7520939
docs: tighten agent-helper CLI help descriptions
johnnygreco 4d19e90
docs: use column header names in list command tips for clarity
johnnygreco 45e06a8
docs: sharpen inspect and list group-level help descriptions
johnnygreco e8d3708
refactor: remove related_inspect_tip from inspect command output
johnnygreco 122346f
refactor: remove dead code from introspection services
johnnygreco 9ad0399
fix: harden introspection service layer
johnnygreco fe9ebf6
refactor: clean up IntrospectionController
johnnygreco f1e3593
fix: harden ListController and eliminate DRY violation
johnnygreco 8ca35c4
docs: polish help text and field description consistency
johnnygreco 589aafa
test: add coverage for introspection edge cases and crash paths
johnnygreco 50fffa6
refactor: simplify introspection inspectors without changing output
johnnygreco ad8da02
refactor: lazy-load inspect CLI commands
johnnygreco 83ccb30
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.
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""