Skip to content

Commit b76d797

Browse files
committed
Fix folder string bug
1 parent fcd4232 commit b76d797

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/main/java/de/unistuttgart/iste/meitrex/common/ollama/OllamaClient.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff 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) {

0 commit comments

Comments
 (0)