All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.litongjava.openai.chat.ChatMessage Maven / Gradle / Ivy

There is a newer version: 1.1.2
Show newest version
package com.litongjava.openai.chat;

import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;

/**
 * the chat request message of openai
 */
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ChatMessage {
  private String role;
  private Object content;

  public void setContent(String content) {
    this.content = content;
  }

  public ChatMessage content(String content) {
    this.content = content;
    return this;
  }

  public ChatMessage multiContents(List multiContents) {
    this.content = multiContents;
    return this;
  }

  public ChatMessage role(String role) {
    this.role = role;
    return this;
  }

  public String getRole() {
    return role;
  }

  public Object getContent() {
    return content;
  }

  public String role() {
    return role;
  }

  public Object content() {
    return content;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy