Skip to content

refactor: deduplicate tool execution logic in HITL edit handler#41

Open
Abraham Onoja (arome3) wants to merge 2 commits into
langchain-ai:mainfrom
arome3:main
Open

refactor: deduplicate tool execution logic in HITL edit handler#41
Abraham Onoja (arome3) wants to merge 2 commits into
langchain-ai:mainfrom
arome3:main

Conversation

@arome3

Copy link
Copy Markdown

Replaced duplicated if/elif blocks for write_email and schedule_meeting tool execution with a single conditional using an EDITABLE_TOOLS constant. This improves code maintainability and makes adding new editable tools easier by simply updating the constant array.

Changes:
Introduced EDITABLE_TOOLS constant to define which tools support editing
Consolidated duplicate tool execution logic into a single code path
Updated both Python source file and Jupyter notebook
Preserved existing functionality and error handling

**`refactor: deduplicate tool execution logic in edit handler
Replace duplicated if/elif blocks for write_email and schedule_meeting
with a single conditional using EDITABLE_TOOLS constant. Improves
maintainability and makes adding new editable tools easier.`**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant