This commit is contained in:
yumoqing 2026-04-24 11:44:06 +08:00
parent 75fa6c5d29
commit 5a4c2e7393

View File

@ -1,20 +1,20 @@
1|# Get hermes_services list for code dropdown # Get hermes_services list for code dropdown
2|# This .dspy file uses functions released by load_hermes_web_cli() # This .dspy file uses functions released by load_hermes_web_cli()
3|
4|try: try:
5| # Use the function provided by hermes-web-cli module # Use the function provided by hermes-web-cli module
6| services = await get_all_services() services = await get_all_services()
7|
8| # Format for code component (value, text pairs) # Format for code component (value, text pairs)
9| result = [] result = []
10| for service in services: for service in services:
11| result.append({ result.append({
12| "value": str(service.get('id')), "value": str(service.get('id')),
13| "text": service.get('name', f"Service {service.get('id')}") "text": service.get('name', f"Service {service.get('id')}")
14| }) })
15|
16| # Return array directly for code component # Return array directly for code component
17| return result return result
18|except Exception as e: except Exception as e:
19| # On error or no data, return empty array # On error or no data, return empty array
20| return [] return []