mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-04-29 04:00:46 +00:00
Improve multiple concurrent conversations (#54)
This commit is contained in:
parent
3e00703412
commit
b9abdbf0b0
17 changed files with 398 additions and 336 deletions
|
|
@ -12,6 +12,7 @@ import ee.carlrobert.codegpt.settings.SettingsState;
|
|||
import ee.carlrobert.openai.client.ClientCode;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
|
@ -163,4 +164,13 @@ public class ConversationsState implements PersistentStateComponent<Conversation
|
|||
public Conversation getOrStartNew() {
|
||||
return currentConversation == null ? startConversation() : currentConversation;
|
||||
}
|
||||
|
||||
public Optional<Conversation> getConversation(UUID conversationId) {
|
||||
return conversationsContainer.getConversationsMapping()
|
||||
.values()
|
||||
.stream()
|
||||
.flatMap(Collection::stream)
|
||||
.filter(it -> conversationId.equals(it.getId()))
|
||||
.findFirst();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue