mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
docs mcp docs update
This commit is contained in:
parent
b006e325cc
commit
a8cf71973d
4 changed files with 29 additions and 18 deletions
|
@ -53,7 +53,7 @@ async def load_mcp_tools(
|
|||
format: The format to convert the tools to
|
||||
By default, the tools are returned in MCP format.
|
||||
|
||||
If format is set to "openai", the tools are converted to OpenAI tools.
|
||||
If format is set to "openai", the tools are converted to OpenAI API compatible tools.
|
||||
"""
|
||||
tools = await session.list_tools()
|
||||
if format == "openai":
|
||||
|
@ -80,7 +80,15 @@ async def call_openai_tool(
|
|||
session: ClientSession,
|
||||
openai_tool: ChatCompletionToolParam,
|
||||
) -> CallToolResult:
|
||||
"""Call an OpenAI tool using MCP client."""
|
||||
"""
|
||||
Call an OpenAI tool using MCP client.
|
||||
|
||||
Args:
|
||||
session: The MCP session to use
|
||||
openai_tool: The OpenAI tool to call. You can get this from the `choices[0].message.tool_calls[0]` of the response from the OpenAI API.
|
||||
Returns:
|
||||
The result of the MCP tool call.
|
||||
"""
|
||||
mcp_tool = transform_openai_tool_to_mcp_tool(
|
||||
openai_tool=openai_tool,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue