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

Shanbady/chunk size dropdown #1989

Merged
merged 6 commits into from
Jan 27, 2025
Merged

Shanbady/chunk size dropdown #1989

merged 6 commits into from
Jan 27, 2025

Conversation

shanbady
Copy link
Contributor

What are the relevant tickets?

Closes https://github.com/mitodl/hq/issues/6552

Description (What does it do?)

This PR adds a dropdown to the syllabus chat page that allows for selection of the chunk size to use when performing content file search.

Screenshots (if appropriate):

Screenshot 2025-01-24 at 2 47 56 PM

How can this be tested?

  1. Checkout this branch
  2. Make sure you have AI_MIT_SYLLABUS_URL="https://api.rc.learn.mit.edu/api/v0/vector_content_files_search/"
  3. set the openai env var OPENAI_API_KEY (can grab from heroku rc)
  4. set "botEnabled" to true in frontends/main/src/app-pages/ChatSyllabusPage/ChatSyllabusPage.tsx
  5. in ai_chat/views.py set permission_classes to [] (there might be better ways of doing this but for testing locally this worked)
  6. visit the syllabus chat bot endpoint http://open.odl.local:8062/chat_syllabus
  7. try talking to the chat bot. change the chunk size selector to different values and see the size of chunks returned is different (it should also respond slightely differently based on this)

Additional Context

@shanbady shanbady marked this pull request as ready for review January 24, 2025 20:04
@shanbady shanbady added the Needs Review An open Pull Request that is ready for review label Jan 24, 2025
@mbertrand mbertrand self-assigned this Jan 27, 2025
Copy link
Member

@mbertrand mbertrand left a comment

Choose a reason for hiding this comment

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

LGTM, the answers were very similar (a word or two change maybe per change in collection) but the chunks returned did differ.

@mbertrand mbertrand added Waiting on author and removed Needs Review An open Pull Request that is ready for review labels Jan 27, 2025
@shanbady shanbady merged commit a9bd2e6 into main Jan 27, 2025
11 checks passed
@shanbady shanbady deleted the shanbady/chunk-size-dropdown branch January 27, 2025 19:28
This was referenced Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants