Skip to content

Commit

Permalink
polish
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli committed Jul 6, 2024
1 parent 9e7aa22 commit 370e8c4
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
10 changes: 10 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@
"projectName": "rag-langchain4j-AllMiniLmL6V2-llm",
"args": "",
"envFile": "${workspaceFolder}/.env"
},
{
"type": "java",
"name": "Spring Boot-LlmRagWithSpringAiApplication<rag-springai-ollama-llm>",
"request": "launch",
"cwd": "${workspaceFolder}",
"mainClass": "com.learning.ai.llmragwithspringai.LlmRagWithSpringAiApplication",
"projectName": "rag-springai-ollama-llm",
"args": "",
"envFile": "${workspaceFolder}/.env"
}
]
}
2 changes: 1 addition & 1 deletion java-openai/src/main/java/com/example/learning/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ public static void main(String[] args) throws IOException, InterruptedException

String body = response.body();
ChatResponse chatResponse = mapper.readValue(body, ChatResponse.class);
System.out.println(chatResponse.choices().get(0).message().content());
System.out.println(chatResponse.choices().getFirst().message().content());
}
}
1 change: 0 additions & 1 deletion rag/rag-springai-ollama-llm/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.7'
services:
ollama:
image: langchain4j/ollama-llama3:latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class LlmRagWithSpringAiApplication {
class LlmRagWithSpringAiApplication {

public static void main(String[] args) {
SpringApplication.run(LlmRagWithSpringAiApplication.class, args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@RestController
@RequestMapping("/api/ai")
@Validated
public class AiController {
class AiController {

private static final Logger LOGGER = LoggerFactory.getLogger(AiController.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@RestController
@RequestMapping("/api/data/v1/")
public class DataIndexController {
class DataIndexController {

private final DataIndexerService dataIndexerService;

Expand All @@ -19,7 +19,7 @@ public DataIndexController(DataIndexerService dataIndexerService) {
}

@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public ResponseEntity<String> load(@RequestPart("file") MultipartFile multipartFile) {
ResponseEntity<String> load(@RequestPart("file") MultipartFile multipartFile) {
try {
this.dataIndexerService.loadData(multipartFile.getResource());
return ResponseEntity.ok("Data indexed successfully!");
Expand All @@ -30,7 +30,7 @@ public ResponseEntity<String> load(@RequestPart("file") MultipartFile multipartF
}

@GetMapping("count")
public Map<String, Long> count() {
Map<String, Long> count() {
return Map.of("count", dataIndexerService.count());
}
}

0 comments on commit 370e8c4

Please sign in to comment.