diff --git a/01-chat-models/chat-models-ollama/src/main/java/com/thomasvitale/ai/spring/ChatController.java b/01-chat-models/chat-models-ollama/src/main/java/com/thomasvitale/ai/spring/ChatController.java index ae1c069..675dfe9 100644 --- a/01-chat-models/chat-models-ollama/src/main/java/com/thomasvitale/ai/spring/ChatController.java +++ b/01-chat-models/chat-models-ollama/src/main/java/com/thomasvitale/ai/spring/ChatController.java @@ -3,7 +3,6 @@ import org.springframework.ai.chat.client.ChatClient; import org.springframework.ai.chat.prompt.ChatOptionsBuilder; import org.springframework.ai.ollama.api.OllamaOptions; -import org.springframework.ai.ollama.management.PullModelStrategy; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -57,7 +56,6 @@ String chatWithHuggingFace(@RequestParam(defaultValue = "What did Gandalf say to .prompt(question) .options(OllamaOptions.create() .withModel("hf.co/SanctumAI/Llama-3.2-1B-Instruct-GGUF") - .withPullModelStrategy(PullModelStrategy.WHEN_MISSING) .build()) .call() .content(); diff --git a/01-chat-models/chat-models-ollama/src/main/java/com/thomasvitale/ai/spring/model/ChatModelController.java b/01-chat-models/chat-models-ollama/src/main/java/com/thomasvitale/ai/spring/model/ChatModelController.java index e5dcdaf..b8823b3 100644 --- a/01-chat-models/chat-models-ollama/src/main/java/com/thomasvitale/ai/spring/model/ChatModelController.java +++ b/01-chat-models/chat-models-ollama/src/main/java/com/thomasvitale/ai/spring/model/ChatModelController.java @@ -4,7 +4,6 @@ import org.springframework.ai.chat.prompt.ChatOptionsBuilder; import org.springframework.ai.chat.prompt.Prompt; import org.springframework.ai.ollama.api.OllamaOptions; -import org.springframework.ai.ollama.management.PullModelStrategy; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -49,7 +48,6 @@ String chatWithProviderOptions(@RequestParam(defaultValue = "What did Gandalf sa String chatWithHuggingFace(@RequestParam(defaultValue = "What did Gandalf say to the Balrog?") String question) { return chatModel.call(new Prompt(question, OllamaOptions.builder() .withModel("hf.co/SanctumAI/Llama-3.2-1B-Instruct-GGUF") - .withPullModelStrategy(PullModelStrategy.WHEN_MISSING) .build())) .getResult().getOutput().getContent(); } diff --git a/01-chat-models/chat-models-ollama/src/main/resources/application.yml b/01-chat-models/chat-models-ollama/src/main/resources/application.yml index a5b30e5..6852f65 100644 --- a/01-chat-models/chat-models-ollama/src/main/resources/application.yml +++ b/01-chat-models/chat-models-ollama/src/main/resources/application.yml @@ -3,6 +3,9 @@ spring: ollama: init: pull-model-strategy: when_missing + chat: + additional-models: + - hf.co/SanctumAI/Llama-3.2-1B-Instruct-GGUF embedding: include: false chat: