Class PromptConnectionEntity
- java.lang.Object
-
- de.xima.fc.prompt.ms.impl.dao.entities.PromptConnectionEntity
-
@Entity public class PromptConnectionEntity extends Object
JPA entity for a prompt connection configuration. A prompt connection defines how to connect to a prompt service provider, such as OpenAI or Anthropic. Usually contains a URL and authentication information such as an API key, and possibly other configuration parameters.Since we wish to support various different prompt service providers with different configuration, this entity simply stores a type identifier and 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 Constructor Description PromptConnectionEntity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetAssignee()Gets the ID of the assignee who owns this prompt connection, i.e. a tenant or project.StringgetAssigneeKind()Gets the kind of the assignee who owns this prompt connection, i.e. a tenant or project.Map<@Size(max=250) String,String>getCustomProperties()Sets the custom plain text properties of this prompt connection.Map<String,List<String>>getCustomPropertiesModel()Gets the parsed custom properties model of this prompt connection, as a multivalued map where each key can have multiple values.StringgetDescription()Gets the internal description of this prompt connection, visible only to backend users.LonggetId()Gets the unique database ID of this prompt connection.intgetLockingVersion()Gets the locking version for optimistic locking.StringgetName()StringgetType()Gets the type of this prompt connection, i.e. the type of the prompt service provider that implements the connection and query logic.UUIDgetUuid()Gets the UUID of this prompt connection.voidsetAssignee(long assignee)Sets the ID of the assignee who owns this prompt connection, i.e. a tenant or project.voidsetAssigneeKind(String assigneeKind)Sets the kind of the assignee who owns this prompt connection, i.e. a tenant or project.voidsetCustomProperties(Map<String,String> customProperties)Sets the custom plain text properties of this prompt connection.voidsetCustomPropertiesModel(Map<String,List<String>> newCustomProperties)Sets the custom properties model of this prompt connection, which is a multivalued map where each key can have multiple values.voidsetDescription(String description)Sets the internal description of this prompt connection, visible only to backend users.voidsetId(Long id)Sets the unique database ID of this prompt connection.voidsetLockingVersion(int lockingVersion)Sets the locking version for optimistic locking.voidsetName(String name)Sets the technical name of this prompt connection.voidsetType(String type)Sets the type of this prompt connection, i.e. the type of the prompt service provider that implements the connection and query logic.voidsetUuid(UUID uuid)Sets the UUID of this prompt connection.StringtoString()
-
-
-
Method Detail
-
getAssignee
public long getAssignee()
Gets the ID of the assignee who owns this prompt connection, 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 connection, i.e. a tenant or project. Null for the system scope.- Parameters:
assignee- The ID of the assignee.
-
getAssigneeKind
public String getAssigneeKind()
Gets the kind of the assignee who owns this prompt connection, i.e. a tenant or project.- Returns:
- The kind of the assignee.
-
setAssigneeKind
public void setAssigneeKind(String assigneeKind)
Sets the kind of the assignee who owns this prompt connection, i.e. a tenant or project.- Parameters:
assigneeKind- The kind of the assignee.
-
getCustomProperties
public Map<@Size(max=250) String,String> getCustomProperties()
Sets the custom plain text properties of this prompt connection. 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
public void setCustomProperties(Map<String,String> customProperties)
Sets the custom plain text properties of this prompt connection. 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
public Map<String,List<String>> getCustomPropertiesModel()
Gets the parsed custom properties model of this prompt connection, as a multivalued map where each key can have multiple values.- Returns:
- The custom properties model as a JSON object map.
-
setCustomPropertiesModel
public void setCustomPropertiesModel(Map<String,List<String>> newCustomProperties)
Sets the custom properties model of this prompt connection, 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
public String getDescription()
Gets the internal description of this prompt connection, visible only to backend users.- Returns:
- The description.
-
setDescription
public void setDescription(String description)
Sets the internal description of this prompt connection, visible only to backend users.- Parameters:
description- The new description to set.
-
getId
public Long getId()
Gets the unique database ID of this prompt connection. The database ID is unique within the system, across all tenants.- Returns:
- The database ID of this prompt connection.
-
setId
public void setId(Long id)
Sets the unique database ID of this prompt connection. The database ID is unique within the system, across all tenants.- Parameters:
id- The database ID of this prompt connection.
-
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
public String getName()
-
setName
public void setName(String name)
Sets the technical name of this prompt connection.- Parameters:
name- The new technical name to set.
-
getType
public String getType()
Gets the type of this prompt connection, i.e. the type of the prompt service provider that implements the connection and query logic. This is the technical type that must be unique amongst all prompt service providers.- Returns:
- The type of the prompt connection, such as "de.xima.fc.plugin:prompt-service-plugin-openai".
-
setType
public void setType(String type)
Sets the type of this prompt connection, i.e. the type of the prompt service provider that implements the connection and query logic. This is the technical type that must be unique amongst all prompt service providers.- Parameters:
type- The new type of the prompt connection, such as "de.xima.fc.plugin:prompt-service-plugin-openai".
-
getUuid
public UUID getUuid()
Gets the UUID of this prompt connection. The UUID is unique within the tenant.- Returns:
- The UUID.
-
setUuid
public void setUuid(UUID uuid)
Sets the UUID of this prompt connection. The UUID is unique within the tenant.- Parameters:
uuid- The new UUID.
-
-