Skip to content

Commit de989c8

Browse files
authored
Feat/webui code genesis (#844)
1 parent dc83fa4 commit de989c8

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

ms_agent/config/config.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,21 @@ def traverse_config(_config: Union[DictConfig, ListConfig, Any],
216216
if not hasattr(current, final_key) or getattr(
217217
current, final_key) is None:
218218
logger.info(f'Adding new config key: {key}')
219-
setattr(current, final_key, value)
219+
# Convert temperature to float and max_tokens to int if they're numeric strings
220+
value_to_set = value
221+
if final_key == 'temperature' and isinstance(
222+
value_to_set, str):
223+
try:
224+
value_to_set = float(value_to_set)
225+
except (ValueError, TypeError):
226+
pass
227+
elif final_key == 'max_tokens' and isinstance(
228+
value_to_set, str):
229+
try:
230+
value_to_set = int(value_to_set)
231+
except (ValueError, TypeError):
232+
pass
233+
setattr(current, final_key, value_to_set)
220234

221235
return None
222236

webui/backend/project_discovery.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
class ProjectDiscovery:
1212
"""Discovers and manages projects from the ms-agent projects directory"""
1313

14+
# Whitelist of projects to show in the UI
15+
VISIBLE_PROJECTS = {'code_genesis', 'singularity_cinema'}
16+
1417
def __init__(self, projects_dir: str):
1518
self.projects_dir = projects_dir
1619
self._projects_cache: Optional[List[Dict[str, Any]]] = None
@@ -28,7 +31,9 @@ def discover_projects(self,
2831

2932
for item in os.listdir(self.projects_dir):
3033
item_path = os.path.join(self.projects_dir, item)
31-
if os.path.isdir(item_path) and not item.startswith('.'):
34+
# Only show projects in the whitelist
35+
if os.path.isdir(item_path) and not item.startswith(
36+
'.') and item in self.VISIBLE_PROJECTS:
3237
project_info = self._analyze_project(item, item_path)
3338
if project_info:
3439
projects.append(project_info)

0 commit comments

Comments
 (0)