MCPcopy
hub / github.com/langroid/langroid / _create_collapsible_section

Method _create_collapsible_section

langroid/utils/html_logger.py:732–749  ·  view source on GitHub ↗

Create a collapsible section. Args: section_id: Unique ID for the section label: Label to display content: Content to show when expanded Returns: HTML string for the collapsible section

(
        self, section_id: str, label: str, content: str
    )

Source from the content-addressed store, hash-verified

730 return system_content
731
732 def _create_collapsible_section(
733 self, section_id: str, label: str, content: str
734 ) -> str:
735 """Create a collapsible section.
736
737 Args:
738 section_id: Unique ID for the section
739 label: Label to display
740 content: Content to show when expanded
741
742 Returns:
743 HTML string for the collapsible section
744 """
745 return f"""
746<div class="collapsible collapsed" id="{section_id}">
747 <span class="toggle" onclick="toggle('{section_id}')">[+]</span> {label}
748 <div class="content">{html.escape(content)}</div>
749</div>"""
750
751 def _format_tool_section(self, fields: BaseModel, entry_id: str) -> str:
752 """Format tool-related information.

Callers 1

_format_entryMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected