Skip to content
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

[AI] custom chatOptions not working #3730

Open
zddgg opened this issue May 13, 2024 · 5 comments
Open

[AI] custom chatOptions not working #3730

zddgg opened this issue May 13, 2024 · 5 comments

Comments

@zddgg
Copy link

zddgg commented May 13, 2024

Which Component

AI

Describe what problem you have encountered

When I use the streaming interface of TongYiChatClient, the data returned each time is not incremental because the default value of ChatOptions.incrementalOutput is false.
I passed in a custom ChatOption through the Prompt constructor, but it did not take effect. I found that when ChatOptions are merged, the priority of the default configuration is higher than that of the custom configuration. Is there a problem with the method I am using?

我在使用 TongYiChatClient 的流式接口时每次返回的数据并不是增量,因为 ChatOptions.incrementalOutput 默认值时false。
我通过 Prompt 构造器传入了自定义的 ChatOption 没有生效,发现在 ChatOptions 合并时默认配置的优先级高于自定义配置,是我使用的方法有问题吗?

Snipaste_2024-05-13_13-06-58

Snipaste_2024-05-13_13-09-51

Describe what information you have read

not found

@yuluo-yx
Copy link
Collaborator

yuluo-yx commented May 13, 2024

看看 spring-cloud-ai-example, 配置优先级问题可以参考下测试类

https://help.aliyun.com/zh/dashscope/developer-reference/api-details

true -> 开启增量输出模式,后面输出不会包含已经输出的内容
false -> 会包含已输出的内容

image
image

@yuluo-yx
Copy link
Collaborator

yuluo-yx commented May 13, 2024

/area ai
/kind question

@18200533099
Copy link

@yuluo-yx
8640ac7ace83600d579d70ea7aa919b
作者大大麻烦看下这个方法好像会因为ConversationParam类中incrementalOutput默认设置为false的情况导致incrementalOutput参数设置不生效

@yuluo-yx
Copy link
Collaborator

@yuluo-yx 8640ac7ace83600d579d70ea7aa919b 作者大大麻烦看下这个方法好像会因为ConversationParam类中incrementalOutput默认设置为false的情况导致incrementalOutput参数设置不生效

简单给个 demo 我看看?

@yuluo-yx
Copy link
Collaborator

奇怪,为什么我写 example 是好的没,确实是增量输出的,我用stirngbuilder拼接的,你参考下看看 ?@18200533099

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants