Interface ZIF_LLM_CHAT_REQUEST
AI Generated documentation.
Overview
The ZIF_LLM_CHAT_REQUEST interface provides a structured way to manage chat requests, including adding, retrieving, and clearing messages and tools. It also supports setting tool choices, structured output details, and handling tool results and choices. Below is an overview of the public methods:
Message Management
- add_message: Adds a single message to the chat request.
-
Importing:
messageof typeZLLM_MSG. -
add_messages: Adds multiple messages to the chat request.
-
Importing:
messagesof typeZLLM_MSGS. -
get_messages: Retrieves all messages from the chat request.
-
Returning:
resultof typeZLLM_MSGS. -
clear_messages: Clears all messages from the chat request.
Tool Management
- add_tool: Adds a single tool to the chat request with an optional tool choice.
-
Importing:
toolof typeREF TO ZIF_LLM_TOOL,tool_choiceof typeSTRING(default:auto). -
add_tools: Adds multiple tools to the chat request with an optional tool choice.
-
Importing:
toolsof typeZLLM_TOOLS,tool_choiceof typeSTRING(default:auto). -
get_tools: Retrieves all tools from the chat request.
-
Returning:
resultof typeZLLM_TOOLS. -
clear_tools: Clears all tools from the chat request.
-
set_tool_choice: Sets the tool choice for the chat request.
- Importing:
tool_choiceof typeSTRING.
Tool Result and Choice Management
- add_tool_result: Adds the result of a tool to the message.
-
Importing:
toolof typeREF TO ZIF_LLM_TOOL. -
add_tool_choices: Adds tool calls to the message list.
- Importing:
choicesof typeZLLM_TOOL_CALLS.
Structured Output Management
- set_structured_output: Sets structured output details for the chat request.
-
Importing:
data_descof typeREF TO CL_ABAP_DATADESCR,descriptionsof typeZIF_LLM_SO=>DEF_DESCRIPTIONS,use_structured_outputof typeSAP_BOOL(default:ABAP_TRUE). -
set_structured_output_active: Enables or disables the use of structured output.
- Importing:
activeof typeSAP_BOOL.
Choice Management
- add_choice: Appends an LLM choice to the message list.
- Importing:
choiceof typeZLLM_CHOICE.
Internal and Options Methods
- get_internal_request: Retrieves the full request details internally.
-
Returning:
resultof typeZLLM_REQUEST. -
options: Provides options implementation to set options.
- Returning:
resultof typeREF TO ZIF_LLM_OPTIONS.
Dependencies
The interface depends on the following types and classes:
ZLLM_MSGZLLM_MSGSZIF_LLM_TOOLZLLM_TOOLSZLLM_TOOL_CALLSZLLM_CHOICEZLLM_REQUESTZIF_LLM_OPTIONSZIF_LLM_SOCL_ABAP_DATADESCRSAP_BOOL