Skip to content

Commit c26bc07

Browse files
committed
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.
1 parent 1596dff commit c26bc07

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llamaindex-mcp/ollama_client.ipynb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,12 @@
161161
"from llama_index.tools.mcp import McpToolSpec\n",
162162
"from llama_index.core.agent.workflow import FunctionAgent\n",
163163
"\n",
164-
"async def get_agent(tools: McpToolSpec):\n",
165-
" tools = await tools.to_tool_list_async()\n",
164+
"async def get_agent(tools: McpToolSpec, llm=Settings.llm):\n",
166165
" agent = FunctionAgent(\n",
167166
" name=\"Agent\",\n",
168167
" description=\"An agent that can work with Our Database software.\",\n",
169168
" tools=tools,\n",
170-
" llm=OpenAI(model=\"gpt-4\"),\n",
169+
" llm=llm,\n",
171170
" system_prompt=SYSTEM_PROMPT,\n",
172171
" )\n",
173172
" return agent"

0 commit comments

Comments
 (0)