-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
add PythonCodeStructuredTool #1747
add PythonCodeStructuredTool #1747
Conversation
This draft involves receiving two 'Code' types as inputs and creating a structured tool.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Although it's different from the initial setup, the method implemented now seems likely to become compatible with tools written in Langchain, so I have only made improvements to the definition method of StructuredTool. |
Code exam
|
This component uses the Code field and employs exec, so providing Code through Tweaks at the API endpoint could lead to dangerous behaviors. Consequently, the Langflow code must be modified to prevent input via Tweaks for fields of the Code type. |
So, do you think we should or shouldn't allow code to be passed through tweaks? |
I believe Langflow has created a very revolutionary type called "Code," so it should not be allowed by default in API calls (to prevent it from being exposed and potentially stolen). However, it might be beneficial to decide on the permissibility of this feature in the future detailed editing of Flow, including remote builds. When I wrote this, I may have lacked a complete understanding of Langflow, as it seems that the Flow, after the build process, is already exposed, rendering my suggestion possibly unnecessary. |
In a similar case, the AutoGPT project uses an env file to manage the following settings:
This setup restricts agents to operate only within a specific directory when managing files.
These settings also allow for the restriction of executable shell commands by agents. It seems like a good idea to refer to this design for improvements. Similarly, it seems like a good idea to define constraints for the Code field using utils. |
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
This draft involves receiving Langchains structed tool 'Code' types as inputs and creating a structured tool.