mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: Add initial scaffold for durabletask package (#2761)
* Add initial scaffold * Update design * Fix mypy and update design * add additional style considered * Address comments * Fix test * Update readmes
This commit is contained in:
committed by
GitHub
Unverified
parent
638fbb5f03
commit
a48a8dd524
@@ -0,0 +1,31 @@
|
||||
# Get Started with Microsoft Agent Framework Durable Task
|
||||
|
||||
[](https://pypi.org/project/agent-framework-durabletask/)
|
||||
|
||||
Please install this package via pip:
|
||||
|
||||
```bash
|
||||
pip install agent-framework-durabletask --pre
|
||||
```
|
||||
|
||||
## Durable Task Integration
|
||||
|
||||
The durable task integration lets you host Microsoft Agent Framework agents using the [Durable Task](https://github.com/microsoft/durabletask-python) framework so they can persist state, replay conversation history, and recover from failures automatically.
|
||||
|
||||
### Basic Usage Example
|
||||
|
||||
```python
|
||||
from durabletask import TaskHubGrpcWorker
|
||||
from agent_framework_durabletask import AgentWorker
|
||||
|
||||
# Create the worker
|
||||
with DurableTaskSchedulerWorker(...) as worker:
|
||||
|
||||
# Register the agent worker wrapper
|
||||
agent_worker = DurableAIAgentWorker(worker)
|
||||
|
||||
# Register the agent
|
||||
agent_worker.add_agent(my_agent)
|
||||
```
|
||||
|
||||
For more details, review the Python [README](https://github.com/microsoft/agent-framework/tree/main/python/README.md) and the samples directory.
|
||||
Reference in New Issue
Block a user