Repository navigation
feat(integrate): add durable Strands agent sample with Dapr Workflow (Diagrid) - #355
Open
marcduiker wants to merge 5 commits into
Open
marcduiker wants to merge 5 commits into
marcduiker wants to merge 5 commits into
Conversation
…for Diagrid durability sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #354
Adds an integration sample at
python/03-integrate/durability/diagrid/that shows how to make a Strands agent durable with Dapr Workflow and thediagrid[strands]package. None of the existing integration folders covers durable execution, so this starts adurability/folder. Happy to move it if you'd prefer a different spot.What's in it
simple_agent.pyruns an agent with two tools throughDaprWorkflowAgentRunner. Each model call and each tool call is a workflow activity.crash_recovery.pygives the agent three tools that it calls in order and exits the process while the second one is running. Run the same command again and Dapr resumes the workflow: the first tool doesn't run again, the second runs to completion, then the third. Every tool call goes to a log, and the script prints PASS or FAIL based on what actually ran.--resetstarts over.model.pypicks the model fromMODEL_PROVIDER: Amazon Bedrock by default (us.amazon.nova-pro-v1:0, likefastapi-strands-production-starter), or OpenAI.dapr initstarts. You don't need an account.samples.json. I didn't add it to a collection insamples-catalog.json, since that's your call.How I tested it
gpt-4o-mini), Dapr 1.19, Python 3.12, following the README from a freshuv sync. The crash demo printed PASS on the second run.ConverseStreamcall, and the sample reports the access error clearly. If someone with Nova Pro access could give it a run, that would be great.node generate-samples-manifest.mjs --checkandnode --test generate-samples-manifest.test.mjspass.Notes
requirements.txt. I usedpyproject.tomlanduv.lockinstead, like the other03-integratesamples.diagrid[strands]is published by Diagrid under the Business Source License 1.1. The sample code itself is Apache 2.0 and written for this repo. The README says this and also explains the package's anonymous usage event and how to turn it off (DO_NOT_TRACK=1).Disclosure: drafted with Claude Code and reviewed by me.
🤖 Generated with Claude Code