Skip to main content

इंस्टॉल करें


बुनियादी उपयोग


Alby के साथ


Tool संदर्भ

Constructor

Tool schema (LLM द्वारा देखा गया)

Methods


Response format

Tool एक ऐसी string लौटाता है जिसे LLM सीधे पढ़ सकता है:

POST उदाहरण


Spending report


Custom agent frameworks

L402Tool एक langchain.tools.BaseTool subclass है — यह किसी भी ऐसे framework के साथ काम करता है जो LangChain tools स्वीकार करता है: LangGraph, CrewAI, AutoGen (adapter के माध्यम से), और अन्य।

Error handling

BudgetExceededError को internally पकड़ा जाता है — tool raise करने की बजाय एक [BLOCKED] string लौटाता है, ताकि agent इसे अपने reasoning loop में gracefully handle कर सके। अन्य सभी exceptions (network errors, wallet failures) को [ERROR] <message> के रूप में लौटाया जाता है। यदि आपको programmatic access की आवश्यकता है:

LangChain इंस्टॉल किए बिना

यदि langchain इंस्टॉल नहीं है, तो L402Tool को import करना module level पर सफल होता है (graceful fallback), लेकिन इसे instantiate करने पर यह raise करता है: