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

Add Document Writing Intelligence #289

Conversation

devleejb
Copy link
Member

@devleejb devleejb commented Aug 13, 2024

What this PR does / why we need it:

This PR introduces the Document Writing Intelligence feature, which enhances the writing experience by providing intelligent suggestions based on the context of the document. This functionality is aimed to improve user productivity and document quality.

Which issue(s) this PR fixes:

Fixes #169

Special notes for your reviewer:
The implementation draws inspiration from Copilot's Prompt, leveraging its capabilities to analyze writing patterns and context, thereby delivering relevant suggestions.

Does this PR introduce a user-facing change?:

NONE

Additional documentation:


Checklist:

  • Added relevant tests or not required
  • Didn't break anything

Summary by CodeRabbit

  • New Features

    • Introduced support for document writing capabilities within the application.
    • Added a new template for generating documentation prompts to enhance user interaction.
    • Expanded the feature list to include "document-writing" as a recognized capability.
  • Enhancements

    • Improved documentation features with practical examples for subscribing to document presence changes.

@devleejb devleejb self-assigned this Aug 13, 2024
@devleejb devleejb linked an issue Aug 13, 2024 that may be closed by this pull request
Copy link
Contributor

coderabbitai bot commented Aug 13, 2024

Walkthrough

The recent changes introduce a documentation writing feature to the IntelligenceService. This enhancement allows users to create documentation seamlessly by leveraging a new prompt template specifically designed for document writing. The updates expand the capabilities of the service, enriching user interactions and improving the overall documentation process.

Changes

Files Change Summary
backend/src/intelligence/intelligence.service.ts
backend/src/intelligence/types/feature.type.ts
Added support for document writing by integrating documentWritingPromptTemplate and introducing a new enum value DOCUMENT_WRITING.
backend/src/intelligence/prompt/document.ts Created a new module that defines documentWritingPromptTemplate for generating documentation prompts, including examples of subscription handling.
backend/src/utils/constants/yorkie-intelligence.ts Enhanced the generateFeatureList function to include a new feature for document writing, expanding the application’s feature set.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant IntelligenceService
    participant DocumentPromptTemplate

    User->>IntelligenceService: Request document writing
    IntelligenceService->>DocumentPromptTemplate: Use documentWritingPromptTemplate
    DocumentPromptTemplate-->>IntelligenceService: Return generated documentation
    IntelligenceService-->>User: Provide documentation response
Loading

Assessment against linked issues

Objective Addressed Explanation
Seamless documentation generation from user inputs (Issue #169)
Automatic translation of input text for consistent documentation (Issue #169) The feature does not specify translation.

🐰 In fields of code where rabbits hop,
New features bloom, and never stop!
Document writing, a joyful cheer,
With Yorkie’s help, the path is clear!
So hop along, let’s write with glee,
For every line, brings joy to me! 🎉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1fdad14 and 75bc189.

Files ignored due to path filters (1)
  • frontend/public/yorkie_intelligence/document.svg is excluded by !**/*.svg
Files selected for processing (4)
  • backend/src/intelligence/intelligence.service.ts (2 hunks)
  • backend/src/intelligence/prompt/document.ts (1 hunks)
  • backend/src/intelligence/types/feature.type.ts (1 hunks)
  • backend/src/utils/constants/yorkie-intelligence.ts (1 hunks)
Additional comments not posted (5)
backend/src/intelligence/types/feature.type.ts (1)

4-4: Addition of DOCUMENT_WRITING enum value is appropriate.

The addition of DOCUMENT_WRITING to the Feature enum correctly extends the feature set. Ensure that this new feature is integrated and utilized properly in the codebase.

backend/src/utils/constants/yorkie-intelligence.ts (1)

24-28: Addition of "document-writing" feature is consistent.

The new feature object for "document-writing" is consistent with existing features. Ensure that the icon path is correct and that the feature is integrated into the application.

backend/src/intelligence/intelligence.service.ts (1)

13-13: Integration of documentWritingPromptTemplate is correct.

The import and integration of documentWritingPromptTemplate into the promptTemplates object is consistent with the existing structure. Ensure that the template is correctly defined and used.

Verification successful

Integration of documentWritingPromptTemplate is verified and correct.

The documentWritingPromptTemplate is properly defined and integrated into the promptTemplates object in intelligence.service.ts. It is associated with Feature.DOCUMENT_WRITING, confirming its intended use. No issues found.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence of the document writing prompt template.

# Test: Check if the document writing prompt template is defined.
ast-grep --lang typescript --pattern $'export const documentWritingPromptTemplate = $_'

Length of output: 4154


Script:

#!/bin/bash
# Description: Search for the usage of documentWritingPromptTemplate within the codebase.

# Test: Check where documentWritingPromptTemplate is used.
rg 'documentWritingPromptTemplate' -A 5

Length of output: 1693

backend/src/intelligence/prompt/document.ts (2)

1-2: Imports look good.

The imported modules are necessary for the prompt template functionality.


76-108: Prompt template is well-defined.

The documentWritingPromptTemplate is comprehensive and aligns with the objectives of the feature.

backend/src/intelligence/prompt/document.ts Show resolved Hide resolved
@devleejb devleejb merged commit c4cd7f5 into main Aug 13, 2024
3 checks passed
@devleejb devleejb deleted the 169-add-yorkie-intelligence-feature-documentation-writing-capability branch August 13, 2024 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

Add Yorkie Intelligence feature: Documentation writing capability
1 participant