Skip to content

Commit ec868ad

Browse files
authored
✨ Frontend citation ground color coordinate with search tools
2 parents e062cf9 + 7f6e8d4 commit ec868ad

13 files changed

+49
-16
lines changed

sdk/nexent/core/tools/create_directory_tool.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from smolagents.tools import Tool
77

88
from ..utils.observer import MessageObserver, ProcessType
9+
from ..utils.tools_common_message import ToolSign
910

1011
logger = logging.getLogger("create_directory_tool")
1112

@@ -25,7 +26,7 @@ class CreateDirectoryTool(Tool):
2526
}
2627
output_type = "string"
2728

28-
tool_sign = "f" # File operation tool identifier
29+
tool_sign = ToolSign.FILE_OPERATION.value # File operation tool identifier
2930

3031
def __init__(self,
3132
init_path: str = Field(description="Initial workspace path", default="/mnt/nexent"),

sdk/nexent/core/tools/create_file_tool.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from smolagents.tools import Tool
77

88
from ..utils.observer import MessageObserver, ProcessType
9+
from ..utils.tools_common_message import ToolSign
910

1011
logger = logging.getLogger("create_file_tool")
1112

@@ -27,7 +28,7 @@ class CreateFileTool(Tool):
2728
}
2829
output_type = "string"
2930

30-
tool_sign = "f" # File operation tool identifier
31+
tool_sign = ToolSign.FILE_OPERATION.value # File operation tool identifier
3132

3233
def __init__(self,
3334
init_path: str = Field(description="Initial workspace path", default="/mnt/nexent"),

sdk/nexent/core/tools/delete_directory_tool.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from smolagents.tools import Tool
88

99
from ..utils.observer import MessageObserver, ProcessType
10+
from ..utils.tools_common_message import ToolSign
1011

1112
logger = logging.getLogger("delete_directory_tool")
1213

@@ -25,7 +26,7 @@ class DeleteDirectoryTool(Tool):
2526
}
2627
output_type = "string"
2728

28-
tool_sign = "f" # File operation tool identifier
29+
tool_sign = ToolSign.FILE_OPERATION.value # File operation tool identifier
2930

3031
def __init__(self,
3132
init_path: str = Field(description="Initial workspace path", default="/mnt/nexent"),

sdk/nexent/core/tools/delete_file_tool.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from smolagents.tools import Tool
77

88
from ..utils.observer import MessageObserver, ProcessType
9+
from ..utils.tools_common_message import ToolSign
910

1011
logger = logging.getLogger("delete_file_tool")
1112

@@ -24,7 +25,7 @@ class DeleteFileTool(Tool):
2425
}
2526
output_type = "string"
2627

27-
tool_sign = "f" # File operation tool identifier
28+
tool_sign = ToolSign.FILE_OPERATION.value # File operation tool identifier
2829

