Commit 5bc99c2
feat: Add Human in the Loop confirmation strategies for tool execution in Agent (#369)
* Initial commit
* Refactoring
* Add more docstrings
* Add agent example
* doc strings
* Formatting
* Linting and mypy
* PR comments
Some renaming and example how I'd like the interface to look
Alternative implementation
formatting
Continue work on alternative
Fixes
Add more examples
Change name of file
* Add missing header
* Formatting
* PR comments
* PR comments
* docstrings and refactoring
* Cleaning up and moving some things to base classes instead of protocols
* Start adding pydoc files
* Start updating readme
* Add new example using multi-agent architecture and refactoring
* Refactoring
* More refactoring
* Make UIs threadsafe
* Update docs
* formatting
* Formatting
* linting
* Update readme
* Update pydoc
* Fix docs
* Fix docs
* Add update_after_confirmation function to allow better control of updating a Policy's state
* PR comments
* update pydocs
* PR comments and starting to add tests
* formatting
* PR comments and added new execute param to ToolExecutionDecision
* Add docstrings, update how modify parameters works
* Update parameter modification prompt
* Make parameter modification more robust and user friendly
* Add more docstrings
* Add more tests
* Update tests
* Remove file
* Refactor to make the policies, user interfaces and strategies to directly take in tool name and description instead of a tool instance. Should be better for exchanging information over a RestAPI
* feat: Update HiTL confirmation strategies to work with Breakpoints (#372)
* Exploring supporting hitl using breakpoints
* Add example script
* Update example so using only break points to stop and start execution works
* Keep working on the examples
* Updating example
* Making progress, the confirm, and modify both work now. The rejection option still has a problem.
* Get example to work
* Work on some of the TODOs
* Add tool_id to ToolExecutionDecision
* Use the serialized chat messages instead of just the tool calls
* Minor formatting update
* Refactoring
* Refactor to move confirmation strategy logic to Agent instead of ToolInvoker
* More refactoring and prep for getting BreakpointConfirmationStrategy to work
* Add missing run_async to Agent and remove unused test file
* Add missing import
* First version of HiTL + Breakpoints is working!
* Some refactoring and adding a TODO
* Refactoring example script to be a bit more robust
* Fixed some bugs
* Some cleanup
* Rename file
* Fix a bug to get multiple sequential tool calls to work
* Cleanup
* Cleanup and formatting
* Cleanup and refactoring
* Refactoring
* More refactoring
* More refactoring and updated _get_tool_calls_and_descriptions properly creates the final set of tool arguments
* Refactoring based on comments
* More cleanup
* Update example
* Formatting
* fix license header
* Fix sede bug
* PR comments and simplification
* Do more monkey patching
* PR comments
* PR comments
* Refactoring and cleanup of utilities in strategies.py
* Fix issue. Use tool name as fall back to match tool execution decision to tool call
* ignore pylint import issues
* Resolve todo
* Two tool call question now works as expected
* Fixing typing and formatting
* Formatting
* Update readme and docs
* remove tool invoker docs since not needed anymore
* Add some integration tests for Agent using confirmation strategies
* Add more unit tests
* Update haystack_experimental/components/agents/human_in_the_loop/breakpoint.py
Co-authored-by: Stefano Fiorucci <[email protected]>
* Refactoring based on PR comments
* formatting and types
---------
Co-authored-by: Stefano Fiorucci <[email protected]>
* Add tests for strategies.py
* More tests and slight refactoring
* fix test
* Add confirmation strategies to run_async in Agent and add integration tests
* More tests for user interfaces
* Add more tests
* More tests
---------
Co-authored-by: Stefano Fiorucci <[email protected]>1 parent c554cc5 commit 5bc99c2
File tree
29 files changed
+3624
-13
lines changed- docs/pydoc/config
- haystack_experimental
- components/agents
- human_in_the_loop
- core
- pipeline
- dataclasses
- test/components/agents
- human_in_the_loop
29 files changed
+3624
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
72 | | - | |
73 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
74 | 80 | | |
75 | 81 | | |
76 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
0 commit comments