File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/main/java/io/twentysixty/ollama/hologram/chatbot/svc Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,8 @@ public class OllamaService {
66
66
67
67
public List <OllamaChatMessage > getMessagesFromHistory (UUID connectionId ) {
68
68
69
- List <History > histories = this .getHistory (connectionId );
69
+ Session s = em .find (Session .class , connectionId );
70
+ List <History > histories = this .getHistory (s );
70
71
71
72
List <OllamaChatMessage > messages = new ArrayList <OllamaChatMessage >(histories .size ());
72
73
@@ -101,9 +102,9 @@ public String getChatResponse(List<OllamaChatMessage> messages) throws OllamaBas
101
102
return chatResult .getResponse ();
102
103
}
103
104
104
- public List <History > getHistory (UUID connectionId ) {
105
+ public List <History > getHistory (Session session ) {
105
106
Query q = em .createNamedQuery ("History.find" );
106
- q .setParameter ("connectionId " , connectionId );
107
+ q .setParameter ("session " , session );
107
108
q .setMaxResults (maxHistorySize );
108
109
return q .getResultList ();
109
110
}
You can’t perform that action at this time.
0 commit comments