Conversation
Signed-off-by: Casper Nielsen <casper@diagrid.io>
Signed-off-by: Casper Nielsen <casper@diagrid.io>
Signed-off-by: Casper Nielsen <casper@diagrid.io>
Signed-off-by: Casper Nielsen <casper@diagrid.io>
Signed-off-by: Casper Nielsen <casper@diagrid.io>
sicoyle
left a comment
There was a problem hiding this comment.
overall really liking this addition, thank you!!
scripts/generate_schema.py
Outdated
| # Generate schema for specific version | ||
| python scripts/generate_schema.py --version 1.0.0 | ||
|
|
||
| # Generate for pre-release | ||
| python scripts/generate_schema.py --version 1.1.0-rc1 | ||
|
|
||
| # Custom output directory | ||
| python scripts/generate_schema.py --version 1.0.0 --output ./custom-schemas | ||
| """, |
There was a problem hiding this comment.
can you add in using the goldenfile package for in the event there are breaking changes and it will indicate as such easily for us in test?
https://github.com/oprypin/pytest-golden
https://ro-che.info/articles/2017-12-04-golden-tests
Signed-off-by: Casper Nielsen <casper@diagrid.io>
Signed-off-by: Casper Nielsen <casper@diagrid.io>
Signed-off-by: Casper Nielsen <casper@diagrid.io>
Signed-off-by: Casper Nielsen <casper@diagrid.io>
Signed-off-by: Casper Nielsen <casper@diagrid.io>
Signed-off-by: Casper Nielsen <casper@diagrid.io>
Signed-off-by: Casper Nielsen <casper@diagrid.io>
Signed-off-by: Casper Nielsen <casper@diagrid.io>
|
bump @CasperGN to pls circle back here 🙏 |
|
@sicoyle this one waits for dapr/python-sdk#899 |
Signed-off-by: Casper Nielsen <casper@diagrid.io>
Signed-off-by: Casper Nielsen <casper@diagrid.io>
Signed-off-by: Casper Nielsen <casper@diagrid.io>
Signed-off-by: Casper Nielsen <casper@diagrid.io>
|
@sicoyle this is ready for review now |
…eys with a meta field Signed-off-by: Casper Nielsen <casper@diagrid.io>
Signed-off-by: Casper Nielsen <casper@diagrid.io>
There was a problem hiding this comment.
Pull request overview
This PR updates the agent metadata model and registry behavior to support versioned metadata/schemas tied to the installed dapr-agents package version (via importlib.metadata), and adjusts tests/examples accordingly.
Changes:
- Introduces a Pydantic-based
AgentMetadataSchemamodel and exports it via public package APIs. - Updates agent registry persistence to a per-agent key plus a team index key, with ETag-protected index updates.
- Adds a schema generation script and commits generated schema artifacts under
schemas/agent-metadata/.
Reviewed changes
Copilot reviewed 16 out of 18 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
dapr_agents/agents/configs.py |
Adds Pydantic models for agent metadata + schema export helper. |
dapr_agents/agents/base.py |
Builds validated metadata schema at agent init and registers it. |
dapr_agents/agents/components.py |
Changes registry storage format to per-agent key + index and bulk-fetches metadata. |
dapr_agents/agents/orchestrators/base.py |
Adjusts orchestrator registration flow (currently broken due to new metadata requirement). |
dapr_agents/agents/schemas.py |
Adds an import (currently unused). |
dapr_agents/agents/standalone.py / dapr_agents/agents/durable.py |
Attempts deregistration on shutdown/stop. |
scripts/generate_metadata_schema.py |
Adds CLI tool to generate versioned JSON schema files. |
schemas/agent-metadata/* |
Adds committed schema artifacts (currently inconsistent with code model). |
tests/agents/* |
Updates tests to use the new schema object and new registry storage format. |
examples/*.yaml |
Trims whitespace-only lines. |
dapr_agents/__init__.py / dapr_agents/agents/__init__.py |
Re-exports metadata models and adds __version__ from package metadata. |
Comments suppressed due to low confidence (1)
dapr_agents/agents/components.py:650
exclude_orchestratorfiltering is checkingmeta.get("orchestrator"), but the stored payload shape is{"agent": {"orchestrator": ...}}(perAgentMetadataSchema). As written, orchestrators will never be filtered out. Update the filter to read the orchestrator flag from the correct nested field (and consider backwards compatibility if older registry entries used a different shape).
filtered = {
name: meta
for name, meta in agents_metadata.items()
if not (exclude_self and name == self.name)
and not (exclude_orchestrator and meta.get("orchestrator", False))
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Casper Nielsen <casper@diagrid.io>
Signed-off-by: Casper Nielsen <casper@diagrid.io>
Signed-off-by: Casper Nielsen <casper@diagrid.io>
Signed-off-by: Casper Nielsen <casper@diagrid.io>
Signed-off-by: Casper Nielsen <casper@diagrid.io>
…f schema missing, post comment if breaking change Signed-off-by: Casper Nielsen <casper@diagrid.io>
Signed-off-by: Casper Nielsen <casper@diagrid.io>
c78322b to
059012c
Compare
sicoyle
left a comment
There was a problem hiding this comment.
it's super close! 🌞 few comments for ya pls!
…nup, gen new schema & update tests to address comments Signed-off-by: Casper Nielsen <casper@diagrid.io>
Signed-off-by: Casper Nielsen <casper@diagrid.io>
Signed-off-by: Casper Nielsen <casper@diagrid.io>
…so convert the schema check to pull_request_target to run in scope of base Signed-off-by: Casper Nielsen <casper@diagrid.io>
Description
This PR includes generation of json schemas against the newAgentMetadataSchemamodel that defines the Agents Metadata model. This enables consumers (including platform providers) to easily fetch the valid schema for an agent with its current version.The agent will use importlib's metadata package to derive the package version when distributed. This should ensure we don't need to keep a hardcoded version field to remember to update.
Edit: This PR requires dapr/python-sdk#899 to be merged as it now consumes the metadata and agent registration from the
dapr.ext.agent_corepackage in the python sdk.Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR closes: #372
Closes: #393
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list:
Note: We expect contributors to open a corresponding documentation PR in the dapr/docs repository. As the implementer, you are the best person to document your work! Implementation PRs will not be merged until the documentation PR is opened and ready for review.