Added_initial_config

#2
Files changed (2) hide show
  1. app_utils.py +15 -9
  2. state.py +7 -4
app_utils.py CHANGED
@@ -35,22 +35,28 @@ INITIAL_CHAT_HISTORY = [
35
  {"role": "assistant", "content": "Hello there! How can I assist you today?"},
36
  ]
37
 
 
 
 
 
 
 
38
  SINGLE_MODEL_BOT_EXAMPLE_SETTING = {
39
- "Example 1 - GFSFileSystem": (MODELS[0], 0.8, CATEGORIES[0], "Move final_report.pdf' within document directory to 'temp' directory in document. Make sure to create the directory"),
40
- "Example 2 - TradingBot": (MODELS[1], 0.9, CATEGORIES[5], "I'm contemplating enhancing my investment portfolio with some tech industry assets, and I've got my eye on Nvidia Corp. I'm keen to know its current stock price, and would appreciate if you could source this information for me."),
41
- "Example 3 - TravelAPI": (MODELS[2], 0.7, CATEGORIES[6], "As I plan a getaway, I'm curious about all the airports available for my travel. Would you share that information with me?"),
42
  }
43
 
44
  DUAL_MODEL_BOT_1_EXAMPLE_SETTING = {
45
- "Example 1 - GFSFileSystem": (MODELS[0], 0.8, CATEGORIES[0], "Move final_report.pdf' within document directory to 'temp' directory in document. Make sure to create the directory"),
46
- "Example 2 - TradingBot": (MODELS[1], 0.9, CATEGORIES[5], "I'm contemplating enhancing my investment portfolio with some tech industry assets, and I've got my eye on Nvidia Corp. I'm keen to know its current stock price, and would appreciate if you could source this information for me."),
47
- "Example 3 - TravelAPI": (MODELS[2], 0.7, CATEGORIES[6], "As I plan a getaway, I'm curious about all the airports available for my travel. Would you share that information with me?"),
48
  }
49
 
50
  DUAL_MODEL_BOT_2_EXAMPLE_SETTING = {
51
- "Example 1 - GFSFileSystem": (MODELS[3], 0.5, CATEGORIES[0], "Move final_report.pdf' within document directory to 'temp' directory in document. Make sure to create the directory"),
52
- "Example 2 - TradingBot": (MODELS[4], 0.6, CATEGORIES[5], "I'm contemplating enhancing my investment portfolio with some tech industry assets, and I've got my eye on Nvidia Corp. I'm keen to know its current stock price, and would appreciate if you could source this information for me."),
53
- "Example 3 - TravelAPI": (MODELS[0], 0.4, CATEGORIES[6], "As I plan a getaway, I'm curious about all the airports available for my travel. Would you share that information with me?"),
54
  }
55
 
56
  def get_initial_state():
 
35
  {"role": "assistant", "content": "Hello there! How can I assist you today?"},
36
  ]
37
 
38
+ EXAMPLE_1_CONFIG = {"GorillaFileSystem": {"root": {"workspace": {"type": "directory", "contents": {"document": {"type": "directory", "contents": {"final_report.pdf": {"type": "file", "content": "Year2024 This is the final report content including budget analysis and other sections."}, "previous_report.pdf": {"type": "file", "content": "Year203 This is the previous report content with different budget analysis."}}}, "archive": {"type": "directory", "contents": {}}}}}}, "TwitterAPI": {"tweet_counter": 3, "tweets": {"0": {"id": 0, "username": "analyst_pro", "content": "Just finished analyzing the reports!", "tags": ["#analysis", "#reports"], "mentions": []}, "1": {"id": 1, "username": "analyst_pro", "content": "Budget analysis insights coming soon!", "tags": ["#budget", "#analysis", "#insights"], "mentions": []}, "2": {"id": 2, "username": "analyst_pro", "content": "Stay tuned for more updates!", "tags": ["#updates", "#staytuned"], "mentions": []}}, "username": "analyst_pro", "password": "Kj8#mP9$vL2"}}
39
+
40
+ EXAMPLE_2_CONFIG = {"TradingBot": {"orders": {"12345": {"symbol": "AAPL", "price": 210.65, "num_shares": 10, "status": "Completed"}, "order_type": "Buy"}, "account_info": {"account_id": 12345, "balance": 10000.0, "binding_card": 1974202140965533}, "authenticated": True, "market_status": "Closed", "order_counter": 12446, "stocks": {"AAPL": {"price": 227.16, "percent_change": 0.17, "volume": 2.552, "MA(5)": 227.11, "MA(20)": 227.09}, "GOOG": {"price": 2840.34, "percent_change": 0.24, "volume": 1.123, "MA(5)": 2835.67, "MA(20)": 2842.15}, "TSLA": {"price": 667.92, "percent_change": -0.12, "volume": 1.654, "MA(5)": 671.15, "MA(20)": 668.2}, "MSFT": {"price": 310.23, "percent_change": 0.09, "volume": 3.234, "MA(5)": 309.88, "MA(20)": 310.11}, "NVDA": {"price": 220.34, "percent_change": 0.34, "volume": 1.234, "MA(5)": 220.45, "MA(20)": 220.67}, "ALPH": {"price": 1320.45, "percent_change": -0.08, "volume": 1.567, "MA(5)": 1321.12, "MA(20)": 1325.78}, "OMEG": {"price": 457.23, "percent_change": 0.12, "volume": 2.345, "MA(5)": 456.78, "MA(20)": 458.12}, "QUAS": {"price": 725.89, "percent_change": -0.03, "volume": 1.789, "MA(5)": 726.45, "MA(20)": 728.0}, "NEPT": {"price": 88.34, "percent_change": 0.19, "volume": 0.654, "MA(5)": 88.21, "MA(20)": 88.67}, "SYNX": {"price": 345.67, "percent_change": 0.11, "volume": 2.112, "MA(5)": 345.34, "MA(20)": 346.12}}, "watch_list": ["NVDA"], "transaction_history": []}}
41
+
42
+ EXAMPLE_3_CONFIG = None
43
+
44
  SINGLE_MODEL_BOT_EXAMPLE_SETTING = {
45
+ "Example 1 - GFSFileSystem": (MODELS[0], 0.8, CATEGORIES[0], "Move final_report.pdf' within document directory to 'temp' directory in document. Make sure to create the directory", EXAMPLE_1_CONFIG),
46
+ "Example 2 - TradingBot": (MODELS[1], 0.9, CATEGORIES[5], "I'm contemplating enhancing my investment portfolio with some tech industry assets, and I've got my eye on Nvidia Corp. I'm keen to know its current stock price, and would appreciate if you could source this information for me.", EXAMPLE_2_CONFIG),
47
+ "Example 3 - TravelAPI": (MODELS[2], 0.7, CATEGORIES[6], "As I plan a getaway, I'm curious about all the airports available for my travel. Would you share that information with me?", EXAMPLE_3_CONFIG),
48
  }
