Skip to content

fix:modify AI function#162

Merged
lu-yg merged 4 commits intoopentiny:developfrom
zhangjuncao:develop
Jan 23, 2025
Merged

fix:modify AI function#162
lu-yg merged 4 commits intoopentiny:developfrom
zhangjuncao:develop

Conversation

@zhangjuncao
Copy link
Copy Markdown
Collaborator

@zhangjuncao zhangjuncao commented Jan 23, 2025

English | 简体中文

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Built its own designer, fully self-validated

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

Background and solution

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced AI chat service to handle truncated AI responses
    • Improved response handling to ensure complete AI-generated content
  • Improvements

    • Updated unique indexing for page table to support more comprehensive record identification
    • Updated ERNIE AI model version to ERNIE-4.0-8K
  • Technical Updates

    • Refined AI response processing logic to accumulate and validate complete responses

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 23, 2025

Walkthrough

The pull request introduces changes across three files: a MySQL SQL schema, an enum in a common utilities class, and an AI chat service implementation. The modifications include updating a unique index in the t_page table, changing the representation of an AI model enum constant, and enhancing the AI chat service's response handling mechanism to manage potentially truncated AI responses more robustly.

Changes

File Change Summary
app/src/main/resources/sql/mysql/create_all_tables_ddl_v1.mysql.sql Updated unique index u_idx_page to include additional columns: parent_id, route, is_page, and tenant_id
base/src/main/java/com/tinyengine/it/common/enums/Enums.java Modified ERNIBOT_TURBO enum constant from "ERNIE-Bot-turbo" to "ERNIE-4.0-8K"
base/src/main/java/com/tinyengine/it/service/app/impl/AiChatServiceImpl.java Enhanced getAnswerFromAi method to handle truncated AI responses with a new isFinish flag and accumulative response handling

Sequence Diagram

sequenceDiagram
    participant Client
    participant AiChatService
    participant AiModel
    
    Client->>AiChatService: Request AI Answer
    AiChatService->>AiModel: Send Initial Query
    AiModel-->>AiChatService: Partial Response
    alt Response Incomplete
        loop Until Complete Response
            AiChatService->>AiModel: Request More Content
            AiModel-->>AiChatService: Additional Content
        end
    end
    AiChatService-->>Client: Complete AI Response
Loading

Poem

🐰 A Rabbit's Ode to Code Refinement 🌟

Indexes dance, models evolve with grace,
AI's whispers now find their rightful place.
Truncated thoughts, no longer cut and dry,
Completeness blooms where fragments used to lie.
Hop, hop, hooray for code that grows so bright! 🚀


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between cca5e8b and b70dd20.

📒 Files selected for processing (3)
  • app/src/main/resources/sql/mysql/create_all_tables_ddl_v1.mysql.sql (1 hunks)
  • base/src/main/java/com/tinyengine/it/common/enums/Enums.java (1 hunks)
  • base/src/main/java/com/tinyengine/it/service/app/impl/AiChatServiceImpl.java (3 hunks)

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

@lu-yg lu-yg merged commit 1773bba into opentiny:develop Jan 23, 2025
lu-yg pushed a commit to lu-yg/tiny-engine-backend-java that referenced this pull request Oct 23, 2025
* fix:fix AppV1ServiceImplTest and blockMapper

* fix:modify AI function
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.

2 participants