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 conditional router tutorial #287

Merged
merged 6 commits into from
Feb 16, 2024
Merged

Add conditional router tutorial #287

merged 6 commits into from
Feb 16, 2024

Conversation

bilgeyucel
Copy link
Contributor

@bilgeyucel bilgeyucel commented Feb 14, 2024

Fixes #279

@bilgeyucel bilgeyucel self-assigned this Feb 14, 2024
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@bilgeyucel bilgeyucel marked this pull request as ready for review February 14, 2024 12:50
@@ -0,0 +1,540 @@
{
Copy link
Member

@TuanaCelik TuanaCelik Feb 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we nees ro have 2 prompt templates? I think we could make it so that the one promopt template can have a {% if documents_from_web %} block which gets filled in if there's a route from go_to_websearch but maybe I'm off here..


Reply via ReviewNB

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's totally doable as an alternative solution where we create a loop in the pipeline. I didn't want to explain the loop in this tutorial but rather wanted to explain branches

@bilgeyucel
Copy link
Contributor Author

After rechecking the pipeline, I don't think using a Multiplexer adds any value here.
Current run():

pipe.run({"prompt_builder": {"query": query, "documents": documents}, "router": {"query": query}})

run() with a Multiplexer:

pipe.run({"prompt_builder": {"documents": documents}, "multiplexer": {"query": query}})

Now that we've decided not to switch to ChatGenerators, there is nothing to change here. @TuanaCelik please take one last look when you can 🙌

index.toml Outdated Show resolved Hide resolved
@bilgeyucel bilgeyucel merged commit 33d4893 into main Feb 16, 2024
2 checks passed
@bilgeyucel bilgeyucel deleted the conditional-router branch February 16, 2024 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New tutorial for: Conditional Routing
2 participants