49
 
50
  DUAL_MODEL_BOT_1_EXAMPLE_SETTING = {
51
+ "Example 1 - GFSFileSystem": (MODELS[0], 0.8, CATEGORIES[0], "Move final_report.pdf' within document directory to 'temp' directory in document. Make sure to create the directory", EXAMPLE_1_CONFIG),
52
+ "Example 2 - TradingBot": (MODELS[1], 0.9, CATEGORIES[5], "I'm contemplating enhancing my investment portfolio with some tech industry assets, and I've got my eye on Nvidia Corp. I'm keen to know its current stock price, and would appreciate if you could source this information for me.", EXAMPLE_2_CONFIG),
53
+ "Example 3 - TravelAPI": (MODELS[2], 0.7, CATEGORIES[6], "As I plan a getaway, I'm curious about all the airports available for my travel. Would you share that information with me?", EXAMPLE_3_CONFIG),
54
  }
55
 
56
  DUAL_MODEL_BOT_2_EXAMPLE_SETTING = {
57
+ "Example 1 - GFSFileSystem": (MODELS[3], 0.5, CATEGORIES[0], "Move final_report.pdf' within document directory to 'temp' directory in document. Make sure to create the directory", EXAMPLE_1_CONFIG),
58
+ "Example 2 - TradingBot": (MODELS[4], 0.6, CATEGORIES[5], "I'm contemplating enhancing my investment portfolio with some tech industry assets, and I've got my eye on Nvidia Corp. I'm keen to know its current stock price, and would appreciate if you could source this information for me.", EXAMPLE_2_CONFIG),
59
+ "Example 3 - TravelAPI": (MODELS[0], 0.4, CATEGORIES[6], "As I plan a getaway, I'm curious about all the airports available for my travel. Would you share that information with me?", EXAMPLE_3_CONFIG),
60
  }
61
 
62
  def get_initial_state():
state.py CHANGED
@@ -68,9 +68,12 @@ class State:
68
  self.save()
69
  return self.restart_chat(self.current_model, self.current_temperature)
70
 
71
- def update_category_and_load_config(self, category):
72
  self.current_category = category
73
- self.test_entry["initial_config"] = {category: {}}
 
 
 
74
  self.test_entry["involved_classes"] = [category]
75
  config_path = os.path.join("config", f"{MAPPINGS[category]}.json")
76
  self.load_config(config_path)
@@ -84,8 +87,8 @@ class State:
84
 
85
  def load_example_and_update(self, example):
86
  self.save()
87
- model, temp, category, message = self.load_example(example)
88
- self.update_category_and_load_config(category)
89
  return model, temp, category, message
90
 
91
  def load_example(self, example):
 
68
  self.save()
69
  return self.restart_chat(self.current_model, self.current_temperature)
70
 
71
+ def update_category_and_load_config(self, category, config=None):
72
  self.current_category = category
73
+ if config is None:
74
+ self.test_entry["initial_config"] = {category: {}}
75
+ else:
76
+ self.test_entry["initial_config"] = {category: config[category]}
77
  self.test_entry["involved_classes"] = [category]
78
  config_path = os.path.join("config", f"{MAPPINGS[category]}.json")
79
  self.load_config(config_path)
 
87
 
88
  def load_example_and_update(self, example):
89
  self.save()
90
+ model, temp, category, message, config = self.load_example(example)
91
+ self.update_category_and_load_config(category, config)
92
  return model, temp, category, message
93
 
94
  def load_example(self, example):