class documentation

class ZMSLLMToolsAdapter(object): (source)

Constructor: ZMSLLMToolsAdapter(connector, context)

View In Hierarchy

Resolve active LLM tools connector and dispatch tool calls.

Contract for custom LLM tools connector libraries (``*_llmtools`` or ``com.zms.llmtools.*/*_connector``):

  1. A python/script attribute ``get_llmtools`` returning a list of OpenAI tool schemas (same shape as ``LLM_TOOLS``). Returning ``{"tools": [...]} `` is also accepted.
  2. Tool executors as python/script attributes named ``llmtool_<name>``. The script is called as ``script(connector, context, args)``.
Method __init__ Undocumented
Method execute_llmtool Execute tool call against active connector, then fallback to built-in tools.
Method get_available_connectors Return available ``*_llmtools`` / ``*_connector`` ZMSLibrary connectors.
Method get_connector_id Return configured LLM tools connector id.
Method get_llmtools Return active tool schemas for current connector/context.
Instance Variable connector Undocumented
Instance Variable context Undocumented
Instance Variable root Undocumented
Method _get_connector_actions Return script actions from connector meta-object, filtered by regex.
Method _get_connector_manifest Return the get_llmtools action for a custom connector.
Method _validate_tools Validate tools payload shape.
def __init__(self, connector, context): (source)

Undocumented

def execute_llmtool(self, name, args): (source)

Execute tool call against active connector, then fallback to built-in tools.

def get_available_connectors(self): (source)

Return available ``*_llmtools`` / ``*_connector`` ZMSLibrary connectors.

def get_connector_id(self): (source)

Return configured LLM tools connector id.

Empty means: use built-in core tools.

def get_llmtools(self): (source)

Return active tool schemas for current connector/context.

  • If ``llm.llmtools.id`` is empty: return built-in ``LLM_TOOLS``.
  • If configured: load from connector's ``get_llmtools`` script.
connector = (source)

Undocumented

Undocumented

Undocumented

def _get_connector_actions(self, connector_id, pattern=None): (source)

Return script actions from connector meta-object, filtered by regex.

def _get_connector_manifest(self, connector_id): (source)

Return the get_llmtools action for a custom connector.

def _validate_tools(self, tools, connector_id): (source)

Validate tools payload shape.