Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/uipath_langchain/agent/tools/context_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ def create_context_tool(
llm: BaseChatModel | None = None,
agent: LowCodeAgentDefinition | None = None,
) -> StructuredTool | BaseTool | None:
assert resource.context_type is not None
tool_name = sanitize_tool_name(resource.name)

if resource.context_type == AgentContextType.DATA_FABRIC_ENTITY_SET:
Expand Down
13 changes: 13 additions & 0 deletions tests/agent/tools/test_context_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,19 @@ def test_case_insensitive_retrieval_mode(self, deep_rag_config):
result = create_context_tool(deep_rag_config)
assert isinstance(result, StructuredToolWithArgumentProperties)

def test_legacy_none_context_type_semantic_search(self, semantic_search_config):
# Agents packaged with storage-schema < v48 have no contextType field.
semantic_search_config.context_type = None
result = create_context_tool(semantic_search_config)
assert isinstance(result, StructuredToolWithOutputType)
assert result.name == "test_semantic_search"

def test_legacy_none_context_type_deep_rag(self, deep_rag_config):
deep_rag_config.context_type = None
result = create_context_tool(deep_rag_config)
assert isinstance(result, StructuredToolWithArgumentProperties)
assert result.name == "test_deep_rag"


class TestHandleSemanticSearch:
"""Test cases for handle_semantic_search function."""
Expand Down
Loading