mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-12 08:42:18 +00:00
preserve tool listing post-processing
This commit is contained in:
parent
01013b7e33
commit
4c52080152
2 changed files with 9 additions and 0 deletions
|
|
@ -134,6 +134,14 @@ async def list_tools_with_pagination(
|
|||
ListToolsRequest(params=params),
|
||||
_LenientListToolsResult,
|
||||
)
|
||||
# ClientSession.list_tools() normally performs this post-processing
|
||||
# after decoding: it filters invalid x-mcp-header annotations and
|
||||
# records the derived header/output-schema state used by tools/call.
|
||||
# Keep those semantics when injecting the lenient result model.
|
||||
result = session._absorb_tool_listing(
|
||||
result,
|
||||
complete=cursor is None and result.next_cursor is None,
|
||||
)
|
||||
tools.extend(result.tools)
|
||||
|
||||
next_cursor = result.next_cursor
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ def mock_session():
|
|||
return await session.list_tools()
|
||||
|
||||
session.send_request = AsyncMock(side_effect=send_request)
|
||||
session._absorb_tool_listing.side_effect = lambda result, **_kwargs: result
|
||||
return session
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue