db620d33df
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
dotnet-build-and-test / dotnet-test-functions (push) Has been cancelled
dotnet-build-and-test / paths-filter (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Debug, windows-latest, net9.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net10.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net8.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, windows-latest, net472) (push) Has been cancelled
dotnet-build-and-test / dotnet-test (Release, integration, true, ubuntu-latest, net10.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-test (Release, integration, true, windows-latest, net472) (push) Has been cancelled
dotnet-build-and-test / dotnet-foundry-hosted-it (push) Has been cancelled
dotnet-build-and-test / dotnet-build-and-test-check (push) Has been cancelled
dotnet-build-and-test / Integration Test Report (push) Has been cancelled
33 lines
1.2 KiB
Markdown
33 lines
1.2 KiB
Markdown
# 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 agent_framework import Agent
|
|
from agent_framework.openai import OpenAIChatCompletionClient
|
|
from agent_framework_durabletask import DurableAIAgentWorker
|
|
from durabletask.worker import TaskHubGrpcWorker
|
|
|
|
# Create the worker
|
|
worker = TaskHubGrpcWorker(host_address="localhost:4001")
|
|
agent_worker = DurableAIAgentWorker(worker)
|
|
|
|
chat_client = OpenAIChatCompletionClient()
|
|
my_agent = Agent(client=chat_client, name="assistant")
|
|
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.
|