-
Notifications
You must be signed in to change notification settings - Fork 19.6k
Labels
feature requestrequest for an enhancement / additional functionalityrequest for an enhancement / additional functionality
Description
Checked other resources
- This is a feature request, not a bug report or usage question.
- I added a clear and descriptive title that summarizes the feature request.
- I used the GitHub search to find a similar feature request and didn't find it.
- I checked the LangChain documentation and API reference to see if this feature already exists.
- This is not related to the langchain-community package.
Feature Description
import asyncio
from langchain.agents import create_agent
from langchain_core.tools import tool
from tanqi.llm.llm import main_model
# Create an intentionally error-prone tool
@tool
def error_prone_tool(input: str) -> str:
"""A tool that always raises an error for demonstration purposes."""
return 1 / 0
# Set up the agent
model = main_model
tools = [error_prone_tool]
agent = create_agent(model, tools)
async def demonstrate_issue():
# Stream events to show missing tool_error event
async for event in agent.astream_events(
{"messages": "Please demonstrate a tool error"},
version="v2",
):
if event["event"] == "on_tool_error":
print(event)
if __name__ == "__main__":
asyncio.run(demonstrate_issue())Use Case
It can help
Proposed Solution
No response
Alternatives Considered
No response
Additional Context
No response
Metadata
Metadata
Assignees
Labels
feature requestrequest for an enhancement / additional functionalityrequest for an enhancement / additional functionality