package com.jeelowcode.framework.ai.platform.chat.tool;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.jeelowcode.framework.ai.platform.chat.ChatMessageType;
import lombok.*;



import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.jeelowcode.framework.ai.platform.chat.ChatMessageType;
import lombok.*;


@Data
@Builder
@NoArgsConstructor(access = AccessLevel.PRIVATE)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ChatMessage {
    private String content;
    private String role;
    private String name;
    private String refusal;

    @JsonProperty("reasoning_content")
    private String reasoningContent;

    @JsonProperty("tool_call_id")
    private String toolCallId;

    public ChatMessage(String userMessage) {
        this.role = ChatMessageType.USER.getRole();
        this.content =userMessage;
    }
    public ChatMessage(ChatMessageType role, String message) {
        this.role = role.getRole();
        this.content = message;
    }
    public ChatMessage(String role, String message) {
        this.role = role;
        this.content = message;
    }

    public static ChatMessage withSystem(String content) {
        return new ChatMessage(ChatMessageType.SYSTEM, content);
    }

    public static ChatMessage withUser(String content) {
        return new ChatMessage(ChatMessageType.USER, content);
    }

    public static ChatMessage withAssistant(String content) {
        return new ChatMessage(ChatMessageType.ASSISTANT, content);
    }

}