2930
def __init__(self,
3031
init_path: str = Field(description="Initial workspace path", default="/mnt/nexent"),

sdk/nexent/core/tools/exa_search_tool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from pydantic import Field
99

1010
from ..utils.observer import MessageObserver, ProcessType
11-
from ..utils.tools_common_message import SearchResultTextMessage
11+
from ..utils.tools_common_message import SearchResultTextMessage, ToolSign
1212

1313
# Get logger instance
1414
logger = logging.getLogger("exa_search_tool")
@@ -22,7 +22,7 @@ class ExaSearchTool(Tool):
2222

2323
inputs = {"query": {"type": "string", "description": "The search query to perform."}}
2424
output_type = "string"
25-
tool_sign = "b" # Used to distinguish different index sources in summary
25+
tool_sign = ToolSign.EXA_SEARCH.value # Used to distinguish different index sources in summary
2626

2727
def __init__(self, exa_api_key:str=Field(description="EXA API key"),
2828
observer: MessageObserver=Field(description="Message observer", default=None, exclude=True),

sdk/nexent/core/tools/knowledge_base_search_tool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from smolagents.tools import Tool
77

88
from ..utils.observer import MessageObserver, ProcessType
9-
from ..utils.tools_common_message import SearchResultTextMessage
9+
from ..utils.tools_common_message import SearchResultTextMessage, ToolSign
1010
from pydantic import Field
1111
from ...vector_database.elasticsearch_core import ElasticSearchCore
1212
from ..models.embedding_model import BaseEmbedding
@@ -29,7 +29,7 @@ class KnowledgeBaseSearchTool(Tool):
2929
"index_names": {"type": "array", "description": "The list of knowledge base index names to search. If not provided, will search all available knowledge bases.", "nullable": True}}
3030
output_type = "string"
3131

32-
tool_sign = "a" # Used to distinguish different index sources for summaries
32+
tool_sign = ToolSign.KNOWLEDGE_BASE.value # Used to distinguish different index sources for summaries
3333

3434
def __init__(self, top_k: int = Field(description="Maximum number of search results", default=5),
3535
index_names: List[str] = Field(description="The list of index names to search", default=None, exclude=True) ,

sdk/nexent/core/tools/linkup_search_tool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from pydantic import Field
88

99
from ..utils.observer import MessageObserver, ProcessType
10-
from ..utils.tools_common_message import SearchResultTextMessage
10+
from ..utils.tools_common_message import SearchResultTextMessage, ToolSign
1111

1212
logger = logging.getLogger("linkup_search_tool")
1313

@@ -20,7 +20,7 @@ class LinkupSearchTool(Tool):
2020
)
2121
inputs = {"query": {"type": "string", "description": "The search query to perform."}}
2222
output_type = "string"
23-
tool_sign = "l" # Used to distinguish different index sources in summary
23+
tool_sign = ToolSign.LINKUP_SEARCH.value # Used to distinguish different index sources in summary
2424

2525
def __init__(
2626
self,

sdk/nexent/core/tools/list_directory_tool.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from smolagents.tools import Tool
77

88
from ..utils.observer import MessageObserver, ProcessType
9+
from ..utils.tools_common_message import ToolSign
910

1011
logger = logging.getLogger("list_directory_tool")
1112

@@ -26,7 +27,7 @@ class ListDirectoryTool(Tool):
2627
}
2728
output_type = "string"
2829

29-
tool_sign = "f" # File operation tool identifier
30+
tool_sign = ToolSign.FILE_OPERATION.value # File operation tool identifier
3031

3132
def __init__(self,
3233
init_path: str = Field(description="Initial workspace path", default="/mnt/nexent"),

sdk/nexent/core/tools/move_item_tool.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from smolagents.tools import Tool
88

99
from ..utils.observer import MessageObserver, ProcessType
10+
from ..utils.tools_common_message import ToolSign
1011

1112
logger = logging.getLogger("move_item_tool")
1213

@@ -26,7 +27,7 @@ class MoveItemTool(Tool):
2627
}
2728
output_type = "string"
2829

29-
tool_sign = "f" # File operation tool identifier
30+
tool_sign = ToolSign.FILE_OPERATION.value # File operation tool identifier
3031

3132
def __init__(self,
3233
init_path: str = Field(description="Initial workspace path", default="/mnt/nexent"),

sdk/nexent/core/tools/read_file_tool.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from smolagents.tools import Tool
77

88
from ..utils.observer import MessageObserver, ProcessType
9+
from ..utils.tools_common_message import ToolSign
910

1011
logger = logging.getLogger("read_file_tool")
1112

@@ -25,7 +26,7 @@ class ReadFileTool(Tool):
2526
}
2627
output_type = "string"
2728

28-
tool_sign = "f" # File operation tool identifier
29+
tool_sign = ToolSign.FILE_OPERATION.value # File operation tool identifier
2930

3031
def __init__(self,
3132
init_path: str = Field(description="Initial workspace path", default="/mnt/nexent"),

0 commit comments

Comments
 (0)