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

Copy edits for Jupyternaut messages #439

Merged
merged 4 commits into from
Nov 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions packages/jupyter-ai/jupyter_ai/chat_handlers/learn.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ async def process_message(self, message: HumanChatMessage):
em_provider_cls, em_provider_args = self.get_embedding_provider()
if not em_provider_cls:
self.reply(
"Sorry, please select an embedding provider before using the `/learn` command."
"Please select an embedding provider in the chat settings, "
"then run your **/learn** command again."
)
return

Expand Down Expand Up @@ -121,17 +122,18 @@ async def process_message(self, message: HumanChatMessage):
)
self.save()

response = f"""🎉 I have learned documents at **{load_path}** and I am ready to answer questions about them.
You can ask questions about these docs by prefixing your message with **/ask**."""
response = f"""🎉 I have learned from documents at **{load_path}** and
I am ready to answer questions about them. You can ask questions about these
documents by starting your message with **/ask**."""
self.reply(response, message)

def _build_list_response(self):
if not self.metadata.dirs:
return "There are no docs that have been learned yet."
return "I haven't learned from any documents yet."

dirs = [dir.path for dir in self.metadata.dirs]
dir_list = "\n- " + "\n- ".join(dirs) + "\n\n"
message = f"""I can answer questions from docs in these directories:
message = f"""I can answer questions about documents in these directories:
{dir_list}"""
return message

Expand Down Expand Up @@ -198,10 +200,10 @@ async def delete_and_relearn(self):
self.log.info(
f"Switching embedding provider from {prev_em_id} to {curr_em_id}."
)
message = f"""🔔 Hi there, it seems like you have updated the embeddings
message = f"""🔔 Hi there! It seems like you have changed the embedding
model from `{prev_em_id}` to `{curr_em_id}`. I have to re-learn the
documents you had previously submitted for learning. Please wait to use
the **/ask** command until I am done with this task."""
documents you had previously submitted for learning. Please wait
until I am done with this task before you use the **/ask** command."""

self.reply(message)

Expand Down Expand Up @@ -236,9 +238,9 @@ async def relearn(self, metadata: IndexMetadata):
dir_list = (
"\n- " + "\n- ".join([dir.path for dir in self.metadata.dirs]) + "\n\n"
)
message = f"""🎉 I am done learning docs in these directories:
message = f"""🎉 I am done learning about documents in these directories:
{dir_list} I am ready to answer questions about them.
You can ask questions about these docs by prefixing your message with **/ask**."""
You can ask me about these documents by starting your message with **/ask**."""
self.reply(message)

def create(
Expand Down
Loading