BaşlayınÜcretsiz Başlayın

Binding multiple tools

You've just built multiple tools! Now you'll be able to add them to your chatbot by first binding them to the LLM. The tools wikipedia_tool, palindrome_checker and historical_events have all been added to your environment along with llm. You'll also create a tool node to add to your chatbot that lists all of the tools available.

Bu egzersiz

Designing Agentic Systems with LangChain

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • From langgraph.prebuilt, import the necessary module for defining a tool node.
  • Complete the list of tools by adding the appropriate tool names present in your environment.
  • Pass the list of tools to the ToolNode() class and assign it to tool_node.
  • Bind the tools to the llm using .bind_tools().

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Import modules required for defining tool nodes
from ____.____ import ____

# List of tools
tools = [____, ____, ____]

# Pass the tools to the ToolNode()
____ = ____(____)

# Bind tools to the LLM
model_with_tools = ____.____(____)
Kodu Düzenle ve Çalıştır