From 796958c10b8c1b2cdb64ef852f8d913be5d8fc10 Mon Sep 17 00:00:00 2001 From: Laryn Qi Date: Sat, 15 Jun 2024 22:41:09 -0400 Subject: [PATCH] [su24] get student query (#493) * get student query * allow python prereleases * update setup python version --- .github/workflows/main.yml | 3 ++- client/protocols/help.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6d04ea77..f16cd7c7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -77,9 +77,10 @@ jobs: key: v2-${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} restore-keys: ${{ runner.os }}-pip- - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + allow-prereleases: true - name: Initialize environment shell: bash run: python -m venv "${VENV_DIR}" diff --git a/client/protocols/help.py b/client/protocols/help.py index dca527b7..1a73fe34 100644 --- a/client/protocols/help.py +++ b/client/protocols/help.py @@ -74,6 +74,8 @@ def run(self, messages): consent = self._get_consent(email) context = self._get_context(email) curr_message = {'role': 'user', 'content': code} + student_query = input("Have a specific question? Enter it here (or leave blank for general advice): ").lower().strip() + print() help_payload = { 'email': email, 'promptLabel': 'Get_help', @@ -84,7 +86,8 @@ def run(self, messages): 'version': 'v2', 'key': self.HELP_KEY, 'consent': consent, - 'messages': context + [curr_message] + 'messages': context + [curr_message], + 'studentQuery': student_query, } elif res == 'never': self._set_disabled(email, disabled=True)