Interface IAIAgentUtils


public interface IAIAgentUtils
Utility class for AI Agent operations
  • Method Details

    • canUse

      boolean canUse(IContext userContext)
      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

      long getMaxInteractionsUsageAllowed(IAIAgentUtils.InterationType interationType)
      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

      long getCurrentInteractionUsage(IContext userContext)
      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 conversation
      languageModelConnection - Connection to the language model
      agentConfiguration - Agent (LanguageBot)
      language - Language to use for the conversation
      usage - Usage of the bot
      dynamicContext - Dynamic context to add to the bot context
      additionalParameters - 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 conversation
      languageModelConnection - Connection to the language model
      agentConfiguration - Agent (LanguageBot)
      language - Language to use for the conversation
      usage - Usage of the bot
      dynamicContext - 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 conversation
      languageModelConnection - Connection to the language model
      agentConfiguration - Agent (LanguageBot)
      language - Language to use for the conversation
      usage - 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 conversation
      languageModelConnection - Connection to the language model
      resource - Resource to summarize
      propertiesContext - Properties of the resource to use for the summary
      language - Language to use for the summary
      usage - 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 conversation
      languageModelConnection - Connection to the language model
      originalContent - Content to translate
      fromLanguage - Language of the original content
      toLanguage - Language to translate the content
      usage - 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 module
      resource - Resource to serialize
      propertiesContext - Properties of the resource to use for the serialization
      showLabel - True to show the label of the properties, false to show only the value
      language - Language to use for the serialization
      Returns:
      serialized resource
    • getAgentTonesOptions

      List<IOptionList.IOption> getAgentTonesOptions(String language)
      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

      List<IAgentToneConfiguration> getAgentTones(String language)
      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

      IAgentToneConfiguration getAgentTone(String name)
      Get an agent tone by its name
      Parameters:
      name - Name of the agent tone
      Returns:
      agent tone configuration
    • getAgent

      IAgentConfiguration getAgent(IContext userContext, String name)
      Get an agent configuration by its name
      Parameters:
      userContext - User context to get the agent
      name - Name of the agent
      Returns:
      agent configuration
    • getAgents

      Collection<IAgentConfiguration> getAgents(IContext userContext)
      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