Class ZCL_LLM_TOOL_ECHO
AI Generated documentation.
Overview
The zcl_llm_tool_echo class implements a simple echo tool that mirrors input data. It adheres to the zif_llm_tool interface, providing standardized access to tool metadata and execution results.
Key Public Methods:
constructor: Initializes the tool with metadata (tool_details).execute: Stores inputdataandtool_call_id, returning them as part of the result.get_tool_details: Returns metadata (e.g., name, purpose) configured during initialization.get_result: Provides access to the stored response data and execution context.
Dependencies
- Implements interface
zif_llm_tool(mandatory methods and type definitions). - Relies on the structure
zif_llm_tool=>tool_detailsfor metadata management.
Details
Data Flow
sequenceDiagram
User->>+zcl_llm_tool_echo: execute(data, tool_call_id)
zcl_llm_tool_echo->>zcl_llm_tool_echo: Store data in response_data
zcl_llm_tool_echo->>zcl_llm_tool_echo: Update tool_call_id
zcl_llm_tool_echo-->>-User: Return result with mirrored data
Key Implementation Notes
- Generic Data Handling:
- Uses
TYPE REF TO dataforresponse_datato support arbitrary input structures. -
No data transformation occurs – input is stored and returned as-is.
-
Execution Context:
-
The
tool_call_idlinks execution requests to results (critical for asynchronous operations or audit trails). -
Metadata Propagation:
-
The
tool_details(provided during construction) are reused inget_resultandget_tool_details, ensuring consistency. -
Stateless Design:
- Each
executecall overwrites previousresponse_dataandtool_call_id, making the instance unsuitable for concurrent use.