Package com.smartgwt.client.ai
Class AIRequest
java.lang.Object
com.smartgwt.client.core.JsObject
com.smartgwt.client.core.DataClass
com.smartgwt.client.core.RefDataClass
com.smartgwt.client.ai.AIRequest
- All Implemented Interfaces:
- HasHandlers
Represents a request to AI for a response.
- 
Field SummaryFields inherited from class com.smartgwt.client.core.RefDataClassidFields inherited from class com.smartgwt.client.core.DataClassfactoryCreated, factoryProperties
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionIf provided, theCancellationControllerthat will be looked to for whether the AI request is canceled.When this engine does not support multiple messages, all of the messages of the request must be concatenated together.When this engine does not support multiple messages, all of the messages of the request must be concatenated together.When this engine does not support multiple messages, all of the messages of the request must be concatenated together.List of messages forming the request.static AIRequestgetOrCreateRef(JavaScriptObject jsObj) Prompt text to AI.When theresponseTypeis "number", the maximum value that the response may take.When theresponseTypeis "number", the minimum value that the response may take.The type of content expected from AI.A number from 0 to 1 representing how much variability or creativity in responses AI should generate.setCancellationController(CancellationController cancellationController) If provided, theCancellationControllerthat will be looked to for whether the AI request is canceled.setHistoryConclusion(String historyConclusion) When this engine does not support multiple messages, all of the messages of the request must be concatenated together.setHistoryDelimiters(Map historyDelimiters) When this engine does not support multiple messages, all of the messages of the request must be concatenated together.setHistoryIntroduction(String historyIntroduction) When this engine does not support multiple messages, all of the messages of the request must be concatenated together.setMessages(AIMessageWithSource... messages) List of messages forming the request.Prompt text to AI.setResponseMaximum(Integer responseMaximum) When theresponseTypeis "number", the maximum value that the response may take.setResponseMinimum(Integer responseMinimum) When theresponseTypeis "number", the minimum value that the response may take.setResponseType(AIContentType responseType) The type of content expected from AI.setTemperature(Integer temperature) A number from 0 to 1 representing how much variability or creativity in responses AI should generate.Methods inherited from class com.smartgwt.client.core.RefDataClassgetRef, getRef, internalSetIDMethods inherited from class com.smartgwt.client.core.DataClassapplyFactoryProperties, doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, isFactoryCreated, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject, setFactoryCreated
- 
Constructor Details- 
AIRequestpublic AIRequest()
- 
AIRequest
 
- 
- 
Method Details- 
getOrCreateRef
- 
setCancellationControllerIf provided, theCancellationControllerthat will be looked to for whether the AI request is canceled.- Parameters:
- cancellationController- New cancellationController value. Default value is null
- Returns:
- AIRequestinstance, for chaining setter calls
 
- 
getCancellationControllerIf provided, theCancellationControllerthat will be looked to for whether the AI request is canceled.- Returns:
- Current cancellationController value. Default value is null
 
- 
setHistoryConclusionWhen this engine does not support multiple messages, all of the messages of the request must be concatenated together. This text is included verbatim before the concatenation of all-but-the-last non-system message.- Parameters:
- historyConclusion- New historyConclusion value. Default value is null
- Returns:
- AIRequestinstance, for chaining setter calls
 
- 
getHistoryConclusionWhen this engine does not support multiple messages, all of the messages of the request must be concatenated together. This text is included verbatim before the concatenation of all-but-the-last non-system message.- Returns:
- Current historyConclusion value. Default value is null
 
- 
setHistoryDelimitersWhen this engine does not support multiple messages, all of the messages of the request must be concatenated together. This maps theAIMessageSourceto the delimiter to be used to enclose the content of the message.- Parameters:
- historyDelimiters- New historyDelimiters value. Default value is null
- Returns:
- AIRequestinstance, for chaining setter calls
 
- 
getHistoryDelimitersWhen this engine does not support multiple messages, all of the messages of the request must be concatenated together. This maps theAIMessageSourceto the delimiter to be used to enclose the content of the message.- Returns:
- Current historyDelimiters value. Default value is null
 
- 
setHistoryIntroductionWhen this engine does not support multiple messages, all of the messages of the request must be concatenated together. This text is included verbatim before the concatenation of all-but-the-last non-system message.- Parameters:
- historyIntroduction- New historyIntroduction value. Default value is null
- Returns:
- AIRequestinstance, for chaining setter calls
 
- 
getHistoryIntroductionWhen this engine does not support multiple messages, all of the messages of the request must be concatenated together. This text is included verbatim before the concatenation of all-but-the-last non-system message.- Returns:
- Current historyIntroduction value. Default value is null
 
- 
setMessagesList of messages forming the request.- Parameters:
- messages- New messages value. Default value is null
- Returns:
- AIRequestinstance, for chaining setter calls
 
- 
getMessagesList of messages forming the request.- Returns:
- Current messages value. Default value is null
 
- 
setPromptPrompt text to AI. Ifmessagesare also provided, then this prompt is appended as another message with type "text" and source "user" when submitted to AI.- Parameters:
- prompt- New prompt value. Default value is null
- Returns:
- AIRequestinstance, for chaining setter calls
 
- 
getPromptPrompt text to AI. Ifmessagesare also provided, then this prompt is appended as another message with type "text" and source "user" when submitted to AI.- Returns:
- Current prompt value. Default value is null
 
- 
setResponseMaximumWhen theresponseTypeis "number", the maximum value that the response may take. If not specified, then there is no maximum.- Parameters:
- responseMaximum- New responseMaximum value. Default value is null
- Returns:
- AIRequestinstance, for chaining setter calls
 
- 
getResponseMaximumWhen theresponseTypeis "number", the maximum value that the response may take. If not specified, then there is no maximum.- Returns:
- Current responseMaximum value. Default value is null
 
- 
setResponseMinimumWhen theresponseTypeis "number", the minimum value that the response may take. If not specified, then there is no minimum.- Parameters:
- responseMinimum- New responseMinimum value. Default value is null
- Returns:
- AIRequestinstance, for chaining setter calls
 
- 
getResponseMinimumWhen theresponseTypeis "number", the minimum value that the response may take. If not specified, then there is no minimum.- Returns:
- Current responseMinimum value. Default value is null
 
- 
setResponseTypeThe type of content expected from AI.If this type is "number", then the response from AI is constrained by responseMinimumandresponseMaximum.- Parameters:
- responseType- New responseType value. Default value is "text"
- Returns:
- AIRequestinstance, for chaining setter calls
 
- 
getResponseTypeThe type of content expected from AI.If this type is "number", then the response from AI is constrained by responseMinimumandresponseMaximum.- Returns:
- Current responseType value. Default value is "text"
 
- 
setTemperatureA number from 0 to 1 representing how much variability or creativity in responses AI should generate. 0 is little-to-no variation. 1 is high variation.- Parameters:
- temperature- New temperature value. Default value is null
- Returns:
- AIRequestinstance, for chaining setter calls
 
- 
getTemperatureA number from 0 to 1 representing how much variability or creativity in responses AI should generate. 0 is little-to-no variation. 1 is high variation.- Returns:
- Current temperature value. Default value is null
 
 
-