Problem
Currently, ActivityConfig applies to all LLM calls within a module uniformly. Different predictors may need different retry/timeout policies.
Example Use Case
class ResearchAgent(dspy.Module):
def __init__(self):
# Quick classification - short timeout, few retries
self.classifier = dspy.Predict("text -> category")
# Complex reasoning - long timeout, more retries
self.researcher = dspy.ChainOfThought("topic -> detailed_analysis")
The classifier should fail fast, while the researcher needs patience.
Proposed Solution
Allow per-predictor configuration:
temporal_module = TemporalModule(
agent,
activity_config=ActivityConfig(timeout=60), # default
predictor_config={
"classifier": ActivityConfig(timeout=10, max_retries=2),
"researcher": ActivityConfig(timeout=300, max_retries=5),
}
)
Implementation Notes
- Need to identify predictors by name or path
- Consider using module introspection (
named_parameters())
- May require changes to how
TemporalLM is created/configured
Priority
Medium
Problem
Currently,
ActivityConfigapplies to all LLM calls within a module uniformly. Different predictors may need different retry/timeout policies.Example Use Case
The classifier should fail fast, while the researcher needs patience.
Proposed Solution
Allow per-predictor configuration:
Implementation Notes
named_parameters())TemporalLMis created/configuredPriority
Medium