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

Pull Request - Connect With Them - Digital Dreamers #105

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

avk1943
Copy link

@avk1943 avk1943 commented Oct 1, 2024

Summary

The Connect With Them feature will empower teachers to build stronger connections with their students and better gauge their interest in the course material. By inputting details about what they teach and describing their students' interests and backgrounds, teachers will receive tailored recommendations on making their lessons more engaging and relevant.

Changes

Added below files:
file_structure_tree

  • Made changes to requirements.txt: changed “fastapi” to “fastapi[standard]”
  • Included logic for generating the recommendations in tools.py.
  • Executor calls made by core.py to generate the recommendations
  • connect-with-them-prompt.txt contains the prompt utilized to generate the recommendations
  • test_core.py and test_tools.py test the core.py and tools.py respectively using pytest

Testing

The new feature was tested using the following unit tests and integration tests. For more details, refer to the documentation.
I) Unit Tests on core.py: test_core.py.

  • The function test_executor _sucess() tests the function for successful recommendation generation. It checks if the output has three recommendations generated.
  • The function test_executor_input_validation_failure() tests the function for proper input validation.
  • The function test_executor_logging_on_exception() tests that the executor function correctly logs errors on exceptions.
  • To run the test file, navigate to the tests directory in the connect_with_them feature folder and run the following command:
pytest test_core.py
  • Expected Output:
    test_core_1
    test_core_2

II) Unit Tests on tools.py: test_tools.py

  • The function test_validate_input_success() tests for successful input validation scenarios.
  • The function test_validate_input_failure() tests for scenarios of input validation failure
  • The function test_CWTRecommendationGenerator() tests for the successful initialization of its namesake class.
  • To run the test file, navigate to the tests directory in the “connect_with_them” feature folder and run the following command:
pytest test_tools.py
  • Expected Output:
    test_tools_1
    test_tools_2

III) Integration Testing
According to the feature description, the FastAPI /docs interface was utilized to check the API's functionality, and all anticipated inputs and outputs were confirmed. Additionally, the feature was deployed using Docker, and the FastAPI application functioned as intended, indicating that the feature is ready for production.

Results

The new feature passed the tests mentioned above and performed its required function without breaking the existing codebase.

  • To run the code, enter the following command:
./local-start.sh
  • Example Input: The feature was tested using the following input:
    ex_input

  • Generated Recommendations
    ex_output_1
    ex_output_2
    ex_output_3

Notes

  • The feature generates personalized recommendations based on input such as the subject taught, grade level, and student interests. These recommendations will help teachers develop engaging and creative lessons for their students through local projects, data analysis, or gamified learning.

  • Documentation: Connect With Them

Screenshots

Included screenshots of

  • The Prompt Engineered for the feature:
    prompt_template

  • metadata.json
    metadata_json

  • The output's JSON format
    output_format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant