agentconnect.core.registry.search.utils module

Registry Search Utilities - Shared formatting and population functions

These utilities handle the conversion from registry domain objects (AgentRegistration) to search interface objects (AgentSearchResultItem) with appropriate detail levels.

format_capabilities_for_output(cap_list)

Format capabilities list for search output.

Parameters:

cap_list (List[Capability]) – List of Capability objects from registry

Return type:

List[Dict[str, str]]

Returns:

List of dictionaries with ‘name’ and ‘description’ keys

format_skills_for_output(skill_list)

Format skills list for search output.

Parameters:

skill_list (List[Skill]) – List of Skill objects from registry

Return type:

List[Dict[str, str]]

Returns:

List of dictionaries with ‘name’ and ‘description’ keys

populate_search_result_item(registration, similarity_score, output_detail_level)

Populate AgentSearchResultItem from AgentRegistration based on detail level.

This is the core utility that transforms registry domain objects into search interface objects, respecting the requested level of detail.

Parameters:
  • registration (AgentRegistration) – The agent registration from the registry

  • similarity_score (float) – Similarity score from search operation

  • output_detail_level (str) – Level of detail (‘minimal’, ‘summary’, ‘capabilities’, ‘full’)

Return type:

AgentSearchResultItem

Returns:

Populated AgentSearchResultItem with appropriate level of detail