Skip to content

Add support for dataset generation with strands agents - #4

Merged
nhungbi merged 2 commits into
mainfrom
squashed_dataset_generation
Aug 13, 2025
Merged

Add support for dataset generation with strands agents#4
nhungbi merged 2 commits into
mainfrom
squashed_dataset_generation

Conversation

@nhungbi

@nhungbi nhungbi commented Aug 8, 2025

Copy link
Copy Markdown
Contributor

Issue #, if available:

Description of changes:
Adding support for generating Dataset from nothing, from a reference dataset, and adding to a dataset. Currently, the DatasetGenerator only support OutputEvaluator, TrajectoryEvaluator, and InteractionEvaluator for rubric generation. For InteractionEvaluator, the generator can only generate one rubric for all of the interactions. Generating separate rubric for each node/interaction is not supported yet. Other changes include: adding an Interaction TypedDict, updating the Dataset class with more methods, and add some minor fixes for a cleaner interface.

Through testing, it looks like generating multiple test cases at a time is not very deterministic in quality and quantity, so only 1 case is generated per call right now. With structured_output, creating a new class (_Case) with only fields that we want in a test case is better so that the agent doesn't generate rubbish information in other optional fields.

Future changes include: filtering and cleaning /examples.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@nhungbi
nhungbi requested a review from poshinchen August 8, 2025 20:40
@nhungbi nhungbi self-assigned this Aug 8, 2025
Comment thread src/strands_evaluation/dataset.py

cases: list[Case[InputT, OutputT]]
evaluator: Evaluator[InputT, OutputT]
def __init__(self, cases: list[Case[InputT, OutputT]] = None, evaluator: Evaluator[InputT, OutputT] = Evaluator()):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it make sense to be list[Case[InputT, OutputT]] | None = None
and evaluator: Evaluator[InputT, OutputT] | None and set the Evaluator() at line 51?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have strong feelings either way, so I'll fix it to be like this. I'm not sure if there's any benefit in one way.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will do this fix in the refactor PR.

evaluation_prompt += f"<Output>{evaluation_case.actual_output}</Output>\n"
else:
if not evaluation_case.actual_output:
if evaluation_case.actual_output is None:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: what's the intention of changing it to None instead of not?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None is the default so we never want to include it, but if the user for some reason want an empty list or array, 'not' would not include it.

@nhungbi
nhungbi merged commit 9d7e9ae into main Aug 13, 2025
@nhungbi
nhungbi deleted the squashed_dataset_generation branch August 13, 2025 15:43
kylehounslow added a commit to kylehounslow/strands-agents-evals that referenced this pull request Apr 9, 2026
…tests

- Add constructor docstring with Args and usage examples (strands-agents#7)
- Clean up auth type hint to just Any (strands-agents#6)
- Re-raise ProviderError before broad except catch (strands-agents#3)
- Add _parse_time edge case tests: empty, None, invalid, Z suffix, offset (strands-agents#4)
- Add multi-trace provider test verifying flatten/regroup (strands-agents#5)
- 24 tests total
kylehounslow added a commit to kylehounslow/strands-agents-evals that referenced this pull request Apr 10, 2026
…tests

- Add constructor docstring with Args and usage examples (strands-agents#7)
- Clean up auth type hint to just Any (strands-agents#6)
- Re-raise ProviderError before broad except catch (strands-agents#3)
- Add _parse_time edge case tests: empty, None, invalid, Z suffix, offset (strands-agents#4)
- Add multi-trace provider test verifying flatten/regroup (strands-agents#5)
- 24 tests total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants