Package com.axemble.vdoc.sdk.utils
Interface IAIAgentUtils
public interface IAIAgentUtils
Utility class for AI Agent operations
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumstatic enum -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if AI Agent Utils can be used (license, connection, configuration, ...)createAssistant(IContext userContext, ILanguageModelConnection languageModelConnection, IAgentConfiguration agentConfiguration, String language, String usage) Chat completion request Start a conversation with a botcreateAssistant(IContext userContext, ILanguageModelConnection languageModelConnection, IAgentConfiguration agentConfiguration, String language, String usage, String dynamicContext) Chat completion request Start a conversation with a botcreateAssistant(IContext userContext, ILanguageModelConnection languageModelConnection, IAgentConfiguration agentConfiguration, String language, String usage, String dynamicContext, Map<String, Object> additionalParameters) Chat completion request Start a conversation with a botCreate a tool schema bean with a descriptionGet an agent configuration by its nameGet the list of available agents for a given user contextgetAgentTone(String name) Get an agent tone by its namegetAgentTones(String language) Get the list of available agent tones for a given languagegetAgentTonesOptions(String language) Get the list of available agent tones for a given languagelonggetCurrentInteractionUsage(IContext userContext) Get the current interaction usage for current monthlonggetMaxInteractionsUsageAllowed(IAIAgentUtils.InterationType interationType) Get the maximum interactions usage allowed for the current monthserializeResource(IWorkflowModule workflowModule, IResource resource, Collection<String> propertiesContext, boolean showLabel, String language) Serialize a resource to a text formatsummarize(IContext userContext, ILanguageModelConnection languageModelConnection, IResource resource, Collection<String> propertiesContext, String language, String usage) Summarize the content of a resourcetranslate(IContext userContext, ILanguageModelConnection languageModelConnection, String originalContent, String fromLanguage, String toLanguage, String usage) Translate a content from a language to another
-
Method Details
-
canUse
Check if AI Agent Utils can be used (license, connection, configuration, ...)- Parameters:
userContext- the user context- Returns:
- true if AI Agent Utils can be used
-
getMaxInteractionsUsageAllowed
Get the maximum interactions usage allowed for the current month- Parameters:
interationType- the interaction type- Returns:
- the maximum interactions usage allowed for the current month
-
getCurrentInteractionUsage
Get the current interaction usage for current month- Parameters:
userContext- the user context- Returns:
- interaction usage for current month
-
createAssistant
IAssistant createAssistant(IContext userContext, ILanguageModelConnection languageModelConnection, IAgentConfiguration agentConfiguration, String language, String usage, String dynamicContext, Map<String, Object> additionalParameters) Chat completion request Start a conversation with a bot- Parameters:
userContext- User context of the conversationlanguageModelConnection- Connection to the language modelagentConfiguration- Agent (LanguageBot)language- Language to use for the conversationusage- Usage of the botdynamicContext- Dynamic context to add to the bot contextadditionalParameters- Additional parameters for the assistant- Returns:
- assistant to continue exchanges
-
createAssistant
IAssistant createAssistant(IContext userContext, ILanguageModelConnection languageModelConnection, IAgentConfiguration agentConfiguration, String language, String usage, String dynamicContext) Chat completion request Start a conversation with a bot- Parameters:
userContext- User context of the conversationlanguageModelConnection- Connection to the language modelagentConfiguration- Agent (LanguageBot)language- Language to use for the conversationusage- Usage of the botdynamicContext- Dynamic context to add to the bot context- Returns:
- assistant to continue exchanges
-
createAssistant
IAssistant createAssistant(IContext userContext, ILanguageModelConnection languageModelConnection, IAgentConfiguration agentConfiguration, String language, String usage) Chat completion request Start a conversation with a bot- Parameters:
userContext- User context of the conversationlanguageModelConnection- Connection to the language modelagentConfiguration- Agent (LanguageBot)language- Language to use for the conversationusage- Usage of the bot- Returns:
- assistant to continue exchanges
-
summarize
ILanguageMessage summarize(IContext userContext, ILanguageModelConnection languageModelConnection, IResource resource, Collection<String> propertiesContext, String language, String usage) Summarize the content of a resource- Parameters:
userContext- User context of the conversationlanguageModelConnection- Connection to the language modelresource- Resource to summarizepropertiesContext- Properties of the resource to use for the summarylanguage- Language to use for the summaryusage- Usage of the summary- Returns:
- summary message
-
translate
ILanguageMessage translate(IContext userContext, ILanguageModelConnection languageModelConnection, String originalContent, String fromLanguage, String toLanguage, String usage) Translate a content from a language to another- Parameters:
userContext- User context of the conversationlanguageModelConnection- Connection to the language modeloriginalContent- Content to translatefromLanguage- Language of the original contenttoLanguage- Language to translate the contentusage- Usage of the translation- Returns:
- translated message
-
serializeResource
String serializeResource(IWorkflowModule workflowModule, IResource resource, Collection<String> propertiesContext, boolean showLabel, String language) Serialize a resource to a text format- Parameters:
workflowModule- Workflow moduleresource- Resource to serializepropertiesContext- Properties of the resource to use for the serializationshowLabel- True to show the label of the properties, false to show only the valuelanguage- Language to use for the serialization- Returns:
- serialized resource
-
getAgentTonesOptions
Get the list of available agent tones for a given language- Parameters:
language- Language to get the tones- Returns:
- list of available agent tones for a given language
-
getAgentTones
Get the list of available agent tones for a given language- Parameters:
language- Language to get the tones- Returns:
- list of available agent tones for a given language
-
getAgentTone
Get an agent tone by its name- Parameters:
name- Name of the agent tone- Returns:
- agent tone configuration
-
getAgent
Get an agent configuration by its name- Parameters:
userContext- User context to get the agentname- Name of the agent- Returns:
- agent configuration
-
getAgents
Get the list of available agents for a given user context- Parameters:
userContext- User context to get the agents- Returns:
- list of available agents for a given user context
-
createToolSchema
IToolSchema createToolSchema()Create a tool schema bean with a description- Returns:
- tool schema
-