File tree Expand file tree Collapse file tree
src/main/java/de/unistuttgart/iste/meitrex/common/ollama Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,7 +41,14 @@ public class OllamaClient {
4141 * @throws RuntimeException if the file is not found or cannot be read
4242 */
4343 public String getTemplate (final String templateFileName ) {
44- final String path = config .getPromptFolder () + "/" + templateFileName ;
44+ final String folder = config .getPromptFolder ();
45+ final String sanitizedFolder = folder .startsWith ("/" ) ? folder : "/" + folder ;
46+
47+ final String path = sanitizedFolder .endsWith ("/" )
48+ ? sanitizedFolder + templateFileName
49+ : sanitizedFolder + "/" + templateFileName ;
50+
51+ log .debug ("Attempting to load template from path: {}" , path );
4552
4653 try (InputStream inputStream = this .getClass ().getResourceAsStream (path )) {
4754 if (inputStream == null ) {
You can’t perform that action at this time.
0 commit comments