feat(api-client): 添加 CreateChatReq 类的自定义参数属性#97
Conversation
Mibloom
commented
May 19, 2025
- 在 CreateChatReq 类中添加了 parameters 属性,用于自定义参数
- 使用 Map<String, Object> 类型以支持多种类型的自定义参数
- 通过 JSON 注解@JsonProperty("parameters")进行序列化和反序列化
|
Caution Review failedThe pull request is closed. WalkthroughA new field named Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant CreateChatReq
participant API
Client->>CreateChatReq: Instantiate with parameters map
CreateChatReq->>API: Send request with parameters as JSON
API-->>CreateChatReq: Process response
CreateChatReq-->>Client: Return API response
Poem
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure 📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
api/src/main/java/com/coze/openapi/client/chat/CreateChatReq.java (1)
74-79: Field implementation looks good but consider clarifying documentationThe implementation of the new
parametersfield is appropriate for allowing custom parameters with flexible value types. However, the current documentation is quite brief.Consider enhancing the documentation to:
- Clarify the purpose of this field
- Explain how it differs from the existing
customVariablesfield (which only accepts String values)- Provide an example usage scenario
/* - * The customized parameters + * Holds customized parameters as key-value pairs where values can be of any type. + * Unlike 'customVariables' which only accepts String values, this field supports arbitrary objects. + * Example usage: parameters.put("temperature", 0.7); parameters.put("options", someComplexObject); * */ @JsonProperty("parameters") private Map<String, Object> parameters;
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
api/src/main/java/com/coze/openapi/client/chat/CreateChatReq.java(1 hunks)
🧰 Additional context used
🪛 GitHub Actions: CI
api/src/main/java/com/coze/openapi/client/chat/CreateChatReq.java
[error] 77-83: Spotless formatting check failed. The file has format violations. Run 'mvn spotless:apply' to fix these violations.
| @JsonProperty("parameters") | ||
| private Map<String, Object> parameters; | ||
|
|
||
|
|
There was a problem hiding this comment.
Remove extra blank line
There's an extra blank line here that's likely causing the Spotless formatting check to fail. The CI pipeline has reported a formatting issue in this file.
@JsonProperty("parameters")
private Map<String, Object> parameters;
-
Please run mvn spotless:apply as mentioned in the pipeline failure to automatically fix this and any other formatting issues.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| @JsonProperty("parameters") | |
| private Map<String, Object> parameters; |
🤖 Prompt for AI Agents
In api/src/main/java/com/coze/openapi/client/chat/CreateChatReq.java at line 80,
there is an extra blank line causing the Spotless formatting check to fail.
Remove this extra blank line and then run the command `mvn spotless:apply` to
automatically fix this and any other formatting issues in the file.
- 在 CreateChatReq 类中添加了 parameters 属性,用于自定义参数 - 使用 Map<String, Object> 类型以支持多种类型的自定义参数 - 通过 JSON 注解@JsonProperty("parameters")进行序列化和反序列化