-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: Add summarizing and quoting capabilities to 05-assistive-chatbot #30
Conversation
from chatbot.ingest.text_splitter import TextSplitter | ||
|
||
logger = logging.getLogger(f"chatbot.{__name__}") | ||
|
||
|
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.
moved the following to a reusable vector_db.py
so that the same default settings can be used by the chatbot to retrieve from the DB
if quote != card: | ||
card_to_quotes[card].add(quote) |
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 the quote == card title, then don't use it as a quote b/c the card title will already be shown in the UI and the title/question is not particular helpful as a quote.
) | ||
|
||
|
||
ingest_vectordb_wrapper = LocalLangchainChromaVectorDb() |
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.
ingest_vectordb_wrapper
provides the same default settings for use by ingest-guru-cards.py
and the chatbot.
return { | ||
"content": "\n".join(resp + dq_resp + cards_resp), | ||
"elements": [ | ||
# cl.Text(name="Derived Questions", content="\n".join(dq_resp), display="side"), |
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.
Is this still needed?
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.
I'll leave it for now as an example of how to use cl.Text
with different display
parameters -- it's not intuitive.
self.vectordb_wrapper = vector_db.ingest_vectordb_wrapper | ||
self.retrieve_k = int(settings.pop("retrieve_k")) | ||
|
||
# TODO: ingestigate if this should be set to true |
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.
investigate*
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.
no blocking issues, lgtm!
Ticket
Partly resolves https://navalabs.atlassian.net/browse/DST-218
Changes
Populate prototype code in
05-assistive-chatbot
with the summarizing and quoting capabilities from02-household-queries
chatbot.Update handling
settings
for LLM clients and did some general refactoring.Context for reviewers
This provides baseline summarizing and quoting capabilities for the prototype.
Testing
Testing instructions and expected behavior:
pip install -r requirements.txt
.env
rm -rf chroma_db && ./ingest-guru-cards.py
*instruct
model for both LLMs):Settings panel
by clicking on the icon to the left of the bottom text input field.Chat Mode
(synonymous withCHAT_ENGINE
for thecmdline.py
app) and pickopenai :: gpt-3.5-turbo-instruct
as thePrimary LLM
andLLM Model for summarizer
. Adjust the twoTemperature...
settings to play with the responses.Confirm