Class PromptQueryEntity
java.lang.Object
de.xima.fc.prompt.ms.impl.dao.entities.PromptQueryEntity
JPA entity for a prompt query configuration. It contains the configuration for a particular query, e.g. as the prompt
message and fine-tuning parameters such as the temperature or seed value. A prompt query is always associated with a
PromptConnectionEntity that is used when the query is executed.
Since we wish to support various different prompt service providers with different configuration, this entity simply stores a map of custom properties. The actual interpretation of these properties is left to the prompt service provider implementations.
- Since:
- 8.5.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFile(PromptQueryFileEntity file) Adds the given file to this base entity.longGets the ID of the assignee who owns this prompt query, i.e. a tenant or project.Gets the kind of the assignee who owns this prompt query, i.e. a tenant or project.Gets the connection to use when executing this prompt query.Sets the custom plain text properties of this prompt query.Gets the parsed custom properties model of this prompt query, as a multivalued map where each key can have multiple values.Gets the internal description of this prompt description, visible only to backend users.Gets the file with the given key and index.getFiles()Gets the list of files that are part of this prompt query's configuration, such as images or documents.getId()Gets the unique database ID of this prompt query.intGets the locking version for optimistic locking.getName()Gets the technical name of this prompt connection.getUuid()Gets the UUID of this prompt query.voidRemoves the given file from this base entity.voidsetAssignee(long assignee) Sets the ID of the assignee who owns this prompt query, i.e. a tenant or project.voidsetAssigneeKind(String assigneeKind) Sets the kind of the assignee who owns this prompt query, i.e. a tenant or project.voidsetConnection(PromptConnectionEntity connection) Sets the connection to use when executing this prompt query.voidsetCustomProperties(Map<String, String> customProperties) Sets the custom plain text properties of this prompt query.voidsetCustomPropertiesModel(Map<String, List<String>> newCustomProperties) Sets the custom properties model of this prompt query, which is a multivalued map where each key can have multiple values.voidsetDescription(String description) Sets the internal description of this prompt description, visible only to backend users.voidsetFiles(List<PromptQueryFileEntity> files) Sets the list of files that are part of this prompt query's configuration, such as images or documents.voidSets the unique database ID of this prompt query.voidsetLockingVersion(int lockingVersion) Sets the locking version for optimistic locking.voidSets the technical name of this prompt connection.voidSets the unique UUID of this prompt query.
-
Constructor Details
-
PromptQueryEntity
public PromptQueryEntity()
-
-
Method Details
-
addFile
Adds the given file to this base entity.- Parameters:
file- to add
-
getAssignee
public long getAssignee()Gets the ID of the assignee who owns this prompt query, i.e. a tenant or project. Null for the system scope.- Returns:
- The ID of the assignee.
-
setAssignee
public void setAssignee(long assignee) Sets the ID of the assignee who owns this prompt query, i.e. a tenant or project. Null for the system scope.- Parameters:
assignee- The ID of the assignee.
-
getAssigneeKind
Gets the kind of the assignee who owns this prompt query, i.e. a tenant or project.- Returns:
- The kind of the assignee.
-
setAssigneeKind
Sets the kind of the assignee who owns this prompt query, i.e. a tenant or project.- Parameters:
assigneeKind- The kind of the assignee.
-
getConnection
Gets the connection to use when executing this prompt query.- Returns:
- The connection to use.
-
setConnection
Sets the connection to use when executing this prompt query.- Parameters:
connection- The new connection to set.
-
getCustomProperties
Sets the custom plain text properties of this prompt query. These are stored as key-value pairs in the database. Implementations may deserialize these properties into a more complex structure. UsegetCustomPropertiesModel()to get the raw JSON data.- Returns:
- The custom properties map.
-
setCustomProperties
Sets the custom plain text properties of this prompt query. These are stored as key-value pairs in the database. Implementations may deserialize these properties into a more complex structure. UsegetCustomPropertiesModel()to get the raw JSON data.- Parameters:
customProperties- The new custom properties map to set.
-
getCustomPropertiesModel
-
setCustomPropertiesModel
Sets the custom properties model of this prompt query, which is a multivalued map where each key can have multiple values. This will replace any existing custom properties.- Parameters:
newCustomProperties- The new custom properties model to set.
-
getDescription
Gets the internal description of this prompt description, visible only to backend users.- Returns:
- The description.
-
setDescription
Sets the internal description of this prompt description, visible only to backend users.- Parameters:
description- The new description to set.
-
getFile
Gets the file with the given key and index.- Parameters:
fileKey- key of the filefileIndex- index of the file- Returns:
- the file with the given key and index or null if no such file exists.
-
getFileMap
-
getFiles
Gets the list of files that are part of this prompt query's configuration, such as images or documents. Which files can be configured depends on the type of theprompt connection.- Returns:
- The list of files.
-
setFiles
Sets the list of files that are part of this prompt query's configuration, such as images or documents. Which files can be configured depends on the type of theprompt connection.- Parameters:
files- The new list of files to set.
-
getId
Gets the unique database ID of this prompt query. The database ID is unique within the system, across all tenants.- Returns:
- The database ID of this prompt query.
-
setId
Sets the unique database ID of this prompt query. The database ID is unique within the system, across all tenants.- Parameters:
id- The database ID of this prompt query.
-
getLockingVersion
public int getLockingVersion()Gets the locking version for optimistic locking.- Returns:
- The locking version.
-
setLockingVersion
public void setLockingVersion(int lockingVersion) Sets the locking version for optimistic locking.- Parameters:
lockingVersion- The new locking version.
-
getName
Gets the technical name of this prompt connection. The name can be configured in the backend by the user.- Returns:
- The technical name.
-
setName
Sets the technical name of this prompt connection. The name can be configured in the backend by the user.- Parameters:
name- The new technical name to set.
-
getUuid
Gets the UUID of this prompt query. The UUID is unique within the tenant.- Returns:
- The UUID.
-
setUuid
Sets the unique UUID of this prompt query. The UUID is unique within the tenant.- Parameters:
uuid- The new UUID.
-
removeFile
Removes the given file from this base entity.- Parameters:
file- to remove
-