LangChain Tool Calling feature just changed everything



AI Summary

Summary: Lang Jan’s Tool Calling Feature

  • Introduction
    • Eden discusses Lang Jan’s tool calling feature.
    • Believes the feature is underrated but crucial for flexibility in model switching.
  • Background
    • Previously, function calling was limited to OpenAI due to API constraints.
    • Other vendors like Vertex Gemini and Anthropic Sonet had incompatible APIs.
    • Lang Jan’s update standardizes the interface for function calling across various models.
  • New Interface Components
    • bind function method: Integrates user-written functions with language models (LLMs).
    • tool calls: Populated by LLMs when a function call is invoked in a response.
    • tool calling agent: Allows use of different models for function calling, not just OpenAI.
  • Usage Example
    • Define tools or use OpenAI’s function calling format.
    • Bind these tools when creating an LLM.
    • LLM decides whether to invoke these functions in its responses.
  • Agent Demonstration
    • Created a function calling agent with OpenAI’s GPT-4 and Anthropic Sonet.
    • Asked both models about the current weather in Dubai and San Francisco in Celsius.
    • Results were traced using LSmith for comparison.
  • Results and Comparison
    • Both models returned similar weather information.
    • OpenAI required two API calls while Anthropic Sonet needed three.
    • The process involved invoking the Tav Search tool for weather data and summarizing results.
  • Conclusion
    • Lang Jan’s tool calling feature simplifies switching between different models with function calling capabilities.
    • The feature is seen as a significant advancement in democratizing machine learning.
    • The community had a strong demand for this flexibility.