#
Tool Calling
-
Asking some query to the LLM.
-
LLM is like a phone book , it can't call on its own. With some tools only it will.
-
Tools are nothing but FUNCTIONS.
-
Tool calling is also called as FUNCTION Calling.
-
Its a method , which models reliably connect and interact with external tools like API , database or knowledge base.
-
LLM gets set of tools and it decides which tools needs to be invoked for a specific user query and to complete a given task.
-
Next level of this is " MCP ".
#
Code
-
I am just Mocking the data.
-
In Langchain, tool is there . Tool is like the method.its like a rapper functionality.
-
If we write any method and mention "@tool " means --> its calledDECORATOR . Its like tool and object.
-
tool_map is a dictionary.
-
ChatGroq --> if langchain is integrated with Groq.
#
Notes
- Functions are nothing but TOOLS.
- llm will have many functions.
- Infra provider for LLM is Groq site . Creat API key. This is aGroq client --> it will communicate to cloud LLMs. Eg., llama3 , gpt-oss120 billion model, for this we needs API key.
#
Implementation
#
Advantages
- Real-time data access and information retrieval
- Reducing Hallucinations
- Extends capability of LLMs
#
Disadvantages
- Token consumption and Cost
- Cost & Latency
- Security & Safety Risks
#
Questions