Require string agent registry fields
This commit is contained in:
parent
25aa5d9313
commit
3b0401fb7c
2 changed files with 27 additions and 2 deletions
|
|
@ -31,9 +31,9 @@ class AgentRegistry:
|
|||
|
||||
def _required_text(entry: Mapping[str, object], key: str) -> str:
|
||||
value = entry.get(key)
|
||||
if value is None:
|
||||
if not isinstance(value, str):
|
||||
raise AgentRegistryError("each agent entry requires id and label")
|
||||
text = str(value).strip()
|
||||
text = value.strip()
|
||||
if not text:
|
||||
raise AgentRegistryError("each agent entry requires id and label")
|
||||
return text
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue