Gen-AI Developer Classroom notes 02/Apr/2026

Tool Calling

  • We want llms to help us in making
    • a right choice to do actions
  • To perform action we create a tool
  • llms will help us in selecting a right tool
  • Note: (LLMs will not call tools directly)
  • Langchain gives two basic features
    • bind_tools => we pass tool information to llm
    • ToolMessage => llm response on which tool has to be called.
  • Defining a tool: A tool at its very basic level is a simple python function
from langchain_core.tools import tool

@tool
def <function-name>(args) -> Type:
    """Docstring
    """
    ....
    ....
    return something

  • @tool registers the tool
  • type hints define schema
  • docstrings guide llm

  • Refer Here for example usages

Langchain supports create_agent

  • This uses langgraph under the hood
  • Refer Here for basic structure

  • Refer Here to view create_agent usage

By continuous learner

enthusiastic technology learner

Leave a Reply

Discover more from Direct AI Powered By Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading