Class LLMItemSerializer
java.lang.Object
org.openhab.core.voice.text.interpreter.llm.LLMItemSerializer
LLMItemSerializer is a utility class to serialize a collection of items (both semantic and non-semantic) into
a structured,
hierarchical string representation for passing into the context of a Large Language Model (LLM) based
HumanLanguageInterpreter.
The output format is YAML, as this is hierarchical and token-efficient, as well as easy to generate using Jackson.- Author:
- Florian Hotze - Initial contribution
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringserialize(Collection<Item> items) Serializes a collection of items.
-
Constructor Details
-
LLMItemSerializer
public LLMItemSerializer()
-
-
Method Details
-
serialize
Serializes a collection of items.- Parameters:
items- the items to serialize- Returns:
- the serialized representation (YAML) of the items
-