10 ClassLoader classLoader =
OllamaAPI.class.getClassLoader();
11 InputStream inputStream = classLoader.getResourceAsStream(
"sample-db-prompt-template.txt");
12 if (inputStream !=
null) {
13 Scanner scanner =
new Scanner(inputStream);
14 StringBuilder stringBuffer =
new StringBuilder();
15 while (scanner.hasNextLine()) {
16 stringBuffer.append(scanner.nextLine()).append(
"\n");
19 return stringBuffer.toString().replaceAll(
"<question>", question);
21 throw new Exception(
"Sample database question file not found.");