Skip to content

Conversation

@xiangshicheng
Copy link
Contributor

RoomConfig内增加翻译语言类型属性

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


xiangshicheng seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai
Copy link

coderabbitai bot commented Aug 23, 2025

Warning

Rate limit exceeded

@xiangshicheng has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 9 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 3f413dc and ebcb418.

📒 Files selected for processing (2)
  • api/src/main/java/com/coze/openapi/client/audio/rooms/model/RoomConfig.java (1 hunks)
  • api/src/main/java/com/coze/openapi/client/audio/rooms/model/TranslateConfig.java (1 hunks)

Walkthrough

Adds two fields to RoomConfig: room_mode (String, default "") and translate_config (static inner TranslateConfig) with from and to strings (default ""), plus public getters and setters; no other behavior changed.

Changes

Cohort / File(s) Summary of Changes
RoomConfig model updates
api/src/main/java/com/coze/openapi/client/audio/rooms/model/RoomConfig.java
Added fields private String room_mode = ""; and private TranslateConfig translate_config;. Added public getters/setters for both. Introduced public static class TranslateConfig with private String from = "" and private String to = "" (annotated with @JsonProperty) and Lombok-generated accessors. No other methods or existing behavior changed.

Sequence Diagram(s)

The changes are schema additions only and do not alter control flow; no sequence diagram is necessary.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I hopped through code with nimble paws,
I nested fields without a pause.
"from" and "to" now side by side,
room_mode set for a translation ride.
🥕🐇

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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

@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

🧹 Nitpick comments (1)
api/src/main/java/com/coze/openapi/client/audio/rooms/model/RoomConfig.java (1)

22-24: Use camelCase fields with explicit @JsonProperty and preserve Lombok builder defaults.

  • Field names with underscores are against Java conventions and produce odd builder/accessor names.
  • With Lombok, initializers are NOT applied when using the builder unless you mark them with @Builder.Default. Without it, room_mode will be null when built via RoomConfig.builder()...build() despite the = "" initializer.

Refactor fields to camelCase and keep JSON as snake_case via @JsonProperty. Preserve the default for builder use.

-  private String room_mode = "";
-
-  private TranslateConfig translate_config;
+  @JsonProperty("room_mode")
+  @lombok.Builder.Default
+  private String roomMode = "";
+
+  @JsonProperty("translate_config")
+  private TranslateConfig translateConfig;

Notes:

  • If room_mode has a constrained set of values, prefer an enum (e.g., RoomMode) and annotate with @JsonProperty or a custom serializer to enforce valid inputs.
  • If empty strings should be omitted on the wire, consider @JsonInclude(JsonInclude.Include.NON_EMPTY) at class level.

Action to verify: Calls to RoomConfig.of(codec) currently build via Lombok; confirm you expect roomMode to be "" (with the change above) rather than null.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 064d6bd and 4de009a.

📒 Files selected for processing (1)
  • api/src/main/java/com/coze/openapi/client/audio/rooms/model/RoomConfig.java (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: test (Java 17 on Windows)
  • GitHub Check: test (Java 8 on macOS)
  • GitHub Check: test (Java 17 on macOS)
  • GitHub Check: test (Java 11 on Windows)
🔇 Additional comments (1)
api/src/main/java/com/coze/openapi/client/audio/rooms/model/RoomConfig.java (1)

47-61: Drop manual accessors in favor of Lombok-generated methods

I ran a global search for the legacy snake_case getters/setters and found only their definitions in RoomConfig.java—no external call sites reference getRoom_mode(), setRoom_mode(), getTranslate_config(), or setTranslate_config(). Removing them won’t break existing code.

Next steps:

  • Rename the fields from room_moderoomMode and translate_configtranslateConfig.
  • Remove the manual getters/setters shown below.
  • Rely on Lombok’s @Data (or @Getter/@Setter) to generate getRoomMode(), setRoomMode(), getTranslateConfig(), and setTranslateConfig().
  • Verify your JSON serialization still produces room_mode/translate_config (e.g. via a class-level @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) or per-field @JsonProperty("room_mode")).
-  public String getRoom_mode() {
-    return room_mode;
-  }
-
-  public void setRoom_mode(String room_mode) {
-    this.room_mode = room_mode;
-  }
-
-  public TranslateConfig getTranslate_config() {
-    return translate_config;
-  }
-
-  public void setTranslate_config(TranslateConfig translate_config) {
-    this.translate_config = translate_config;
-  }

Copy link

@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: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4de009a and 92b5f69.

📒 Files selected for processing (1)
  • api/src/main/java/com/coze/openapi/client/audio/rooms/model/RoomConfig.java (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: CI
api/src/main/java/com/coze/openapi/client/audio/rooms/model/RoomConfig.java

[error] 23-33: Spotless formatting check failed. The file has formatting violations (TranslateConfig inner class annotations and field formatting). Run 'mvn spotless:apply' to fix.

🔇 Additional comments (1)
api/src/main/java/com/coze/openapi/client/audio/rooms/model/RoomConfig.java (1)

35-49: Remove manual getters/setters in RoomConfig.java

Lombok’s @Data on this class already generates proper camel-case accessors for roomMode and translateConfig. Since a project-wide search showed no references to the old snake_case methods (getRoom_mode, setRoom_mode, getTranslate_config, setTranslate_config) outside of their definitions in RoomConfig.java, you can safely delete those four methods. Lombok will supply the correct getRoomMode(), setRoomMode(...), getTranslateConfig(), and setTranslateConfig(...) at compile time.

Apply:

--- a/api/src/main/java/com/coze/openapi/client/audio/rooms/model/RoomConfig.java
+++ b/api/src/main/java/com/coze/openapi/client/audio/rooms/model/RoomConfig.java
@@ -35,15 +35,7 @@ public class RoomConfig {
-  public String getRoom_mode() {
-    return room_mode;
-  }
-
-  public void setRoom_mode(String room_mode) {
-    this.room_mode = room_mode;
-  }
-
-  public TranslateConfig getTranslate_config() {
-    return translate_config;
-  }
-
-  public void setTranslate_config(TranslateConfig translate_config) {
-    this.translate_config = translate_config;
-  }
+  // (removed) Lombok @Data now generates getters/setters for roomMode and translateConfig

@chyroc chyroc added the feature label Aug 23, 2025
@chyroc chyroc changed the title 同声传译在RoomConfig内增加翻译语言类型属性 feat: Support translate_config for audio.rooms.create Aug 23, 2025
@chyroc chyroc merged commit ffd3528 into coze-dev:main Aug 23, 2025
18 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants