[]
        
(Showing Draft Content)

AIModelResponse

Class AIModelResponse

java.lang.Object
com.grapecity.documents.excel.AIModelResponse

public class AIModelResponse extends Object
Represents the result of an AI model request.

 AIModelResponse response = new AIModelResponse(true, "[[\"Accepted\"]]");
 
  • Constructor Summary

    Constructors
    Constructor
    Description
    Initializes a new instance of the AIModelResponse class.
    AIModelResponse(boolean success, String content)
    Initializes a new instance of the AIModelResponse class with the specified success status and content.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the response content from the model.
    boolean
    Gets a value indicating whether the request was successful.
    void
    setContent(String content)
    Sets the response content from the model.
    void
    setSuccess(boolean success)
    Sets a value indicating whether the request was successful.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AIModelResponse

      public AIModelResponse()
      Initializes a new instance of the AIModelResponse class.
      
       AIModelResponse response = new AIModelResponse();
       response.setSuccess(true);
       response.setContent("[[\"Accepted\"]]");
       
    • AIModelResponse

      public AIModelResponse(boolean success, String content)
      Initializes a new instance of the AIModelResponse class with the specified success status and content.
      
       AIModelResponse response = new AIModelResponse(true, "[[\"Accepted\"]]");
       
      Parameters:
      success - Whether the request was successful.
      content - The response content from the model.
  • Method Details

    • isSuccess

      public boolean isSuccess()
      Gets a value indicating whether the request was successful.
      
       AIModelResponse response = new AIModelResponse(true, "[[\"Accepted\"]]");
       boolean success = response.isSuccess();
       
      Returns:
      true if the request was successful; otherwise, false.
    • setSuccess

      public void setSuccess(boolean success)
      Sets a value indicating whether the request was successful.
      
       AIModelResponse response = new AIModelResponse();
       response.setSuccess(true);
       
      Parameters:
      success - Whether the request succeeded.
    • getContent

      public String getContent()
      Gets the response content from the model.
      
       AIModelResponse response = new AIModelResponse(true, "[[\"Accepted\"]]");
       String content = response.getContent();
       
      Returns:
      The response content from the model.
    • setContent

      public void setContent(String content)
      Sets the response content from the model. The content should be a well-formed JSON 2D array string without additional explanatory text. This ensures direct compatibility with spreadsheet cell ranges. Sample: [["Result1", "Result2"], ["Result3", "Result4"]] or [["result"]]
      
       AIModelResponse response = new AIModelResponse();
       response.setContent("[[\"Accepted\"]]");
       
      Parameters:
      content - The response content returned by the model.