Class EssCubeAiImpl

java.lang.Object
com.appliedolap.essbase.impl.EssCubeAiImpl
All Implemented Interfaces:
EssCubeAi

public class EssCubeAiImpl extends Object implements EssCubeAi
The AI capabilities of one cube, spoken to over the /ai endpoints a 26.1 server adds.

None of this goes through the generated client. Since the 26.1 regeneration it does have an AiApi, with twenty-seven operations - and every one returns void, because the specification declares a response schema for none of them. Calls are made with NativeHttp so they still authenticate the way every generated call does - password, session, or a session established in a browser - rather than needing their own credentials.

  • Field Details

    • DEFAULT_PROFILE

      public static final String DEFAULT_PROFILE
      The profile every 26.1 server is set up with. Capability endpoints take profileName as a required parameter with no default, so a caller who never thinks about profiles still has to send something.
      See Also:
  • Constructor Details

  • Method Details

    • withProfile

      public EssCubeAi withProfile(String profileName)
      Description copied from interface: EssCubeAi
      The chat profile capability calls are made against. Every one of them requires a profile name, and the server ships one called default; set this when a site has made its own.
      Specified by:
      withProfile in interface EssCubeAi
      Parameters:
      profileName - the profile name
      Returns:
      this, for chaining
    • getReadiness

      public EssAiReadiness getReadiness()
      Description copied from interface: EssCubeAi
      Works out whether the AI features on this cube can run, and if not, which prerequisite is missing. Never throws - an unreachable server comes back as EssAiReadiness.State.UNDETERMINED.

      Costs one or two small requests and is not cached, so hold on to the result rather than asking again per capability.

      Specified by:
      getReadiness in interface EssCubeAi
      Returns:
      the diagnosis, never null
    • getReadiness

      public EssAiReadiness getReadiness(EssAiFeature feature)
      Description copied from interface: EssCubeAi
      The same diagnosis, narrowed to one capability, which is what you usually want: the server reports a separate on/off flag per capability, so "is AI available here" is a question with no single answer and asking about the feature you are about to use is strictly better.
      Specified by:
      getReadiness in interface EssCubeAi
      Parameters:
      feature - the capability to ask about, or null for AI in general
      Returns:
      the diagnosis, never null
    • getEnabledFeatures

      public Set<EssAiFeature> getEnabledFeatures()
      Description copied from interface: EssCubeAi
      Which AI capabilities this server has switched on, in one request.

      Says nothing about whether they are configured - a capability can be switched on and still have no AI connection behind it, which is the usual state of a fresh server. This is the inventory; EssCubeAi.getReadiness(EssAiFeature) is the diagnosis.

      Specified by:
      getEnabledFeatures in interface EssCubeAi
      Returns:
      the enabled capabilities, empty on a server too old to have any
    • generateMdx

      public EssMdxGeneration generateMdx(String question)
      Description copied from interface: EssCubeAi
      Asks the model to write an MDX query answering a question posed in English, starting a new conversation.
      Specified by:
      generateMdx in interface EssCubeAi
      Parameters:
      question - the question, e.g. "what were sales of Colas in the East in Qtr1?"
      Returns:
      the generated query and the conversation it started
    • generateMdx

      public EssMdxGeneration generateMdx(String question, String conversationId)
      Description copied from interface: EssCubeAi
      Asks a follow-up in an existing conversation, so the model reads the question in the context of what it was already asked.
      Specified by:
      generateMdx in interface EssCubeAi
      Parameters:
      question - the follow-up
      conversationId - the id from the previous answer, or null to start a new conversation
      Returns:
      the generated query
    • getSampleQuestions

      public List<String> getSampleQuestions()
      Description copied from interface: EssCubeAi
      Questions the server suggests as a starting point for this cube - what the web interface offers as examples before anyone has typed anything.
      Specified by:
      getSampleQuestions in interface EssCubeAi
      Returns:
      the sample questions, empty if the server offers none
    • clearConversationHistory

      public void clearConversationHistory(String profileName)
      Description copied from interface: EssCubeAi
      Forgets a conversation on the server, so a later question doesn't inherit its context.
      Specified by:
      clearConversationHistory in interface EssCubeAi
      Parameters:
      profileName - the chat profile the conversation belongs to