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

openai API 兼容问题及类型错误 #247

Open
lilonghe opened this issue Nov 26, 2024 · 4 comments · May be fixed by #252
Open

openai API 兼容问题及类型错误 #247

lilonghe opened this issue Nov 26, 2024 · 4 comments · May be fixed by #252
Assignees
Labels
bug Something isn't working

Comments

@lilonghe
Copy link

重现步骤

参照 https://x.ant.design/docs/react/model-use-qwen-cn 模型接入文档

类型错误

截屏2024-11-26 16 44 01 截屏2024-11-26 16 45 42

openai 兼容

直接调用上面示例文档中 agent.request 可以发出消息,但是得到的消息只能在 onUpdate 中拿到,无法配合 useXChat 使用
使用配合 useXChat 的 onRequest 时,发送的消息格式就有问题

截屏2024-11-26 16 48 23

当前行为

No response

预期行为

No response

上下文

No response

版本

1.0.0

您在哪些浏览器上遇到了这个问题?

Chrome

@lilonghe lilonghe added the bug Something isn't working label Nov 26, 2024
@YumoImer
Copy link
Collaborator

YumoImer commented Nov 26, 2024

感谢反馈,首先对于类型错误 useXAgent 支持传入范型参数,应该可以解决你的问题

import { useXAgent } from '@ant-design/x';

const [agent] = useXAgent<YourMessageType>(...);

后续 Action:我会将该文档更新相关示例代码

@YumoImer
Copy link
Collaborator

直接调用上面示例文档中 agent.request 可以发出消息,但是得到的消息只能在 onUpdate 中拿到

对于这个问题,我没有能够复现。

@YumoImer
Copy link
Collaborator

使用配合 useXChat 的 onRequest 时,发送的消息格式就有问题

这里确定是一个 bug,我将对其进行修复,感谢反馈

@lilonghe
Copy link
Author

直接调用上面示例文档中 agent.request 可以发出消息,但是得到的消息只能在 onUpdate 中拿到

对于这个问题,我没有能够复现。

不好意思,这里可能我说的不明确,重点其实是最后面的跟 useXChat 一起使用时,想着 agent 传给 useXChat 了,它调用也许也会更新 useXChat 的 message 数据

现在想来,这个应该是类似于一个独立的一次性请求函数,所以这条可以忽略

@YumoImer YumoImer linked a pull request Nov 27, 2024 that will close this issue
@YumoImer YumoImer self-assigned this Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants