Skip to content

修改自定义模型stream字段类型非boolean类型时,访问异常。 #361

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

Closed
wants to merge 4 commits into from

Conversation

zhzhlit
Copy link

@zhzhlit zhzhlit commented Apr 2, 2025

No description provided.

张正亮 and others added 2 commits April 2, 2025 18:13
- Removed unnecessary stream priority check and added condition to handle boolean stream values in custom fields.
- Ensures that the stream parameter is only overridden if it is not already a boolean value in custom
put("stream", stream)
val streamInCustomFields = customFields.jsonObject.get("stream")
if (streamInCustomFields == null || streamInCustomFields.jsonPrimitive.booleanOrNull == true || streamInCustomFields.jsonPrimitive.booleanOrNull == false) {
// stream 参数优先级高于 customFields.stream
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// stream 参数优先级高于 customFields.stream

这个函数的设置是参数优先级高于 json 字段,现在这样改至少和之前的设计不一致了。建议找上游调用侧,哪里传了 stream = true 进来,又或者把优先级相关的注释改掉

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

由于最新的 UI 项中已没有了 SSE 的设置,建议把 stream 参数去掉,不允许强制设置 stream ,而全由 json 设置

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

把特殊逻辑去掉而非增加更多的特殊逻辑。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯 之前测试的就是直接去掉了。后来担心这段逻辑可能有特殊意义,所以就修改了下。
“建议把 stream 参数去掉,不允许强制设置 stream ,而全由 json 设置” 这个是合理,custom是什么就用什么。

张正亮 and others added 2 commits April 3, 2025 08:36
…Processor

- Removed the unnecessary stream priority check and added a condition to handle boolean stream values in custom fields.
- Ensures that the stream parameter is only overridden if it is not already a boolean value in custom fields, aligning with issue
@phodal phodal closed this in e912137 Apr 3, 2025
@phodal
Copy link
Member

phodal commented Apr 3, 2025

我改了,别瞎 merge ,导致合并不上

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.

3 participants