Skip to content
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 webhook endpoint, and other fixes #1766

Merged
merged 37 commits into from
May 31, 2024
Merged

Add webhook endpoint, and other fixes #1766

merged 37 commits into from
May 31, 2024

Conversation

ogabrielluiz
Copy link
Contributor

First simple implementation of a webhook feature.

#1732

Copy link

vercel bot commented Apr 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langflow ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 31, 2024 5:36pm

…int to provide clearer information on its purpose, arguments, and return value. Remove outdated request JSON structure and example request sections. Add information on the arguments and exceptions raised for better clarity.
@YamonBot
Copy link
Contributor

I thought the webhook component would be processed later, but you seem like a genius. The code looks very Pythonic and well-written. Additionally, it would be great to add an unmodifiable "Copy" attribute with drag capabilities to the field_type in the frontend code, so users can easily copy the URL directly from the component. Of course, I think this type would be useful not only in this component but in all components where it can be applied.

@ogabrielluiz
Copy link
Contributor Author

ogabrielluiz commented May 23, 2024

I thought the webhook component would be processed later, but you seem like a genius. The code looks very Pythonic and well-written. Additionally, it would be great to add an unmodifiable "Copy" attribute with drag capabilities to the field_type in the frontend code, so users can easily copy the URL directly from the component. Of course, I think this type would be useful not only in this component but in all components where it can be applied.

hey @yamonkjd

How are you?

You are too kind. hahah

I'm not sure I understand the "Copy" attribute part. Could you elaborate?

I understand now and this is something I've been thinking about a lot lately. I'll think of a way to add that.

…unction name to createTabsArray for clarity

feat(constants.ts): add support for including webhook code in tabs array based on flow webhook property
feat(index.tsx): update function calls to use new createTabsArray function and include webhook code in tabs array based on flow webhook property

refactor(utils.ts): remove trailing commas in function parameters to improve code consistency and readability
feat(utils.ts): add support for including webhook cURL code and tweaks code in tabs array creation for better code organization and presentation
The code changes in `Webhook.py` modify the `build` method of the `WebhookComponent` class. If an invalid JSON payload is provided, instead of raising a `ValueError`, the code now handles the exception by creating a default payload with the provided data. The commit also includes a message that describes the invalid JSON payload for better error tracking.

Note: This commit message follows the convention used in the recent user commits.
The Alembic revision IDs for adding webhook columns have been updated to reflect the latest changes. This ensures consistency and proper tracking of the database schema modifications.

Note: The commit message has been generated based on the provided code changes and recent commits.
…ly identify flow ID or endpoint name for running a flow. Improve error handling for invalid UUID strings and flow not found scenarios.
The code changes in `Webhook.py` modify the `build` method of the `WebhookComponent` class. If an invalid JSON payload is provided, instead of raising a `ValueError`, the code now handles the exception by creating a default payload with the provided data.
…eter

The get_flow_by_id function in utils.py has been updated to handle the case where the flow_id parameter is None. Previously, the function would raise an exception if flow_id was not provided. Now, if flow_id is None, the function returns None instead of querying the database. This change improves the robustness of the function and allows for more flexible usage.

Note: The commit message has been generated based on the provided code changes and recent commits.
…_name function

📝 (flow.py): Add get_flow_by_id_or_endpoint_name function to retrieve a Flow object by ID or endpoint name
The code changes in `test_endpoints.py` update the error message when a flow identifier is not found. Previously, the error message referenced the flow ID directly, but now it uses the more generic term "Flow identifier" to account for cases where the identifier could be an endpoint name. This change improves the clarity and flexibility of the error message.

Note: This commit message has been generated based on the provided code changes and recent commits.
@ogabrielluiz ogabrielluiz marked this pull request as ready for review May 31, 2024 17:34
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. enhancement New feature or request labels May 31, 2024
…he simple_run_flow function call to improve code readability and maintainability
@ogabrielluiz ogabrielluiz merged commit 5e2f4b8 into dev May 31, 2024
11 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants