Fixed argref_by_name bug with kwargs #50
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Found an awful dirty bug when using @argref_by_name. To route strings, I wrote it so if a kwarg is passed - like (foo='bar') instead of ('bar') then it will not try to dereference that string to an object from the state. However - SimpleAgent calls all tools via kwarg and ReactAgent calls all tools via args. So, ReactAgent looked great and SimpleAgent was passing strings around and breaking code.
I made it so that if strings are passed and if they do not match a key, just assume they're meant to be used as a literal. However, I did keep an error check if the first argument is a string and not found in state as a valid key, then it throws an error.
I also cleaned up the function a bit and split up tests