fixes: Error: Error in SerpAPI search: cannot access local variable 'wrapper' where it is not associated with a value
Closes issue #4640
This pull request includes a small but important change to the build_tool method in the src/backend/base/langflow/components/tools/serp_api.py file. The change improves the handling of the wrapper variable to ensure that the original wrapper is not overwritten when new parameters are provided.
Codebase simplification:
src/backend/base/langflow/components/tools/serp_api.py: Modified the build_tool method to use a local variable local_wrapper instead of reassigning the wrapper variable when new parameters are provided. This ensures that the original wrapper remains unchanged.
fixes: Error: Error in SerpAPI search: cannot access local variable 'wrapper' where it is not associated with a value
Closes issue #4640
This pull request includes a small but important change to the
build_tool
method in thesrc/backend/base/langflow/components/tools/serp_api.py
file. The change improves the handling of thewrapper
variable to ensure that the original wrapper is not overwritten when new parameters are provided.Codebase simplification:
src/backend/base/langflow/components/tools/serp_api.py
: Modified thebuild_tool
method to use a local variablelocal_wrapper
instead of reassigning thewrapper
variable when new parameters are provided. This ensures that the originalwrapper
remains unchanged.