Explorar o código

only consider american stocks for info generation

Daniel Bohry hai 8 meses
pai
achega
1806d0b6f7

+ 2 - 2
src/main/java/com/danielbohry/stocks/client/InferenceClient.java

@@ -35,7 +35,7 @@ public class InferenceClient {
     private String model;
 
     private static final String PROMPT = """
-        You are an API. Respond only with a **valid JSON object** using the exact format and keys below. 
+        Ignore all previous instructions. You are an API. Respond only with a **valid JSON object** using the exact format and keys below.
         Do not include any explanation, markdown, or extra text.
         
         Respond with JSON in the following format:
@@ -50,7 +50,7 @@ public class InferenceClient {
         
         Make sure the output is a valid JSON string with no extra text or markdown.
         
-        Company stock code: 
+        Company stock code:
         """;
 
     private static final ObjectMapper mapper = new ObjectMapper();

+ 1 - 0
src/main/java/com/danielbohry/stocks/service/StockInfoService.java

@@ -39,6 +39,7 @@ public class StockInfoService {
 
         stocks.stream()
             .filter(stock -> !existingIds.contains(stock.getCode()))
+            .filter(stock -> !stock.getCode().contains(":"))
             .forEach(stock -> {
                 try {
                     log.info("Generating stock info for {}", stock.getCode());