dspy.streaming.StatusMessageProvider
dspy.streaming.StatusMessageProvider
Provides customizable status message streaming for DSPy programs.
This class serves as a base for creating custom status message providers. Users can subclass and override its methods to define specific status messages for different stages of program execution, each method must return a string.
Example:
class MyStatusMessageProvider(StatusMessageProvider):
def lm_start_status_message(self, instance, inputs):
return f"Calling LM with inputs {inputs}..."
def module_end_status_message(self, outputs):
return f"Module finished with output: {outputs}!"
program = dspy.streamify(dspy.Predict("q->a"), status_message_provider=MyStatusMessageProvider())
Functions
lm_end_status_message(outputs: Any)
lm_start_status_message(instance: Any, inputs: Dict[str, Any])
module_end_status_message(outputs: Any)
module_start_status_message(instance: Any, inputs: Dict[str, Any])
tool_end_status_message(outputs: Any)
tool_start_status_message(instance: Any, inputs: Dict[str, Any])
:::