-
Notifications
You must be signed in to change notification settings - Fork 58
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
35
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
35 commits
Select commit
Hold shift + click to select a range
b6dc03d
feat: add agent-context CLI introspection
johnnygreco 093c6ad
fix: correct agent-context field descriptions in column configs
johnnygreco 1803015
feat: enhance pydantic and method inspectors with richer field details
johnnygreco 9b4b55f
feat: add Field descriptions and docstrings to config models
johnnygreco d148d97
feat: enhance formatters with rich field display, dedup, and new form…
johnnygreco b8255cb
feat: add discovery for namespace tree, interface classes, and imports
johnnygreco e116352
refactor: rename agent-context CLI to introspect and add new subcommands
johnnygreco 27c7a2d
test: add CLI usage scenario integration tests
johnnygreco c4ba7ca
refactor: replace introspect command with types and reference command…
johnnygreco 6f05aa2
refactor: update formatters and tests for new types/reference CLI str…
johnnygreco 8370b2d
drop stale review
johnnygreco 8bdfec4
refactor: replace hardcoded discovery functions with introspection-ba…
johnnygreco e5b9a27
fix: improve introspection defaults and depth checks
johnnygreco 8d6a75e
fix: align enum output across text/json and remove dead try/except
johnnygreco f1d7157
fix: surface namespace import failures in debug logs
johnnygreco 89a09b3
sort
johnnygreco db2d471
refactor introspection discovery and normalize typed schema output
johnnygreco e60a8c2
feat: add data-designer list-assets agent-helper command
johnnygreco 1cabcd0
refactor: replace types/reference commands with inspect agent-helper
johnnygreco c181f91
feat: add list agent-helper command group
johnnygreco 7aa0e2d
docs: clarify that constraints apply only to sampler columns
johnnygreco 21c2dfb
refactor: rename inspect "builder" subcommand to "config_builder"
johnnygreco 76337af
docs: improve agent-helper CLI help descriptions for agent consumption
johnnygreco 79ad56a
fix: use hyphenated config-builder for CLI subcommand name
johnnygreco f4bc2b1
docs: tighten agent-helper CLI help descriptions
johnnygreco 3ecf38a
docs: use column header names in list command tips for clarity
johnnygreco 8127348
docs: sharpen inspect and list group-level help descriptions
johnnygreco aa1d0ad
refactor: remove related_inspect_tip from inspect command output
johnnygreco f1f076d
refactor: remove dead code from introspection services
johnnygreco 9c8dc76
fix: harden introspection service layer
johnnygreco d173066
refactor: clean up IntrospectionController
johnnygreco 2c96e92
fix: harden ListController and eliminate DRY violation
johnnygreco bcd0ca9
docs: polish help text and field description consistency
johnnygreco b9ce2a6
test: add coverage for introspection edge cases and crash paths
johnnygreco 1f8e3fc
refactor: simplify introspection inspectors without changing output
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""