001/*
002 *  Copyright (c) 2023-2026, Agents-Flex (fuhai999@gmail.com).
003 *  <p>
004 *  Licensed under the Apache License, Version 2.0 (the "License");
005 *  you may not use this file except in compliance with the License.
006 *  You may obtain a copy of the License at
007 *  <p>
008 *  http://www.apache.org/licenses/LICENSE-2.0
009 *  <p>
010 *  Unless required by applicable law or agreed to in writing, software
011 *  distributed under the License is distributed on an "AS IS" BASIS,
012 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *  See the License for the specific language governing permissions and
014 *  limitations under the License.
015 */
016package com.agentsflex.core.model.chat.response;
017
018import com.agentsflex.core.model.chat.MessageResponse;
019import com.agentsflex.core.message.AiMessage;
020
021public abstract class AbstractBaseMessageResponse<M extends AiMessage> implements MessageResponse<M> {
022
023    protected boolean error = false;
024    protected String errorMessage;
025    protected String errorType;
026    protected String errorCode;
027
028    public boolean isError() {
029        return error;
030    }
031
032    public void setError(boolean error) {
033        this.error = error;
034    }
035
036    public String getErrorMessage() {
037        return errorMessage;
038    }
039
040    public void setErrorMessage(String errorMessage) {
041        this.errorMessage = errorMessage;
042    }
043
044    public String getErrorType() {
045        return errorType;
046    }
047
048    public void setErrorType(String errorType) {
049        this.errorType = errorType;
050    }
051
052    public String getErrorCode() {
053        return errorCode;
054    }
055
056    public void setErrorCode(String errorCode) {
057        this.errorCode = errorCode;
058    }
059}