mirror of
https://github.com/microsoft/autogen.git
synced 2026-04-20 03:02:16 -04:00
Update termination-with-intervention.md (#115)
This commit is contained in:
@@ -46,15 +46,15 @@ Next, we create an InterventionHandler that will detect the termination message
|
||||
class TerminationHandler(DefaultInterventionHandler):
|
||||
|
||||
def __init__(self):
|
||||
self.termination_value: T | None = None
|
||||
self.termination_value: Termination | None = None
|
||||
|
||||
async def on_publish(self, message: Any, *, sender: AgentId | None) -> Any:
|
||||
if isinstance(message, Termination):
|
||||
self.termination_value = self.termination_type(message.reason)
|
||||
self.termination_value = message
|
||||
return message
|
||||
|
||||
@property
|
||||
def termination_value(self) -> T | None:
|
||||
def termination_value(self) -> Termination | None:
|
||||
return self.termination_value
|
||||
|
||||
@property
|
||||
@@ -81,4 +81,4 @@ async def main() -> None:
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
```
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user