-
Notifications
You must be signed in to change notification settings - Fork 4.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
fix(get-python-api-code):fixing errors in a file uploading flow, as in issue #2799 #2815
Conversation
This pull request is automatically being deployed by Amplify Hosting (learn more). |
8a86adc
to
91006f1
Compare
@@ -54,7 +54,7 @@ def upload_file(file_path: str, host: str, flow_id: str, components: list[str], | |||
if response["file_path"]: | |||
for component in components: | |||
if isinstance(component, str): | |||
tweaks[component] = {"file_path": response["file_path"]} | |||
tweaks[component] = {"path": response["file_path"]} |
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.
Hey @vertgo
file_path
is the generic field reserved for paths in the Langflow's storage system. All file fields use this same attribute and path
is not always 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.
Try reverting this and see if your tests still work. If not, then maybe keep path
and we fix it later.
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.
if some components use file_path and others use path then we can set them both in tweaks, but i had changed it because it wasn't working (this was v.1.0.9, so that was a while ago)
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.
this looks good to me
fixed the code to allow a return value of 201
properly parse the components argument
handle the case of having no endpoint name to default to flow_id
changing the tweak value of path instead of file_path (correct for the file component)