Enable the recommendation bot to search for specific resource details #205
+107
−64
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.
What are the relevant tickets?
Closes https://github.com/mitodl/hq/issues/6542
Description (What does it do?)
search_content_files
tool to the list of tools available to the recommendation bot, and tweaks the system prompt to provide guidance on when to use it.How can this be tested?
Ask for course recommendations, then ask for some detailed info about 1 or more of the courses (how is it graded, are there any class projects, etc). Keep the conversation going for awhile to ensure the summarization is hit, responses seem reasonable, and no exceptions occur.
Additional Context
I needed to make some changes to the summarization code, because it assumed one tool call at a time, and after a couple rounds of summarization led to some tool output messages getting truncated from the list of messages sent to the summarization llm, leading to exceptions. As part of fixing that, I also simplified it a bit and forced it to create a summary only if the final message is a human message, to fully prevent any occurrences of
human input -> tool call -> summarization -> response
which often led to subpar responses compared tohuman input -> summarization -> tool call -> response
.