浏览代码

only consider american stocks for info generation

Daniel Bohry 8 月之前
父节点
当前提交
1806d0b6f7

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

@@ -35,7 +35,7 @@ public class InferenceClient {
     private String model;
     private String model;
 
 
     private static final String PROMPT = """
     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.
         Do not include any explanation, markdown, or extra text.
         
         
         Respond with JSON in the following format:
         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.
         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();
     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()
         stocks.stream()
             .filter(stock -> !existingIds.contains(stock.getCode()))
             .filter(stock -> !existingIds.contains(stock.getCode()))
+            .filter(stock -> !stock.getCode().contains(":"))
             .forEach(stock -> {
             .forEach(stock -> {
                 try {
                 try {
                     log.info("Generating stock info for {}", stock.getCode());
                     log.info("Generating stock info for {}", stock.getCode());