k-krawczyk commented on code in PR #26718:
URL: https://github.com/apache/camel/pull/26718#discussion_r4068413417


##########
test-infra/camel-test-infra-ollama/src/main/java/org/apache/camel/test/infra/ollama/services/OllamaLocalContainerInfraService.java:
##########
@@ -165,27 +166,44 @@ public void initialize() {
         LOG.info("Trying to start the Ollama container");
         container.start();
 
-        LOG.info("Pulling the model {}", getModel());
-        try {
-            container.execInContainer("ollama", "pull", getModel());
-        } catch (IOException | InterruptedException e) {
-            throw new RuntimeException(e);
-        }
+        pullModel(getModel());
 
         String embeddingModel = embeddingModelName();
         if (embeddingModel != null && !embeddingModel.isEmpty()) {
-            LOG.info("Pulling the embedding model {}", embeddingModel);
-            try {
-                container.execInContainer("ollama", "pull", embeddingModel);
-            } catch (IOException | InterruptedException e) {
-                throw new RuntimeException(e);
-            }
+            pullModel(embeddingModel);
         }
 
         registerProperties();
         LOG.info("Ollama instance running at {}", getEndpoint());
     }
 
+    private void pullModel(String model) {
+        LOG.info("Pulling the model {}", model);

Review Comment:
   Taken, with the wording kept as it was: the method now takes what the model 
is pulled as, so the two log lines read "Pulling the model X" and "Pulling the 
embedding model Y" again, and the exception messages say the same. The model 
name alone would usually be enough to tell the two pulls apart, but 
`ollama.model` and `ollama.embedding.model` can be set to the same model, and 
then the two lines are identical - which is the case that makes this worth the 
parameter.
   
   _Reported by Claude Code on behalf of Karol Krawczyk_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to