public class AIEngine extends BaseClass
config, configOnly, factoryCreated, factoryProperties, id, scClassName
Constructor and Description |
---|
AIEngine() |
AIEngine(com.google.gwt.core.client.JavaScriptObject jsObj) |
Modifier and Type | Method and Description |
---|---|
boolean |
canSupportVisionRequests()
Whether this AI engine can handle vision requests, or requests where one or more of the messages is an image.
|
boolean |
couldSupportRequest(AIRequest aiRequest)
Determines whether this engine could support the given request.
|
com.google.gwt.core.client.JavaScriptObject |
create() |
java.lang.String |
getEngineId()
The unique ID of this engine.
|
com.google.gwt.core.client.JavaScriptObject |
getJsObj() |
java.lang.String |
getName()
The local name of this engine.
|
com.google.gwt.core.client.JavaScriptObject |
getOrCreateJsObj() |
static AIEngine |
getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj) |
java.lang.String |
getProvider()
The provider of this engine.
|
boolean |
isCreated() |
void |
sendRequest(AIRequest aiRequest,
AIResponseCallback callback)
Sends a request to this AI engine.
|
AIEngine |
setEngineId(java.lang.String engineId)
The unique ID of this engine.
|
void |
setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj) |
AIEngine |
setName(java.lang.String name)
The local name of this engine.
|
AIEngine |
setProvider(java.lang.String provider)
The provider of this engine.
|
addDynamicProperty, addDynamicProperty, addDynamicProperty, addDynamicProperty, applyFactoryProperties, asSGWTComponent, clearDynamicProperty, createJsObj, destroy, doAddHandler, doInit, error, error, errorIfNotCreated, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsString, getAttributeAsStringArray, getClassName, getConfig, getHandlerCount, getID, getRef, getRuleScope, getScClassName, getTestInstance, hasAutoAssignedID, hasDynamicProperty, internalSetID, internalSetID, isConfigOnly, isFactoryCreated, onBind, onInit, registerID, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setConfig, setConfigOnly, setFactoryCreated, setID, setProperty, setProperty, setProperty, setProperty, setRuleScope, setScClassName
public AIEngine()
public AIEngine(com.google.gwt.core.client.JavaScriptObject jsObj)
public static AIEngine getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
public void setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj)
setJavaScriptObject
in class BaseClass
public com.google.gwt.core.client.JavaScriptObject create()
public com.google.gwt.core.client.JavaScriptObject getJsObj()
public com.google.gwt.core.client.JavaScriptObject getOrCreateJsObj()
getOrCreateJsObj
in class BaseClass
public AIEngine setEngineId(java.lang.String engineId) throws java.lang.IllegalStateException
engineId
- New engineId value. Default value is nullAIEngine
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.String getEngineId()
public AIEngine setName(java.lang.String name) throws java.lang.IllegalStateException
name
- New name value. Default value is nullAIEngine
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.String getName()
public AIEngine setProvider(java.lang.String provider) throws java.lang.IllegalStateException
provider
- New provider value. Default value is nullAIEngine
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.String getProvider()
public boolean canSupportVisionRequests()
true
if this AI engine can handle vision requests; false
otherwise.public boolean couldSupportRequest(AIRequest aiRequest)
The reason for the uncertainty is that the implementation may use estimates (e.g. the number of tokens in a given message, as applied to input token limits), or an AI may decide to refuse to respond to the request.
aiRequest
- The request to check.true
if this AIEngine could support the request; false
otherwise.public void sendRequest(AIRequest aiRequest, AIResponseCallback callback)
aiRequest
- The request.callback
- The callback to fire with the response.