Class EssCubeAiImpl
- All Implemented Interfaces:
EssCubeAi
/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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe profile every 26.1 server is set up with. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclearConversationHistory(String profileName) Forgets a conversation on the server, so a later question doesn't inherit its context.generateMdx(String question) Asks the model to write an MDX query answering a question posed in English, starting a new conversation.generateMdx(String question, String conversationId) Asks a follow-up in an existing conversation, so the model reads the question in the context of what it was already asked.Which AI capabilities this server has switched on, in one request.Works out whether the AI features on this cube can run, and if not, which prerequisite is missing.getReadiness(EssAiFeature feature) 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.Questions the server suggests as a starting point for this cube - what the web interface offers as examples before anyone has typed anything.withProfile(String profileName) The chat profile capability calls are made against.
-
Field Details
-
DEFAULT_PROFILE
The profile every 26.1 server is set up with. Capability endpoints takeprofileNameas a required parameter with no default, so a caller who never thinks about profiles still has to send something.- See Also:
-
-
Constructor Details
-
EssCubeAiImpl
-
-
Method Details
-
withProfile
Description copied from interface:EssCubeAiThe chat profile capability calls are made against. Every one of them requires a profile name, and the server ships one calleddefault; set this when a site has made its own.- Specified by:
withProfilein interfaceEssCubeAi- Parameters:
profileName- the profile name- Returns:
- this, for chaining
-
getReadiness
Description copied from interface:EssCubeAiWorks out whether the AI features on this cube can run, and if not, which prerequisite is missing. Never throws - an unreachable server comes back asEssAiReadiness.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:
getReadinessin interfaceEssCubeAi- Returns:
- the diagnosis, never null
-
getReadiness
Description copied from interface:EssCubeAiThe 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:
getReadinessin interfaceEssCubeAi- Parameters:
feature- the capability to ask about, or null for AI in general- Returns:
- the diagnosis, never null
-
getEnabledFeatures
Description copied from interface:EssCubeAiWhich 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:
getEnabledFeaturesin interfaceEssCubeAi- Returns:
- the enabled capabilities, empty on a server too old to have any
-
generateMdx
Description copied from interface:EssCubeAiAsks the model to write an MDX query answering a question posed in English, starting a new conversation.- Specified by:
generateMdxin interfaceEssCubeAi- 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
Description copied from interface:EssCubeAiAsks a follow-up in an existing conversation, so the model reads the question in the context of what it was already asked.- Specified by:
generateMdxin interfaceEssCubeAi- Parameters:
question- the follow-upconversationId- the id from the previous answer, or null to start a new conversation- Returns:
- the generated query
-
getSampleQuestions
Description copied from interface:EssCubeAiQuestions the server suggests as a starting point for this cube - what the web interface offers as examples before anyone has typed anything.- Specified by:
getSampleQuestionsin interfaceEssCubeAi- Returns:
- the sample questions, empty if the server offers none
-
clearConversationHistory
Description copied from interface:EssCubeAiForgets a conversation on the server, so a later question doesn't inherit its context.- Specified by:
clearConversationHistoryin interfaceEssCubeAi- Parameters:
profileName- the chat profile the conversation belongs to
-