Conversation
…on-dict results and improve test coverage - Refactored `validate_task_result` to handle non-dict results by wrapping them into a standardized dictionary format. - Updated method signature to include optional `input_data` for contextual wrapping. - Extended test cases to verify behavior for various input types (e.g., strings, integers, None, lists). - Improved docstrings and inline documentation for clarity and consistency with SDK patterns.
…0` for resolving missing `client` attribute in `OpenAICompletion`.
alexkuzmik
approved these changes
Apr 7, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Details
Current behavior:
When using evaluation suites, the task needs to return a dictionary with an input and output key so that we can score the assertion:
Expected behavior
I expected to simply return the output of my agent in the evaluation task and to have that scored against the assertion. We could simplify the experience here by passing the evaluation suite data field as the input to the LLM as a Judge metric and the task output as the output.
The SDK method would become:
Summary
Relaxes the return-type contract for
EvaluationSuitetask functions: instead of requiring an explicit{"input": ..., "output": ...}dict, any non-dict return value is now automatically wrapped, and a pinnedanthropicversion is added to fix a CrewAI integration test dependency error.Changes by Component
Python SDK
validate_task_resultnow accepts any return type — non-dict values are auto-wrapped as{"output": result}; when called withinput_data, the wrapper becomes{"input": input_data, "output": result}."input"and"output"keys, raisingValueErrorif either is missing._validated_taskin__internal_api__run_optimization_suite__now passes the itemdatadict asinput_dataso auto-wrapped results carry the task input automatically.run()and__internal_api__run_optimization_suite__docstrings and examples to document both the simplified and explicit return styles.test_non_dict__raises_type_errortest with correct auto-wrapping assertions; added 6 new unit tests covering all wrapping scenarios (string, int, None, list, with/withoutinput_data).anthropic>=0.88.0totests/library_integration/crewai/requirements_v1.txtto fixAttributeError: 'OpenAICompletion' object has no attribute 'client'in CrewAI integration tests.Files Changed
Change checklist
Issues
AI-WATERMARK
AI-WATERMARK: yes
Testing
Added related unit tests
Documentation
Updated docstring