Skip to content
This repository was archived by the owner on Jun 6, 2024. It is now read-only.

Commit a292898

Browse files
authored
🐛 missing name field (#299)
1 parent 62bae37 commit a292898

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

api/src/main/java/com/theokanning/openai/completion/chat/ChatMessage.java

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package com.theokanning.openai.completion.chat;
22

3-
import lombok.AllArgsConstructor;
4-
import lombok.Data;
5-
import lombok.NoArgsConstructor;
3+
import lombok.*;
64

75
/**
86
* <p>Each object has a role (either "system", "user", or "assistant") and content (the content of the message). Conversations can be as short as 1 message or fill many pages.</p>
@@ -15,14 +13,19 @@
1513
* see <a href="https://platform.openai.com/docs/guides/chat/introduction">OpenAi documentation</a>
1614
*/
1715
@Data
18-
@NoArgsConstructor
16+
@NoArgsConstructor(force = true)
17+
@RequiredArgsConstructor
1918
@AllArgsConstructor
2019
public class ChatMessage {
2120

2221
/**
2322
* Must be either 'system', 'user', or 'assistant'.<br>
2423
* You may use {@link ChatMessageRole} enum.
2524
*/
25+
@NonNull
2626
String role;
27+
@NonNull
2728
String content;
29+
//name is optional, The name of the author of this message. May contain a-z, A-Z, 0-9, and underscores, with a maximum length of 64 characters.
30+
String name;
2831
}

0 commit comments

Comments
 (0)