mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-21 13:04:18 +02:00
Sort tags for deterministic output
This commit is contained in:
parent
f03409a40b
commit
337cd41f5f
2 changed files with 3 additions and 3 deletions
|
|
@ -63,7 +63,7 @@ class FastMCPComponent(FastMCPBaseModel):
|
|||
def get_meta(self) -> dict[str, Any]:
|
||||
"""Get the meta information about the component."""
|
||||
if self.tags:
|
||||
return {"tags": list(self.tags)} | self.meta
|
||||
return {"tags": sorted(self.tags)} | self.meta
|
||||
else:
|
||||
return self.meta
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class TestTools:
|
|||
|
||||
assert tools[0].model_dump() == dict(
|
||||
name="create_user_users_post",
|
||||
meta={"tags": ["users", "create"]},
|
||||
meta=dict(tags=["create", "users"]),
|
||||
title=None,
|
||||
annotations=None,
|
||||
description=IsStr(regex=r"^Create a new user\..*$", regex_flags=re.DOTALL),
|
||||
|
|
@ -122,7 +122,7 @@ class TestTools:
|
|||
)
|
||||
assert tools[1].model_dump() == dict(
|
||||
name="update_user_name_users",
|
||||
meta={"tags": ["users", "update"]},
|
||||
meta=dict(tags=["update", "users"]),
|
||||
title=None,
|
||||
annotations=None,
|
||||
description=IsStr(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue