deepset-ai / deepset-ai/haystack
Feedback on naming of Tool parameters
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 26.6k
- Forks
- 3.2k
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 194
Description
I had a chance to talk with @deep-rloebbert and gather some feedback on the recent of Agent and the changes that came with Tools (e.g. adding outputs_to_string).
The naming of outputs_to_state and inputs_from_state resonated well with him, but there were a few suggestions for improvement.
- Similar to how we have named the variables in SuperComponent
input_mappingandoutput_mapping, @deep-rloebbert would find the namesinputs_from_state_mappingandoutputs_to_state_mappingmore clear and consistent between our abstractions. - For the
outputs_to_state_mappinga suggestion for rearranging the how the dictionary is passed to it:- Rename source to state_key to indicate where the output should go into state
- Put the name of the final output first
- Rename handler to aggregation_handler to make it clearer that the handler function handles aggregation
# Before
outputs_to_state_mapping:
documents:
source: documents_super_output
handler: None
# After
outputs_to_state_mapping:
documents_super_output: # <-- Put the name of the final output first
state_key: documents # <-- Rename source to state_key
aggregation_handler: None # <-- Rename handler to aggregation_handler
- Preference on renaming
outputs_to_stringtooutputs_to_result_mappingsince thestringnaming is confusing and unclear. So the hope here is thatresult_mappingbetter indicates how we'd like to transform the output of the tool into the final "result" which will be passed back to the LLM.
# Before
outputs_to_string:
source: result
handler: None
# After (can either pass only a string or dict
outputs_to_result_mapping: result # <-- Add an option to just pass a string for convenience
# or
outputs_to_result_mapping: # <-- current version that accepts a dict
source: result
handler: None
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by reviewing the Tool and Agent parameter handling alongside the SuperComponent input_mapping and output_mapping abstractions; determine the migration and compatibility scope for the proposed names and mappings, then define tests that verify the revised configuration forms and final LLM result behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- ai, backend-api-design
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100