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:
message
of typeZLLM_MSG
. -
add_messages: Adds multiple messages to the chat request.
-
Importing:
messages
of typeZLLM_MSGS
. -
get_messages: Retrieves all messages from the chat request.
-
Returning:
result
of 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:
tool
of typeREF TO ZIF_LLM_TOOL
,tool_choice
of typeSTRING
(default:auto
). -
add_tools: Adds multiple tools to the chat request with an optional tool choice.
-
Importing:
tools
of typeZLLM_TOOLS
,tool_choice
of typeSTRING
(default:auto
). -
get_tools: Retrieves all tools from the chat request.
-
Returning:
result
of typeZLLM_TOOLS
. -
clear_tools: Clears all tools from the chat request.
-
set_tool_choice: Sets the tool choice for the chat request.
- Importing:
tool_choice
of typeSTRING
.
Tool Result and Choice Management
- add_tool_result: Adds the result of a tool to the message.
-
Importing:
tool
of typeREF TO ZIF_LLM_TOOL
. -
add_tool_choices: Adds tool calls to the message list.
- Importing:
choices
of typeZLLM_TOOL_CALLS
.
Structured Output Management
- set_structured_output: Sets structured output details for the chat request.
-
Importing:
data_desc
of typeREF TO CL_ABAP_DATADESCR
,descriptions
of typeZIF_LLM_SO=>DEF_DESCRIPTIONS
,use_structured_output
of typeSAP_BOOL
(default:ABAP_TRUE
). -
set_structured_output_active: Enables or disables the use of structured output.
- Importing:
active
of typeSAP_BOOL
.
Choice Management
- add_choice: Appends an LLM choice to the message list.
- Importing:
choice
of typeZLLM_CHOICE
.
Internal and Options Methods
- get_internal_request: Retrieves the full request details internally.
-
Returning:
result
of typeZLLM_REQUEST
. -
options: Provides options implementation to set options.
- Returning:
result
of typeREF TO ZIF_LLM_OPTIONS
.
Dependencies
The interface depends on the following types and classes:
ZLLM_MSG
ZLLM_MSGS
ZIF_LLM_TOOL
ZLLM_TOOLS
ZLLM_TOOL_CALLS
ZLLM_CHOICE
ZLLM_REQUEST
ZIF_LLM_OPTIONS
ZIF_LLM_SO
CL_ABAP_DATADESCR
SAP_BOOL