Skip to content

Commit 235d490

Browse files
author
Salman Mohammed
committed
Correct folder placement done.
1 parent ba3e1fc commit 235d490

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

plugins/tool_search/in_mem_embeddings/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,24 @@ Optionally, for high-quality embeddings:
1414
pip install utcp-in-mem-embeddings[embedding]
1515
```
1616

17+
Or install the required dependencies directly:
18+
19+
```bash
20+
pip install "sentence-transformers>=2.2.0" "torch>=1.9.0"
21+
```
22+
23+
## Why are sentence-transformers and torch needed?
24+
25+
While the plugin works without these packages (using a simple character frequency-based fallback), installing them provides significant benefits:
26+
27+
- **Enhanced Semantic Understanding**: The `sentence-transformers` package provides pre-trained models that convert text into high-quality vector embeddings, capturing the semantic meaning of text rather than just keywords.
28+
29+
- **Better Search Results**: With these packages installed, the search can understand conceptual similarity between queries and tools, even when they don't share exact keywords.
30+
31+
- **Performance**: The default model (all-MiniLM-L6-v2) offers a good balance between quality and performance for semantic search applications.
32+
33+
- **Fallback Mechanism**: Without these packages, the plugin automatically falls back to a simpler text similarity method, which works but with reduced accuracy.
34+
1735
## How it works
1836

1937
When installed, this package exposes an entry point under `utcp.plugins` so the UTCP core can auto-discover and register the `in_mem_embeddings` strategy.

plugins/tool_search/in_mem_embeddings/test_integration.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,15 @@ async def test_integration():
6767
]
6868

6969
# Create repository
70-
repo = InMemToolRepository(tools)
70+
repo = InMemToolRepository()
7171

72+
# Create a manual and add it to the repository
73+
from utcp.data.utcp_manual import UtcpManual
74+
manual = UtcpManual(tools=tools)
75+
manual_call_template = CallTemplate(name="test_manual", description="Test manual", call_template_type="default")
76+
await repo.save_manual(manual_call_template, manual)
77+
78+
7279
# Test search
7380
results = await strategy.search_tools(repo, "cooking", limit=1)
7481
print(f" ✅ Search completed, found {len(results)} results")

0 commit comments

Comments
 (0)