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

fix: make webhook api call honor webhook component as input #2511

Merged
merged 16 commits into from
Jul 4, 2024

Conversation

ogabrielluiz
Copy link
Contributor

Webhook API call runs all components but it should use the Webhook Input as start component and just run that path.

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 3, 2024
@dosubot dosubot bot added the bug Something isn't working label Jul 3, 2024
@ogabrielluiz ogabrielluiz enabled auto-merge (squash) July 3, 2024 19:41
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Jul 4, 2024
Copy link
Contributor

github-actions bot commented Jul 4, 2024

Pull Request Validation Report

This comment is automatically generated by Conventional PR

Whitelist Report

Whitelist Active Result
Pull request is a draft and should be ignored
Pull request is made by a whitelisted user and should be ignored
Pull request is submitted by a bot and should be ignored
Pull request is submitted by administrators and should be ignored

Result

Pull request does not satisfy any enabled whitelist criteria. Pull request will be validated.

Validation Report

Validation Active Result
All commits in this pull request has valid messages
Pull request does not introduce too many changes
Pull request has a valid title
Pull request has valid branch name
Pull request should have a non-empty body
Pull request has mentioned issues

Result

Pull request is invalid.

Reason

  • Pull request does not mention any issues

Last Modified at 04 Jul 24 13:57 UTC

Copy link
Contributor

github-actions bot commented Jul 4, 2024

Pull Request Validation Report

This comment is automatically generated by Conventional PR

Whitelist Report

Whitelist Active Result
Pull request is a draft and should be ignored
Pull request is made by a whitelisted user and should be ignored
Pull request is submitted by a bot and should be ignored
Pull request is submitted by administrators and should be ignored

Result

Pull request does not satisfy any enabled whitelist criteria. Pull request will be validated.

Validation Report

Validation Active Result
All commits in this pull request has valid messages
Pull request does not introduce too many changes
Pull request has a valid title
Pull request has valid branch name
Pull request should have a non-empty body
Pull request has mentioned issues

Result

Pull request is invalid.

Reason

  • Pull request does not mention any issues

Last Modified at 04 Jul 24 13:58 UTC

@ogabrielluiz ogabrielluiz requested a review from nicoloboschi July 4, 2024 15:20
@vasconceloscezar
Copy link
Collaborator

Tested here, and it is still running isolated components.

And I just tested both /run and /webhook and they seem to trigger all components.

image

With /webhook :
image

With /run:
image

But at least that issue with async code that I had mentioned is gone.

… multiple keywords for improved flexibility and readability
…list for handling webhook inputs in the graph schema
…ed on webhook or chat component presence in input vertices
… Graph class for better readability and maintainability
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jul 4, 2024
@ogabrielluiz ogabrielluiz requested review from italojohnny and removed request for zzzming and nicoloboschi July 4, 2024 17:43
@ogabrielluiz
Copy link
Contributor Author

Tested here, and it is still running isolated components.

And I just tested both /run and /webhook and they seem to trigger all components.

image

With /webhook : image

With /run: image

But at least that issue with async code that I had mentioned is gone.

Should be good now.

@vasconceloscezar
Copy link
Collaborator

Working as expected now!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 4, 2024
@ogabrielluiz ogabrielluiz disabled auto-merge July 4, 2024 18:11
@ogabrielluiz ogabrielluiz merged commit 03329b2 into main Jul 4, 2024
23 of 26 checks passed
@ogabrielluiz ogabrielluiz deleted the webhook_start branch July 4, 2024 18:11
ogabrielluiz added a commit to yaitec/langflow that referenced this pull request Jul 9, 2024
…-ai#2511)

* refactor(base.py): refactor logic to find start_component_id based on multiple keywords for improved flexibility and readability

* feat(schema.py): add WebhookInput component type to INPUT_COMPONENTS list for handling webhook inputs in the graph schema

* refactor(base.py): refactor logic to determine start_component_id based on webhook or chat component presence in input vertices

* refactor: prioritize webhook component for determining start_component_id

* feat(utils.py): add function find_start_component_id to find component ID based on priority list of input types

* refactor(graph/base.py): refactor logic to find start component id in Graph class for better readability and maintainability

* test(test_webhook.py): override pytest fixture to check for OpenAI API key in environment variables before running tests

* test(test_webhook.py): update webhook json

* feat(schema.py): update WebhookInput component type name

* refactor: log package run telemetry in simplified_run_flow

* test: add test for webhook flow on run endpoint

* refactor(graph/base.py): skip unbuilt vertices when getting vertex outputs in Graph class

* refactor: simplify data_input assignment in LCTextSplitterComponent

* refactor: remove unused build method in CharacterTextSplitterComponent

* refactor: update imports in CharacterTextSplitter.py
nicoloboschi pushed a commit to datastax/ragstack-ai-langflow that referenced this pull request Jul 10, 2024
…-ai#2511)

* refactor(base.py): refactor logic to find start_component_id based on multiple keywords for improved flexibility and readability

* feat(schema.py): add WebhookInput component type to INPUT_COMPONENTS list for handling webhook inputs in the graph schema

* refactor(base.py): refactor logic to determine start_component_id based on webhook or chat component presence in input vertices

* refactor: prioritize webhook component for determining start_component_id

* feat(utils.py): add function find_start_component_id to find component ID based on priority list of input types

* refactor(graph/base.py): refactor logic to find start component id in Graph class for better readability and maintainability

* test(test_webhook.py): override pytest fixture to check for OpenAI API key in environment variables before running tests

* test(test_webhook.py): update webhook json

* feat(schema.py): update WebhookInput component type name

* refactor: log package run telemetry in simplified_run_flow

* test: add test for webhook flow on run endpoint

* refactor(graph/base.py): skip unbuilt vertices when getting vertex outputs in Graph class

* refactor: simplify data_input assignment in LCTextSplitterComponent

* refactor: remove unused build method in CharacterTextSplitterComponent

* refactor: update imports in CharacterTextSplitter.py

(cherry picked from commit 03329b2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants