/*
 *  Copyright (c) 2023-2026, Easy-Agents (fuhai999@gmail.com).
 *  <p>
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *  <p>
 *  http://www.apache.org/licenses/LICENSE-2.0
 *  <p>
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.easyagents.core.model.client;

import com.easyagents.core.message.AiMessage;
import com.easyagents.core.model.chat.ChatContext;
import com.easyagents.core.model.chat.ChatModel;

public class StreamContext {
    private final ChatModel chatModel;
    private final ChatContext chatContext;
    private final StreamClient client;
    private AiMessage fullMessage;
    private Throwable throwable;


    public StreamContext(ChatModel chatModel, ChatContext context, StreamClient client) {
        this.chatModel = chatModel;
        this.chatContext = context;
        this.client = client;
    }


    public ChatModel getChatModel() {
        return chatModel;
    }

    public ChatContext getChatContext() {
        return chatContext;
    }

    public StreamClient getClient() {
        return client;
    }

    public AiMessage getFullMessage() {
        return fullMessage;
    }

    public void setFullMessage(AiMessage fullMessage) {
        this.fullMessage = fullMessage;
    }

    public Throwable getThrowable() {
        return throwable;
    }

    public void setThrowable(Throwable throwable) {
        this.throwable = throwable;
    }

    public boolean isError() {
        return throwable != null;
    }
}
