lean-explore 1.1.0__py3-none-any.whl → 1.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lean_explore/mcp/tools.py +29 -33
- {lean_explore-1.1.0.dist-info → lean_explore-1.1.1.dist-info}/METADATA +1 -1
- {lean_explore-1.1.0.dist-info → lean_explore-1.1.1.dist-info}/RECORD +7 -7
- {lean_explore-1.1.0.dist-info → lean_explore-1.1.1.dist-info}/WHEEL +0 -0
- {lean_explore-1.1.0.dist-info → lean_explore-1.1.1.dist-info}/entry_points.txt +0 -0
- {lean_explore-1.1.0.dist-info → lean_explore-1.1.1.dist-info}/licenses/LICENSE +0 -0
- {lean_explore-1.1.0.dist-info → lean_explore-1.1.1.dist-info}/top_level.txt +0 -0
lean_explore/mcp/tools.py
CHANGED
|
@@ -119,12 +119,8 @@ async def search(
|
|
|
119
119
|
limit: int = 10,
|
|
120
120
|
rerank_top: int | None = 50,
|
|
121
121
|
packages: list[str] | None = None,
|
|
122
|
-
) ->
|
|
123
|
-
"""Searches Lean declarations
|
|
124
|
-
|
|
125
|
-
Returns slim results (id, name, short description) to minimize token usage.
|
|
126
|
-
Use get_by_id to retrieve full details for specific declarations, or
|
|
127
|
-
search_verbose to get all fields upfront.
|
|
122
|
+
) -> SearchResponseDict:
|
|
123
|
+
"""Searches Lean declarations by a query string.
|
|
128
124
|
|
|
129
125
|
Args:
|
|
130
126
|
ctx: The MCP context, providing access to the backend service.
|
|
@@ -136,7 +132,7 @@ async def search(
|
|
|
136
132
|
Defaults to None (all packages).
|
|
137
133
|
|
|
138
134
|
Returns:
|
|
139
|
-
A dictionary containing
|
|
135
|
+
A dictionary containing the full search response with all fields.
|
|
140
136
|
"""
|
|
141
137
|
backend = await _get_backend_from_context(ctx)
|
|
142
138
|
logger.info(
|
|
@@ -148,38 +144,22 @@ async def search(
|
|
|
148
144
|
backend, query, limit, rerank_top, packages
|
|
149
145
|
)
|
|
150
146
|
|
|
151
|
-
|
|
152
|
-
summary_results = [
|
|
153
|
-
SearchResultSummary(
|
|
154
|
-
id=result.id,
|
|
155
|
-
name=result.name,
|
|
156
|
-
description=extract_bold_description(result.informalization),
|
|
157
|
-
)
|
|
158
|
-
for result in response.results
|
|
159
|
-
]
|
|
160
|
-
summary_response = SearchSummaryResponse(
|
|
161
|
-
query=response.query,
|
|
162
|
-
results=summary_results,
|
|
163
|
-
count=response.count,
|
|
164
|
-
processing_time_ms=response.processing_time_ms,
|
|
165
|
-
)
|
|
166
|
-
|
|
167
|
-
return summary_response.model_dump(exclude_none=True)
|
|
147
|
+
return response.model_dump(exclude_none=True)
|
|
168
148
|
|
|
169
149
|
|
|
170
150
|
@mcp_app.tool()
|
|
171
|
-
async def
|
|
151
|
+
async def search_summary(
|
|
172
152
|
ctx: MCPContext,
|
|
173
153
|
query: str,
|
|
174
154
|
limit: int = 10,
|
|
175
155
|
rerank_top: int | None = 50,
|
|
176
156
|
packages: list[str] | None = None,
|
|
177
|
-
) ->
|
|
178
|
-
"""Searches Lean declarations and returns
|
|
157
|
+
) -> SearchSummaryResponseDict:
|
|
158
|
+
"""Searches Lean declarations and returns concise results.
|
|
179
159
|
|
|
180
|
-
Returns
|
|
181
|
-
|
|
182
|
-
|
|
160
|
+
Returns slim results (id, name, short description) to minimize token usage.
|
|
161
|
+
Use get_by_id to retrieve full details for specific declarations, or
|
|
162
|
+
search to get all fields upfront.
|
|
183
163
|
|
|
184
164
|
Args:
|
|
185
165
|
ctx: The MCP context, providing access to the backend service.
|
|
@@ -191,11 +171,11 @@ async def search_verbose(
|
|
|
191
171
|
Defaults to None (all packages).
|
|
192
172
|
|
|
193
173
|
Returns:
|
|
194
|
-
A dictionary containing
|
|
174
|
+
A dictionary containing slim search results with id, name, and description.
|
|
195
175
|
"""
|
|
196
176
|
backend = await _get_backend_from_context(ctx)
|
|
197
177
|
logger.info(
|
|
198
|
-
f"MCP Tool '
|
|
178
|
+
f"MCP Tool 'search_summary' called with query: '{query}', limit: {limit}, "
|
|
199
179
|
f"rerank_top: {rerank_top}, packages: {packages}"
|
|
200
180
|
)
|
|
201
181
|
|
|
@@ -203,7 +183,23 @@ async def search_verbose(
|
|
|
203
183
|
backend, query, limit, rerank_top, packages
|
|
204
184
|
)
|
|
205
185
|
|
|
206
|
-
|
|
186
|
+
# Convert full results to slim summaries
|
|
187
|
+
summary_results = [
|
|
188
|
+
SearchResultSummary(
|
|
189
|
+
id=result.id,
|
|
190
|
+
name=result.name,
|
|
191
|
+
description=extract_bold_description(result.informalization),
|
|
192
|
+
)
|
|
193
|
+
for result in response.results
|
|
194
|
+
]
|
|
195
|
+
summary_response = SearchSummaryResponse(
|
|
196
|
+
query=response.query,
|
|
197
|
+
results=summary_results,
|
|
198
|
+
count=response.count,
|
|
199
|
+
processing_time_ms=response.processing_time_ms,
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
return summary_response.model_dump(exclude_none=True)
|
|
207
203
|
|
|
208
204
|
|
|
209
205
|
@mcp_app.tool()
|
|
@@ -21,7 +21,7 @@ lean_explore/extract/types.py,sha256=Sp6sYuioTE_Gs0Z0lbq4h7OMyAnaZafdLV8UGtKn-zs
|
|
|
21
21
|
lean_explore/mcp/__init__.py,sha256=YO0RM466ik2jQk8YMDITzkm3AHPtjEhn7Wm7rOusUXo,462
|
|
22
22
|
lean_explore/mcp/app.py,sha256=PJ2HwX6VyTqKejuI1G8Ld4aO9XWp9hT5H8loaA5g0Lc,2173
|
|
23
23
|
lean_explore/mcp/server.py,sha256=Lf3SCn8ghPNkZ3BybHh3VCXn91F-yX6RSRke1rvC7Pk,8234
|
|
24
|
-
lean_explore/mcp/tools.py,sha256=
|
|
24
|
+
lean_explore/mcp/tools.py,sha256=3MLeePzHS9mMkr97Lx5JM2YxF4QiHBWYZvAh6yBh-9g,7837
|
|
25
25
|
lean_explore/models/__init__.py,sha256=k4tDULTDIp61iLuP-CBXLJzjCaEBgNVgO_x9JpdrjgY,523
|
|
26
26
|
lean_explore/models/search_db.py,sha256=_a6B6FpqUevyHvW4KmNLeziiznIuxftpMUy0AtSDBJE,2673
|
|
27
27
|
lean_explore/models/search_types.py,sha256=3r0eql--zoTGRtwosbvZpTMK7tdBdPSfWPBFTU_pupE,3001
|
|
@@ -35,9 +35,9 @@ lean_explore/util/embedding_client.py,sha256=6XJGJrGTXAiefDr-E1j_SPHTTZMIJYi62Pw
|
|
|
35
35
|
lean_explore/util/logging.py,sha256=hF8YPi-1I6DdC1B_yROXA6u5GG14IIhD0Nym2FfqgRA,649
|
|
36
36
|
lean_explore/util/openrouter_client.py,sha256=C_0HLO5o1seYjGl2zn6897i2onK7CdI6XxtE3cWb3Os,1926
|
|
37
37
|
lean_explore/util/reranker_client.py,sha256=kLCTGPMQuphjwAj0PPi9KXpSzDP7o9JRQJpTbmWGiMs,6074
|
|
38
|
-
lean_explore-1.1.
|
|
39
|
-
lean_explore-1.1.
|
|
40
|
-
lean_explore-1.1.
|
|
41
|
-
lean_explore-1.1.
|
|
42
|
-
lean_explore-1.1.
|
|
43
|
-
lean_explore-1.1.
|
|
38
|
+
lean_explore-1.1.1.dist-info/licenses/LICENSE,sha256=l4QLw1kIvEOjUktmmKm4dycK1E249Qs2s2AQTYbMXpY,11354
|
|
39
|
+
lean_explore-1.1.1.dist-info/METADATA,sha256=q0RKNHMMwkLvPzToLOuUbNoumHaCILKaecT6ypKGmnQ,17084
|
|
40
|
+
lean_explore-1.1.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
41
|
+
lean_explore-1.1.1.dist-info/entry_points.txt,sha256=FuKSRE7GmI9B_kM-xoiWEJj2dQ4upqhHnw8qH1vcjW8,59
|
|
42
|
+
lean_explore-1.1.1.dist-info/top_level.txt,sha256=h51BKWrFvB7iym-IlaNAAHX5MZfA8Gmg-aDuXGo0fQ8,13
|
|
43
|
+
lean_explore-1.1.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|