Skip to content

Commit b568818

Browse files
author
Milder Hernandez Cagua
committed
Add additional constructor for ChatHistoryAgentThread
1 parent cbb37c6 commit b568818

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

agents/semantickernel-agents-core/src/main/java/com/microsoft/semantickernel/agents/chatcompletion/ChatHistoryAgentThread.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,25 @@
1616
public class ChatHistoryAgentThread extends BaseAgentThread {
1717
private ChatHistory chatHistory;
1818

19+
/**
20+
* Constructor for ChatHistoryAgentThread.
21+
*
22+
*/
1923
public ChatHistoryAgentThread() {
2024
this(UUID.randomUUID().toString(), new ChatHistory());
2125
}
2226

2327
/**
24-
* Constructor for com.microsoft.semantickernel.agents.chatcompletion.ChatHistoryAgentThread.
28+
* Constructor for ChatHistoryAgentThread.
29+
*
30+
* @param chatHistory The chat history.
31+
*/
32+
public ChatHistoryAgentThread(@Nullable ChatHistory chatHistory) {
33+
this(UUID.randomUUID().toString(), chatHistory);
34+
}
35+
36+
/**
37+
* Constructor for ChatHistoryAgentThread.
2538
*
2639
* @param id The ID of the thread.
2740
* @param chatHistory The chat history.
@@ -31,6 +44,8 @@ public ChatHistoryAgentThread(String id, @Nullable ChatHistory chatHistory) {
3144
this.chatHistory = chatHistory != null ? chatHistory : new ChatHistory();
3245
}
3346

47+
48+
3449
/**
3550
* Get the chat history.
3651
*

0 commit comments

Comments
 (0)