feat: Support parameters for CreateChat#98
Conversation
Mibloom
commented
May 19, 2025
- 在 CreateChatReq 类中添加了 parameters 属性,用于自定义参数
- 使用 Map<String, Object> 类型以支持多种类型的自定义参数
- 通过 JSON 注解@JsonProperty("parameters")进行序列化和反序列化
- 在 CreateChatReq 类中添加了 parameters 属性,用于自定义参数 - 使用 Map<String, Object> 类型以支持多种类型的自定义参数 - 通过 JSON 注解@JsonProperty("parameters")进行序列化和反序列化
WalkthroughA new field called Changes
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)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
✨ 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: 0
🔭 Outside diff range comments (1)
api/src/main/java/com/coze/openapi/client/chat/CreateChatReq.java (1)
89-91: 💡 Verification agent🧩 Analysis chain
Consider updating clearBeforeReq() method
The
clearBeforeReq()method currently only clears theconversationIDfield. Consider whether the newparametersfield should also be cleared before requests. If parameters are conversation-specific, they should be cleared along with the conversation ID.
🏁 Script executed:
#!/bin/bash # Look for usage patterns of the clearBeforeReq method to understand if parameters should be cleared echo "Searching for clearBeforeReq method calls in the codebase:" rg -A 2 -B 2 "clearBeforeReq" --type javaLength of output: 3999
Update
clearBeforeReq()to also reset the newparametersfieldIn
api/src/main/java/com/coze/openapi/client/chat/CreateChatReq.java, theclearBeforeReq()method currently only clearsconversationID. For consistency (as seen inSubmitToolOutputsReq.clearBeforeReq()) and to avoid carrying over conversation-specific data, you should also null out theparametersfield:public void clearBeforeReq() { this.conversationID = null; this.parameters = null; }– File:
api/src/main/java/com/coze/openapi/client/chat/CreateChatReq.java
– Method:clearBeforeReq()
🧹 Nitpick comments (1)
api/src/main/java/com/coze/openapi/client/chat/CreateChatReq.java (1)
74-76: Consider enhancing the documentation commentThe current comment "The customized parameters" is minimal. Consider providing more details about:
- What kinds of parameters can be stored here
- Example use cases
- Any constraints or expected formats
/* - * The customized parameters + * Customized parameters that can hold various types of values. + * This field allows passing additional configuration options as key-value pairs + * where values can be of any object type, not limited to strings. * */
📜 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)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: test (Java 17 on Windows)
- GitHub Check: test (Java 11 on Windows)
🔇 Additional comments (1)
api/src/main/java/com/coze/openapi/client/chat/CreateChatReq.java (1)
74-78: The new parameters field is well-implemented!The addition of a
Map<String, Object>type allows for flexible customized parameters with different value types, which is more versatile than theMap<String, String>used for other similar fields in this class. The implementation follows the established patterns in the class with proper JSON annotation.
api/src/main/java/com/coze/openapi/client/chat/CreateChatReq.java
Outdated
Show resolved
Hide resolved
|
这个参数多久能发布新版本啊。急用 |
|
可以提交一个修改版本的 pr,合并后发版 |
|
原来parameters 属性是个新增字段 !!! |