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

feat:essay question list #27

Merged
merged 1 commit into from
Jul 26, 2024
Merged

feat:essay question list #27

merged 1 commit into from
Jul 26, 2024

Conversation

nsavinda
Copy link
Member

@nsavinda nsavinda commented Jul 26, 2024

Summary by CodeRabbit

  • New Features

    • Introduced functionality to generate essay-type question prompts alongside existing multiple-choice question prompts.
    • Added a new asynchronous endpoint for generating essay questions, enhancing question generation capabilities.
  • Bug Fixes

    • Improved the robustness of answer retrieval in multiple-choice question handling by accommodating various potential key names and enhancing error handling.
  • Documentation

    • Updated error handling and logic for managing different question types within the generation service, providing clearer feedback for invalid inputs.

Copy link

coderabbitai bot commented Jul 26, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The recent updates enhance the application's functionality by introducing support for essay-type questions alongside existing multiple-choice questions. New endpoints and improved logic in various functions allow for better handling of different response formats and error scenarios. These changes create a more robust system for generating and processing questions, enriching the user experience and increasing flexibility in the question generation process.

Changes

Files Change Summary
app/data/questionPrompts.py Added essay_list function to generate essay questions and adapted mcq_list to ensure consistent output.
app/data/responseHandle.py Improved handle_mcq to retrieve answers more flexibly by checking multiple keys and enhanced error handling for empty options.
app/routers/questionGenerate.py Introduced new asynchronous endpoint generate_essay_questions, allowing for essay question generation with error handling.
app/services/generate.py Modified select_prompt and generate_list methods to support multiple question types, including essay questions, with enhanced error logging and handling.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Router
    participant Service
    participant Prompts
    participant ResponseHandler

    User->>Router: Generate essay questions request
    Router->>Service: Call generate_list(text, "essay")
    Service->>Prompts: Select prompt for essay
    Prompts-->>Service: Return essay prompt
    Service->>ResponseHandler: Process generated questions
    ResponseHandler-->>Router: Return response to user
    Router-->>User: Send generated essay questions
Loading

🐰 In fields of thought, where ideas bloom,
A rabbit hops forth, dispelling the gloom.
With essays in hand, and prompts that inspire,
We leap through the pages, setting hearts afire.
So here’s to the changes, both bright and bold,
In the garden of knowledge, new stories unfold! 🌼✨


Note

Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@nsavinda nsavinda merged commit 616e010 into main Jul 26, 2024
1 check passed
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.

1 participant