Skip to content

Commit

Permalink
model
Browse files Browse the repository at this point in the history
  • Loading branch information
mjfelis committed Nov 11, 2024
1 parent 2826e54 commit ae443de
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,8 @@ private Session getSession(UUID connectionId) {
session = new Session();
session.setConnectionId(connectionId);
this.getModels();
if (ollamaService.checkModels(defaultModel)) {
session.setModel(defaultModel);
em.persist(session);
}
session.setModel(defaultModel);
em.persist(session);


}
Expand Down Expand Up @@ -530,12 +528,21 @@ else if ((session != null) && (session.getAuthTs() != null)) {
if (session.getModel() == null) {
mtProducer.sendMessage(TextMessage.build(message.getConnectionId(), message.getThreadId() , this.getMessage("SET_MODEL_ERROR").replaceAll("MODEL", content)));
} else {
OllamaMsg msg = new OllamaMsg();
msg.setContent(content);
msg.setUuid(session.getConnectionId());
msg.setModel(session.getModel());

ollamaProducer.sendMessage(msg);
if (ollamaService.checkModels(session.getModel())) {
OllamaMsg msg = new OllamaMsg();
msg.setContent(content);
msg.setUuid(session.getConnectionId());
msg.setModel(session.getModel());

ollamaProducer.sendMessage(msg);
} else {
mtProducer.sendMessage(TextMessage.build(message.getConnectionId(), message.getThreadId() , this.getMessage("SET_MODEL_ERROR").replaceAll("MODEL", content)));

}



}


Expand Down
Binary file not shown.

0 comments on commit ae443de

Please sign in to comment.