Class SerializedPromptConfig
java.lang.Object
de.xima.fc.prompt.service.SerializedPromptConfig
Represents a serialized prompt configuration, with plain text and binary values. Each value is identified by a unique
key.
Instances of this class are immutable.
- Since:
- 8.5.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA builder for creating instances ofSerializedPromptConfig. -
Constructor Summary
ConstructorsConstructorDescriptionSerializedPromptConfig(Map<String, List<String>> textData, Map<String, List<IPromptBinaryData>> binaryData) Creates a new serialized prompt configuration with the given text and binary data. -
Method Summary
Modifier and TypeMethodDescriptionGets the binary data, indexed by their keys.binaryData(String key) Returns the binary data associated with the given key, or null if no such value exists.builder()Creates a new builder for configuring aSerializedPromptConfiginstance.derive()static SerializedPromptConfigempty()Returns an empty serialized prompt configuration with no data.firstBinaryData(String key) Gets the first binary data associated with the given key, or null if no such value exists.firstTextData(String key) Gets the first text data associated with the given key, or null if no such value exists.Creates a new builder for configuring aSerializedPromptConfiginstance.textData()Gets the text data, indexed by their keys.Gets the text data associated with the given key, or an empty list if no such value exists.
-
Constructor Details
-
SerializedPromptConfig
public SerializedPromptConfig(Map<String, List<String>> textData, Map<String, List<IPromptBinaryData>> binaryData) Creates a new serialized prompt configuration with the given text and binary data.- Parameters:
textData- The text data, indexed by their keys. Each key maps to a list of strings, allowing for multiple values. If null, it will be treated as an empty map.binaryData- The binary data, indexed by their keys. Each key maps to a list of binary data objects, allowing for multiple values. If null, it will be treated as an empty map.
-
-
Method Details
-
binaryData
Returns the binary data associated with the given key, or null if no such value exists.- Parameters:
key- The key to look up.- Returns:
- The file value associated with the key, or null if not found.
-
binaryData
Gets the binary data, indexed by their keys. Each key maps to a list of binary data objects, allowing for multiple values.- Returns:
- A map with all binary data, where the key is the file key.
-
derive
-
firstBinaryData
Gets the first binary data associated with the given key, or null if no such value exists.- Parameters:
key- The key to look up.- Returns:
- The first binary data associated with the key, or null if not found.
-
firstTextData
-
textData
-
textData
-
builder
Creates a new builder for configuring aSerializedPromptConfiginstance.- Returns:
- A new builder instance for a serialized prompt configuration.
-
empty
Returns an empty serialized prompt configuration with no data.- Returns:
- An empty instance with no data.
-
serializedPromptConfigBuilder
Creates a new builder for configuring aSerializedPromptConfiginstance.- Returns:
- A new builder instance for a serialized prompt configuration.
-