trading_agent.tools.search_knowledge_tool
¶
The search_knowledge tool: searches the user's documents in workspace/shared/knowledge/.
Typical usage example:
tool = SearchKnowledgeTool(knowledge_base)
SearchKnowledgeArguments
¶
Bases: BaseModel
The arguments of search_knowledge.
Attributes:
| Name | Type | Description |
|---|---|---|
query |
str
|
A few words to look for. |
limit |
int
|
The most passages to return. |
SearchKnowledgeTool
¶
Bases: Tool
Returns the passages of the knowledge base that best match a query.
Creates the tool.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
knowledge_base
|
KnowledgeBase
|
The index. |
required |
Source code in src/trading_agent/tools/search_knowledge_tool.py
run
async
¶
Brings the index up to date, then searches it, in a worker thread.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
arguments
|
SearchKnowledgeArguments
|
The query and the limit. |
required |
Returns:
| Type | Description |
|---|---|
ToolResult
|
The passages, labelled as outside data, or a note that nothing matched. |