Skip to content

Commit 28c06bc

Browse files
committed
Clarify prerequisite usage of get_data_sources in tool documentation.
1 parent 326364c commit 28c06bc

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

src/tools/chat.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ async def codebase_consultant(
2424
"""
2525
Consult with an AI expert about your codebase for insights, explanations, and architectural guidance.
2626
27+
**PREREQUISITE**: You MUST call `get_data_sources` FIRST to discover available data source names,
28+
UNLESS the user has explicitly provided specific data source names OR you are continuing an
29+
existing conversation with a `conversation_id`.
30+
2731
This consultant understands your entire codebase and can help with:
2832
- Architecture and design decisions
2933
- Implementation strategies

src/tools/datasources.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212

1313
async def get_data_sources(ctx: Context, alive_only: bool = True) -> str:
1414
"""
15-
Gets all available data sources (repositories and workspaces) for the user's account.
15+
**CALL THIS FIRST**: Gets all available data sources (repositories and workspaces) for the user's account.
16+
17+
This tool MUST be called BEFORE using `codebase_search` or `codebase_consultant` to discover
18+
available data source names, UNLESS the user has explicitly provided data source names.
1619
1720
A data source is a code repository or workspace that has been indexed by CodeAlive
1821
and can be used for code search and chat completions.

src/tools/search.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ async def codebase_search(
2424
"""
2525
Use `codebase_search` tool to search for code in the codebase.
2626
27+
**PREREQUISITE**: You MUST call `get_data_sources` FIRST to discover available data source names,
28+
UNLESS the user has explicitly provided specific data source names (e.g., "search in my-repo").
29+
2730
Semantic search (`codebase_search`) is your MAIN exploration tool for understanding the
2831
indexed codebase (typically main/master branch or the specific branch shown in data sources).
2932

0 commit comments

Comments
 (0)