-
Notifications
You must be signed in to change notification settings - Fork 37
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
Feature/semantic routing #540
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… update poetry.lock
Merge in main changes
…mmarisation and extract and some utterances for each route
…n to docker compose for kibana service
…nd also cleaned it up
…ing to also work. Extended semantic routing to include summarisation and extraction
…ot in use currently and formatted
… currently removed as an endpoints
…h and ability routes
gecBurton
approved these changes
Jun 8, 2024
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.
tested in preprod:
- it works very nicely
- i will make some minor formatting changes
gecBurton
reviewed
Jun 8, 2024
""" | ||
|
||
ABILITY_RESPONSE = """ | ||
* I can help you search over selected documents and do Q&A on them. |
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
This PR adds the semantic routing to
rag chat
using the semantic router library, adding 5 routes, 3 with pre-canned response and 2 placeholder routes for summarisation and extraction.Changes proposed in this pull request
Additionally, renamed services.py to dependencies.py. We needed to use HuggingFaceEncoder from the semantic-router library - if we use the OpenAIEncoder from the semantic-router library we get nasty errors, which could be a dynamic linking issuing. HuggingFaceEncorder does the job fine, but can be revisited in future.
Guidance to review
Non-streaming endpoint can be checked using Swagger UI and
test_rag_chat
, however, to test streaming endpoint you would need to go through Django-app. Integration tests added go through streaming endpoint and pass.The
build_chain
function is used for streaming semantic routing, but does not currently work as-is for the non-streaming endpoint. As a result the non-streaming endpoint has some additional code that can be refactored out in future in favour of using thebuild_chain
function. Getting the semantic router library into the codebase and working took priority over and this tech debt should be fixed in due course.Created a
build_vanilla_chain
function ready to use, but as we are not using vanilla chat just yet, it is not yet used in streaming endpoint.Once decision to approved, this PR shout be merged to
main
only after PR #539Relevant links
Things to check