From c26bc07c504f111770bfd9a0339f55269ea84be9 Mon Sep 17 00:00:00 2001 From: Mohit Agarwal Date: Sun, 15 Jun 2025 23:00:54 +0530 Subject: [PATCH] use the local llm in the agent Use the local llm defined earlier. Tools are being passed to the `get_agent` function. Remove the redundant call to fetch those. --- llamaindex-mcp/ollama_client.ipynb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/llamaindex-mcp/ollama_client.ipynb b/llamaindex-mcp/ollama_client.ipynb index db75f94e1..381919406 100644 --- a/llamaindex-mcp/ollama_client.ipynb +++ b/llamaindex-mcp/ollama_client.ipynb @@ -161,13 +161,12 @@ "from llama_index.tools.mcp import McpToolSpec\n", "from llama_index.core.agent.workflow import FunctionAgent\n", "\n", - "async def get_agent(tools: McpToolSpec):\n", - " tools = await tools.to_tool_list_async()\n", + "async def get_agent(tools: McpToolSpec, llm=Settings.llm):\n", " agent = FunctionAgent(\n", " name=\"Agent\",\n", " description=\"An agent that can work with Our Database software.\",\n", " tools=tools,\n", - " llm=OpenAI(model=\"gpt-4\"),\n", + " llm=llm,\n", " system_prompt=SYSTEM_PROMPT,\n", " )\n", " return agent"