Commit graph

7 commits

Author SHA1 Message Date
Gabriel Luiz Freitas Almeida
ccba14bec4
feat: Allow variables to be defined outside a Component (#4316)
* feat: Allow variables to be defined outside a Component

Fixes #4315

Modify `prepare_global_scope` function in `src/backend/base/langflow/utils/validate.py` to evaluate classes, functions, and variables defined outside the Component's class.

* **Function Changes:**
  - Add evaluation of external classes using `ast.ClassDef`.
  - Add evaluation of external functions using `ast.FunctionDef`.
  - Add evaluation of external variables using `ast.Assign`.

* **Unit Tests:**
  - Add tests in `src/backend/tests/unit/test_validate_code.py` to verify the evaluation of external classes, functions, and variables.
  - Include tests for multiple external classes and external variables and functions.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/langflow-ai/langflow/issues/4315?shareId=XXXX-XXXX-XXXX-XXXX).

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-10-29 06:45:38 -07:00
Gabriel Luiz Freitas Almeida
2256edec98 Update Python base image to version 3.10 in devcontainer.json 2024-04-17 11:21:05 -03:00
Gabriel Luiz Freitas Almeida
79b12b8135
Revert "Release 0.5.6" 2023-11-06 23:18:49 -03:00
DiogenesBR
e7de71bbaf Fix the commands that run on creation of the devcontainer 2023-09-20 10:40:12 +00:00
Gabriel Luiz Freitas Almeida
53722f3f1d 🔧 chore(devcontainer.json): update devcontainer.json for Langflow Demo Container
🔧 chore(devcontainer.json): update devcontainer.json for Langflow Dev Container
2023-08-21 14:54:09 -03:00
Aaron ("AJ") Steers
88fabf93b0 chore: rename base devcontainer, add dind, add postcreate poetry install 2023-04-28 18:56:16 +00:00
Gabriel Luiz Freitas Almeida
a52c9828ad
Create devcontainer.json 2023-02-09 22:11:42 -03:00