-
Notifications
You must be signed in to change notification settings - Fork 6.1k
fix: loop variable not accessible error #7501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- src/backend/base/langflow/initial_setup/starter_projects/LoopTemplate.json: Language not supported
Comments suppressed due to low confidence (1)
src/backend/base/langflow/graph/vertex/base.py:310
- [nitpick] Consider rephrasing this comment for improved clarity, e.g., 'When executing the loop, assign the param_key item after validation.'
# if the loop is run the param_key item will be set over here
# If the param_key is in the output_names, it means that the loop is run | ||
# if the loop is run the param_key item will be set over here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The comment is awkwardly phrased; consider rewording it for clarity, for example: 'If param_key is in output_names, then the loop is executing.'
# If the param_key is in the output_names, it means that the loop is run | |
# if the loop is run the param_key item will be set over here | |
# If param_key is in output_names, then the loop is executing, | |
# and the param_key item will be set here. |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
@@ -719,6 +719,7 @@ async def _run(self): | |||
|
|||
def __getattr__(self, name: str) -> Any: | |||
if "_attributes" in self.__dict__ and name in self.__dict__["_attributes"]: | |||
# _attributes is a dict of attributes that are not inputs or outputs all the raw data it should have the item. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The comment is unclear and grammatically incorrect; consider rewording it to something like: 'The _attributes dictionary holds additional raw data not included in inputs or outputs.'
# _attributes is a dict of attributes that are not inputs or outputs all the raw data it should have the item. | |
# The _attributes dictionary holds additional raw data not included in inputs or outputs. |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
@ogabrielluiz Note:
|
…angflow into fix-loop-execution
…AI_API_KEY" to "ANTHROPIC_API_KEY" in order to reflect the correct API key being used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
…erence Changed the URL in the test case from "Artificial_intelligence" to "Human_intelligence" to ensure accurate testing of the loop component functionality.
…angflow into fix-loop-execution
CodSpeed Performance ReportMerging #7501 will degrade performances by 47.05%Comparing Summary
Benchmarks breakdown
|
This pull request includes several changes to improve the handling of loop components and edge parameters in the Langflow backend. The most important changes include updating the
aggregated_output
method, adding comments for better code understanding, and modifying the loop template JSON.Improvements to loop component:
src/backend/base/langflow/components/logic/loop.py
: Updated theaggregated_output
method to useself.item
instead ofself.data
for appending to the aggregated list.Code comments for clarity:
src/backend/base/langflow/custom/custom_component/component.py
: Added a comment explaining the purpose of the_attributes
dictionary in the__getattr__
method.src/backend/base/langflow/graph/vertex/base.py
: Added comments to clarify the handling ofparam_key
in the_set_params_from_normal_edge
method.src/backend/base/langflow/graph/vertex/param_handler.py
: Added comments to explain the validation and setting ofparam_key
in the_set_params_from_normal_edge
method.Loop template JSON update:
src/backend/base/langflow/initial_setup/starter_projects/LoopTemplate.json
: Updated the loop template JSON to reflect changes in theaggregated_output
method, ensuring consistency with the codebase.