Abid Ali Awan commited on
Commit
9f096d2
·
1 Parent(s): 9ad74b8

Expand industry and region lists in RegRadarAgent's parameter extraction method to improve query handling. Update prompt to include specific options for industries and regions, enhancing clarity for users.

Browse files
Files changed (1) hide show
  1. agents/reg_radar.py +58 -3
agents/reg_radar.py CHANGED
@@ -30,16 +30,71 @@ class RegRadarAgent:
30
 
31
  def extract_parameters(self, message: str) -> Dict:
32
  """Extract industry, region, and keywords from the query using LLM (no function calling)."""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  prompt = f"""
34
  Extract the following information from the user query below and return ONLY a valid JSON object with keys: industry, region, keywords.
35
- - industry: The industry mentioned or implied (e.g., fintech, healthcare, energy, general).
36
- - region: The region or country explicitly mentioned (e.g., US, EU, UK, Asia, Global).
37
  - keywords: The most important regulatory topics or terms, separated by commas. Do NOT include generic words or verbs.
38
 
39
  User query: {message}
40
 
41
  Example output:
42
- {{"industry": "fintech", "region": "US", "keywords": "SEC regulations"}}
43
  """
44
  response = call_llm(prompt)
45
  try:
 
30
 
31
  def extract_parameters(self, message: str) -> Dict:
32
  """Extract industry, region, and keywords from the query using LLM (no function calling)."""
33
+ # Expanded lists for industries and regions
34
+ industries = [
35
+ "fintech",
36
+ "healthcare",
37
+ "energy",
38
+ "general",
39
+ "IT",
40
+ "AI",
41
+ "manufacturing",
42
+ "telecommunications",
43
+ "transportation",
44
+ "education",
45
+ "retail",
46
+ "finance",
47
+ "insurance",
48
+ "pharmaceuticals",
49
+ "agriculture",
50
+ "media",
51
+ "entertainment",
52
+ "legal",
53
+ "real estate",
54
+ "construction",
55
+ "logistics",
56
+ "food & beverage",
57
+ "automotive",
58
+ "aerospace",
59
+ "defense",
60
+ ]
61
+ regions = [
62
+ "US",
63
+ "EU",
64
+ "UK",
65
+ "Asia",
66
+ "Global",
67
+ "Africa",
68
+ "Middle East",
69
+ "South America",
70
+ "North America",
71
+ "Australia",
72
+ "Canada",
73
+ "China",
74
+ "India",
75
+ "Japan",
76
+ "Russia",
77
+ "Brazil",
78
+ "Mexico",
79
+ "Germany",
80
+ "France",
81
+ "Italy",
82
+ "Spain",
83
+ "Nordics",
84
+ "Southeast Asia",
85
+ ]
86
+ industries_str = ", ".join(industries)
87
+ regions_str = ", ".join(regions)
88
  prompt = f"""
89
  Extract the following information from the user query below and return ONLY a valid JSON object with keys: industry, region, keywords.
90
+ - industry: The industry mentioned or implied. Choose from: {industries_str} (or specify if different).
91
+ - region: The region or country explicitly mentioned. Choose from: {regions_str} (or specify if different).
92
  - keywords: The most important regulatory topics or terms, separated by commas. Do NOT include generic words or verbs.
93
 
94
  User query: {message}
95
 
96
  Example output:
97
+ {{"industry": "AI", "region": "EU", "keywords": "AI Act, data privacy"}}
98
  """
99
  response = call_llm(prompt)
100
  try: