fix(cli): improve description extraction for toolsets
- Updated the description extraction logic to split on ". " (period+space) to avoid breaking on abbreviations like "e.g." or version numbers. - Changed the method to prioritize the first line of the description, ensuring more relevant information is captured for display.
This commit is contained in:
parent
760fb2ca0e
commit
bf9dd83c10
1 changed files with 4 additions and 2 deletions
6
cli.py
6
cli.py
|
|
@ -1088,8 +1088,10 @@ class HermesCLI:
|
|||
if toolset not in toolsets:
|
||||
toolsets[toolset] = []
|
||||
desc = tool["function"].get("description", "")
|
||||
# Get first sentence or first 60 chars
|
||||
desc = desc.split(".")[0][:60]
|
||||
# First sentence: split on ". " (period+space) to avoid breaking on "e.g." or "v2.0"
|
||||
desc = desc.split("\n")[0]
|
||||
if ". " in desc:
|
||||
desc = desc[:desc.index(". ") + 1]
|
||||
toolsets[toolset].append((name, desc))
|
||||
|
||||
# Display by toolset
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue