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

chore(wren-ai-service): minor updates #1326

Merged
merged 2 commits into from
Feb 24, 2025
Merged

Conversation

cyyeh
Copy link
Member

@cyyeh cyyeh commented Feb 23, 2025

  • allow generating rephrased question and intent reasoning using user's preferred language
  • update sample config examples

Summary by CodeRabbit

  • Documentation

    • Updated configuration examples with clearer, step-by-step guidance for setting up your configuration, including using personalized language and embedding models and referencing the appropriate pipe definitions.
  • New Features

    • Enhanced the classification process by ensuring that both the reasoning and rephrased responses consistently match the user-specified output language.

@cyyeh cyyeh added module/ai-service ai-service related ci/ai-service ai-service related labels Feb 23, 2025
Copy link
Contributor

coderabbitai bot commented Feb 23, 2025

Walkthrough

This pull request updates several configuration example files by enhancing their instructional comments. The new comments guide users on configuring their custom LLM and embedding models, using the proper pipe definitions from a specified URL, and correctly filling in models. The azure configuration file additionally instructs users to rename and move the file to a specific directory. Additionally, the intent classification module now includes a new language parameter to enforce language consistency in both reasoning and rephrased output.

Changes

Files Change Summary
wren-ai-service/docs/config_examples/config.azure.yaml, .../config.deepseek.yaml, .../config.google_ai_studio.yaml, .../config.groq.yaml, .../config.ollama.yaml Updated instructional comments to include detailed setup steps: using personal LLM/embedding models, correct pipe definitions via a specified URL, and filling in appropriate models. The azure file additionally instructs renaming and placement in ~/.wrenai.
wren-ai-service/src/pipelines/generation/intent_classification.py Modified the prompt function to include a new language parameter, ensuring that both the reasoning and the rephrased user question align with the user-specified output language.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant IC as IntentClassification
    U->>IC: Provide input (question & output language)
    IC->>IC: Call prompt(..., language)
    IC->>IC: Generate reasoning and rephrase question in specified language
    IC->>U: Return language-consistent output
Loading

Possibly related PRs

  • Create config.azure.yaml #1248: Updates configuration setup for config.azure.yaml, closely related to this PR’s instructional enhancements in the same file.

Suggested reviewers

  • paopa

Poem

In the code garden I hop with delight,
Guiding users by day and by night.
Instructions bloom like stars so bright,
Language flows clear, a truly fine sight.
I'm a little rabbit, coding with might 🐰✨!

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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 generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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: 0

🧹 Nitpick comments (2)
wren-ai-service/src/pipelines/generation/intent_classification.py (2)

40-41: Add language validation.

The new requirements enforce language consistency, which aligns with the PR objective. However, consider adding validation to ensure the language parameter is a valid ISO language code.

 - The reasoning of the intent classification MUST use the same language as the Output Language from the user input.
 - The rephrased user's question MUST use the same language as the Output Language from the user input.
+- The Output Language from the user input MUST be a valid ISO 639-1 language code (e.g., 'en' for English, 'es' for Spanish).

230-230: Add type hints for the language parameter.

The language parameter is correctly passed to the prompt builder, but consider adding type hints in the Configuration class to ensure type safety.

# In Configuration class
language: str = Field(description="ISO 639-1 language code for output")
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bdaa1b1 and 6f19ceb.

📒 Files selected for processing (6)
  • wren-ai-service/docs/config_examples/config.azure.yaml (1 hunks)
  • wren-ai-service/docs/config_examples/config.deepseek.yaml (1 hunks)
  • wren-ai-service/docs/config_examples/config.google_ai_studio.yaml (1 hunks)
  • wren-ai-service/docs/config_examples/config.groq.yaml (1 hunks)
  • wren-ai-service/docs/config_examples/config.ollama.yaml (1 hunks)
  • wren-ai-service/src/pipelines/generation/intent_classification.py (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • wren-ai-service/docs/config_examples/config.azure.yaml
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: pytest
🔇 Additional comments (5)
wren-ai-service/src/pipelines/generation/intent_classification.py (1)

110-110: LGTM!

The language parameter is correctly integrated into the prompt template.

wren-ai-service/docs/config_examples/config.ollama.yaml (1)

2-5: Enhanced Instruction Clarity

The updated comments clearly outline the three mandatory steps for setting up the configuration. This detailed guidance (using your own LLM/embedding models, referring to the correct pipe definitions via the provided URL, and ensuring the correct models are specified) will help users avoid configuration mistakes and improve the overall setup experience.

wren-ai-service/docs/config_examples/config.groq.yaml (1)

2-5: Clear and Consistent Setup Instructions

The revised header comments now provide explicit, step-by-step directions for the configuration process. They mirror the clarity seen in the other configuration examples, thereby ensuring users have a consistent experience when setting up the system.

wren-ai-service/docs/config_examples/config.google_ai_studio.yaml (1)

3-6: Detailed Setup Guidance and Version Reminder

The new instructional comments clearly enumerate the three essential steps—using personal LLM/embedding models, referring to the correct pipe definitions via the provided URL, and filling in the appropriate models. Additionally, the reminder to upgrade the service version (line 1) is a helpful prompt to ensure compatibility.

wren-ai-service/docs/config_examples/config.deepseek.yaml (1)

2-5: Improved Instructional Comments for Clarity

The enhanced comments now delineate a three-step process for adjusting the configuration, which is consistent with the changes in the other config files. This structured approach should greatly assist users in setting up their LLM and embedding models correctly.

@cyyeh cyyeh requested a review from paopa February 24, 2025 01:21
@paopa paopa merged commit 30c77b2 into main Feb 24, 2025
11 checks passed
@paopa paopa deleted the chore/ai-service/minor-updates branch February 24, 2025 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/ai-service ai-service related module/ai-service ai-service related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants