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 Summary
Fields inherited from class com.smartgwt.client.core.RefDataClass
idFields inherited from class com.smartgwt.client.core.DataClass
factoryCreated, factoryProperties -
Constructor Summary
Constructors -
Method Summary
Modifier 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.RefDataClass
getRef, getRef, internalSetIDMethods inherited from class com.smartgwt.client.core.DataClass
applyFactoryProperties, 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
-
AIRequest
public AIRequest() -
AIRequest
-
-
Method Details
-
getOrCreateRef
-
setCancellationController
If 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
-
getCancellationController
If provided, theCancellationControllerthat will be looked to for whether the AI request is canceled.- Returns:
- Current cancellationController value. Default value is null
-
setHistoryConclusion
When 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
-
getHistoryConclusion
When 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
-
setHistoryDelimiters
When 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
-
getHistoryDelimiters
When 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
-
setHistoryIntroduction
When 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
-
getHistoryIntroduction
When 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
-
setMessages
List of messages forming the request.- Parameters:
messages- New messages value. Default value is null- Returns:
AIRequestinstance, for chaining setter calls
-
getMessages
List of messages forming the request.- Returns:
- Current messages value. Default value is null
-
setPrompt
Prompt 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
-
getPrompt
Prompt 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
-
setResponseMaximum
When 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
-
getResponseMaximum
When 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
-
setResponseMinimum
When 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
-
getResponseMinimum
When 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
-
setResponseType
The 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
-
getResponseType
The 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"
-
setTemperature
A 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
-
getTemperature
A 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
-