AI-60: Add summary_fn parameter to TemporalModel for dynamic activity summaries#1451
AI-60: Add summary_fn parameter to TemporalModel for dynamic activity summaries#1451
Conversation
eaf06d6 to
01c9f22
Compare
| ) | ||
| if activity_config: | ||
| self._activity_config.update(activity_config) | ||
| raw = dict(activity_config) if activity_config else {} |
There was a problem hiding this comment.
This seems quite messy. And we don't really get anything out of the subclass here since we just have summary and summary_fn anyway
There was a problem hiding this comment.
messy in terms of code cleanliness of how I'm handling this section, or this overall idea of subclassing?
There was a problem hiding this comment.
The handling. Raw dicts, type ignores, etc.
There was a problem hiding this comment.
I decided to remove the subclass altogether, because couldn't find a way to get the code much cleaner and reduce the errors. Let me know what you think now.
| the workflow task. | ||
|
|
||
| Raises: | ||
| ValueError: If both 'summary' and 'summary_fn' are set. |
There was a problem hiding this comment.
summary doesn't make sense here. qualify with ActivityConfig::summary or equivalent
| ) | ||
| if activity_config: | ||
| self._activity_config.update(activity_config) | ||
| raw = dict(activity_config) if activity_config else {} |
There was a problem hiding this comment.
I decided to remove the subclass altogether, because couldn't find a way to get the code much cleaner and reduce the errors. Let me know what you think now.
a1fdd16 to
5faef5f
Compare
…maries Introduce AdkActivityConfig extending ActivityConfig with a summary_fn field that accepts a callable for dynamic per-call summaries. When no summary_fn or static summary is set, falls back to reading adk_agent_name from LlmRequest labels for zero-config agent name display. Setting both summary and summary_fn raises ValueError to prevent ambiguity. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…est, label fallback test Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Drop AdkActivityConfig in favor of a keyword-only summary_fn parameter on TemporalModel. Zero type: ignore comments needed. Auditor findings addressed: - Label fallback test rewritten as integration test - Exception propagation documented in summary_fn docstring - Empty string summary test added Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nd docstring Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5faef5f to
f96fab4
Compare
Summary
summary_fnkeyword-only parameter toTemporalModelfor dynamic per-call activity summariessummary_fnreceives theLlmRequestand returns a summary string (orNone)summary_fnnor staticsummaryis set, falls back to readingadk_agent_namefromLlmRequest.config.labelsfor zero-config agent name displaysummary(inActivityConfig) andsummary_fnraisesValueErrorTest plan
test_summary_fn_produces_dynamic_summary— integration test verifying dynamic summary in workflow historytest_summary_fn_returning_none— summary_fn returning None produces no summarytest_summary_fn_empty_string— empty string is a valid summarytest_adk_agent_name_label_fallback— integration test verifying zero-config label fallbacktest_summary_and_summary_fn_raises— ValueError when both summary and summary_fn set🤖 Generated with Claude Code