enh: apply admin default to builtin web search (#21373)
This commit is contained in:
1 parent
df6e38039f
commit
d01b1d4880
1 file changed
+3
@@ -167,6 +167,9 @@ async def search_web(
|
|||||||
engine = __request__.app.state.config.WEB_SEARCH_ENGINE
|
engine = __request__.app.state.config.WEB_SEARCH_ENGINE
|
||||||
user = UserModel(**__user__) if __user__ else None
|
user = UserModel(**__user__) if __user__ else None
|
||||||
|
|
||||||
|
# Use admin-configured result count if configured, falling back to model-provided count of provided, else default to 5
|
||||||
|
count = __request__.app.state.config.WEB_SEARCH_RESULT_COUNT or count
|
||||||
|
|
||||||
results = await asyncio.to_thread(_search_web, __request__, engine, query, user)
|
results = await asyncio.to_thread(_search_web, __request__, engine, query, user)
|
||||||
|
|
||||||
# Limit results
|
# Limit results
|
||||||
|
|||||||
Reference in new issue
Block a user