Package lumis.portal.ai
Class AiConfig
- java.lang.Object
-
- lumis.portal.ai.AiConfig
-
- All Implemented Interfaces:
java.lang.Cloneable
public class AiConfig extends java.lang.Object implements java.lang.Cloneable
Class that holds the AI configuration properties.- Since:
- 16.1.0
- Version:
- $Revision: 26156 $ $Date: 2024-01-13 10:26:46 -0300 (Sat, 13 Jan 2024) $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AiConfig.ResetCurrentAiConfig
Class used to reset CURRENT config value on all clusters.
-
Constructor Summary
Constructors Constructor Description AiConfig()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AiConfig
clone()
java.lang.String
getContentAssistantModel()
Artificial intelligence model that will be used by the content assistant.static AiConfig
getCurrentConfiguration()
Returns the current AI configuration.int
getEmbeddingsChunkSize()
Maximum size of generated fragments, when calculating embeddings of a text.java.lang.String
getEmbeddingsModel()
The model of embeddings used on requests.java.lang.String
getEncryptedApiKey()
Encrypted key used to connect to the OpenAI API.java.lang.String
getVirtualAssistantCompletionModel()
Returns the AI model to be used by the virtual assistant for chat completion.int
getVirtualAssistantMaxFragmentSize()
Returns the maximum size, in characters, of the knowledge fragments generated for use by the virtual assistant.int
getVirtualAssistantMaxNumInteractions()
Returns the maximum number of interactions allowed in the context of the virtual assistant.int
getVirtualAssistantSearchNumItems()
Returns the maximum number of items searched in each interaction with the virtual assistant.boolean
isEnableContentAssistant()
Returns if whether the OpenAI content assistant API will be enabled or not.boolean
isEnablePrivateSearchEmbeddings()
If disabled, only indexing of contents with permission to be viewed by all users will have their embeddings calculated.boolean
isEnableSearchEmbeddings()
Indicates whether the default indexing for search should calculate embeddings of indexed texts.void
setApiKey(java.lang.String apiKey)
Define the key used to connect to the OpenAI API.void
setContentAssistantModel(java.lang.String contentAssistantModel)
Define the AI model that will be used by the content assistant.void
setEmbeddingsChunkSize(int embeddingsChunkSize)
Define maximum size of generated fragments, when calculating embeddings of a text.void
setEmbeddingsModel(java.lang.String embeddingsModel)
Define the model of embeddings used for the request.void
setEnableContentAssistant(boolean enableContentAssistant)
Defines whether the OpenAI content assistant API will be enabled or not.void
setEnablePrivateSearchEmbeddings(boolean enablePrivateSearchEmbeddings)
Defines if private contents will also have embeddings calculated or just public contents.void
setEnableSearchEmbeddings(boolean enableSearchEmbeddings)
Define if the default indexing for search should calculate embeddings of indexed texts.void
setVirtualAssistantCompletionModel(java.lang.String vaCompletionModel)
Sets the AI model to be used by the virtual assistant for chat completion.void
setVirtualAssistantMaxFragmentSize(int vaMaxFragmentSize)
Sets the max size, in characters, of the knowledge fragments generated for use by the virtual assistant.void
setVirtualAssistantMaxNumInteractions(int vaMaxNumInteractions)
Sets the maximum number of interactions allowed in the context of the virtual assistant.void
setVirtualAssistantSearchNumItems(int vaSearchNumItems)
Sets the maximum number of items searched in each interaction with the virtual assistant.static void
update(AiConfig newConfig)
Updates the AI configuration and applies it to all cluster servers.
-
-
-
Method Detail
-
getCurrentConfiguration
public static AiConfig getCurrentConfiguration()
Returns the current AI configuration.- Returns:
- Since:
- 16.1.0
-
update
public static void update(AiConfig newConfig)
Updates the AI configuration and applies it to all cluster servers.- Parameters:
newConfig
- the new configuration to apply.- Since:
- 16.1.0
-
clone
protected AiConfig clone()
- Overrides:
clone
in classjava.lang.Object
-
getEncryptedApiKey
public java.lang.String getEncryptedApiKey()
Encrypted key used to connect to the OpenAI API.- Returns:
- the API key
- Since:
- 16.1.0
-
setApiKey
public void setApiKey(java.lang.String apiKey)
Define the key used to connect to the OpenAI API.- Parameters:
apiKey
- String the API key.- Since:
- 16.1.0
-
getEmbeddingsModel
public java.lang.String getEmbeddingsModel()
The model of embeddings used on requests.- Returns:
- the embeddings model.
- Since:
- 16.1.0
-
setEmbeddingsModel
public void setEmbeddingsModel(java.lang.String embeddingsModel)
Define the model of embeddings used for the request.- Parameters:
embeddingsModel
- String the embedding model.- Since:
- 16.1.0
-
getEmbeddingsChunkSize
public int getEmbeddingsChunkSize()
Maximum size of generated fragments, when calculating embeddings of a text.- Returns:
- the number of characters.
- Since:
- 16.1.0
-
setEmbeddingsChunkSize
public void setEmbeddingsChunkSize(int embeddingsChunkSize)
Define maximum size of generated fragments, when calculating embeddings of a text.- Parameters:
embeddingsChunkSize
- int the number of characters.- Since:
- 16.1.0
-
isEnableSearchEmbeddings
public boolean isEnableSearchEmbeddings()
Indicates whether the default indexing for search should calculate embeddings of indexed texts.- Returns:
- if the search embeddings is enabled or not.
- Since:
- 16.1.0
-
setEnableSearchEmbeddings
public void setEnableSearchEmbeddings(boolean enableSearchEmbeddings)
Define if the default indexing for search should calculate embeddings of indexed texts.- Parameters:
enableSearchEmbeddings
- boolean if is going to be enabled or not.- Since:
- 16.1.0
-
isEnablePrivateSearchEmbeddings
public boolean isEnablePrivateSearchEmbeddings()
If disabled, only indexing of contents with permission to be viewed by all users will have their embeddings calculated. If enabled, indexing of any content will have their embeddings calculated.- Returns:
- Wether is enabled or not.
- Since:
- 16.1.0
-
setEnablePrivateSearchEmbeddings
public void setEnablePrivateSearchEmbeddings(boolean enablePrivateSearchEmbeddings)
Defines if private contents will also have embeddings calculated or just public contents.- Parameters:
enablePrivateSearchEmbeddings
- boolean if false, it will calculate only for contents with permission to be viewed for all users. if sets as true, any content will have their embeddings calculated.- Since:
- 16.1.0
-
isEnableContentAssistant
public boolean isEnableContentAssistant()
Returns if whether the OpenAI content assistant API will be enabled or not.- Returns:
- if content assistant API is enabled or not.
- Since:
- 16.1.0
-
setEnableContentAssistant
public void setEnableContentAssistant(boolean enableContentAssistant)
Defines whether the OpenAI content assistant API will be enabled or not.- Parameters:
enableContentAssistant
- Boolean true if it will be enabled, false if it will be disabled.- Since:
- 16.1.0
-
getContentAssistantModel
public java.lang.String getContentAssistantModel()
Artificial intelligence model that will be used by the content assistant.- Returns:
- the model
- Since:
- 16.1.0
-
setContentAssistantModel
public void setContentAssistantModel(java.lang.String contentAssistantModel)
Define the AI model that will be used by the content assistant.- Parameters:
contentAssistantModel
- String the AI Model.- Since:
- 16.1.0
-
getVirtualAssistantMaxFragmentSize
public int getVirtualAssistantMaxFragmentSize()
Returns the maximum size, in characters, of the knowledge fragments generated for use by the virtual assistant.- Returns:
- the size in number of characters.
- Since:
- 16.1.0
-
setVirtualAssistantMaxFragmentSize
public void setVirtualAssistantMaxFragmentSize(int vaMaxFragmentSize)
Sets the max size, in characters, of the knowledge fragments generated for use by the virtual assistant.- Parameters:
vaMaxFragmentSize
- the size in number of characters.- Since:
- 16.1.0
-
getVirtualAssistantCompletionModel
public java.lang.String getVirtualAssistantCompletionModel()
Returns the AI model to be used by the virtual assistant for chat completion.- Returns:
- the model.
- Since:
- 16.1.0
-
setVirtualAssistantCompletionModel
public void setVirtualAssistantCompletionModel(java.lang.String vaCompletionModel)
Sets the AI model to be used by the virtual assistant for chat completion.- Parameters:
vaCompletionModel
- the model.- Since:
- 16.1.0
-
getVirtualAssistantSearchNumItems
public int getVirtualAssistantSearchNumItems()
Returns the maximum number of items searched in each interaction with the virtual assistant.- Returns:
- the number of items.
- Since:
- 16.1.0
-
setVirtualAssistantSearchNumItems
public void setVirtualAssistantSearchNumItems(int vaSearchNumItems)
Sets the maximum number of items searched in each interaction with the virtual assistant.- Parameters:
vaSearchNumItems
- the number of items.- Since:
- 16.1.0
-
getVirtualAssistantMaxNumInteractions
public int getVirtualAssistantMaxNumInteractions()
Returns the maximum number of interactions allowed in the context of the virtual assistant.- Returns:
- the number of interactions.
- Since:
- 16.1.0
-
setVirtualAssistantMaxNumInteractions
public void setVirtualAssistantMaxNumInteractions(int vaMaxNumInteractions)
Sets the maximum number of interactions allowed in the context of the virtual assistant.- Since:
- 16.1.0
-
-