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

streaming方式获取function call的argument #27

Closed
I-am-DJ opened this issue May 23, 2024 · 10 comments
Closed

streaming方式获取function call的argument #27

I-am-DJ opened this issue May 23, 2024 · 10 comments
Labels
enhancement New feature or request

Comments

@I-am-DJ
Copy link

I-am-DJ commented May 23, 2024

执行测试用例时,对应messageChunk获取的arguments类型还是objectNode,导致解析为空
image
我需要在初始化时做什么操作吗,设定不同的序列化方式?

@Lambdua
Copy link
Owner

Lambdua commented May 23, 2024

你的例子我使用openai api 跑没有问题,你是用的第三方模型么

@I-am-DJ
Copy link
Author

I-am-DJ commented May 23, 2024

你的例子我使用openai api 跑没有问题,你是用的第三方模型么

我用的Qwen的模型

@Lambdua
Copy link
Owner

Lambdua commented May 23, 2024

如果方便,你可以给我一个测试临时用的key 和对应的代码么. 发到我邮箱 [email protected]

@I-am-DJ
Copy link
Author

I-am-DJ commented May 23, 2024

如果方便,你可以给我一个测试临时用的key 和对应的代码么. 发到我邮箱 [email protected]

在公司的机器上搭建的,不太可行,可能是proxy层转发时候的问题,我排查下

@Lambdua
Copy link
Owner

Lambdua commented May 23, 2024

国内三方代理proxy会有和官方接口不一致的行为. 如 one-api ,我遇到过行为不一致的情况.

我这边给你这种做个兼容处理,你稍后拉取代码本地编译测试下

@Lambdua
Copy link
Owner

Lambdua commented May 23, 2024

@I-am-DJ 提交了,如果没问题,希望可以给一个star ,thanks.

@I-am-DJ
Copy link
Author

I-am-DJ commented May 23, 2024

看了你改的代码感觉并没有解决我这个问题,
messageChunk.getFunctionCall().getArguments();
我debug得到这行代码的类型是ObjectNode,他的asText()结果是空字符串

@I-am-DJ
Copy link
Author

I-am-DJ commented May 23, 2024

但是实际上他是有值的

看了你改的代码感觉并没有解决我这个问题, messageChunk.getFunctionCall().getArguments(); 我debug得到这行代码的类型是ObjectNode,他的asText()结果是空字符串

@Lambdua
Copy link
Owner

Lambdua commented May 23, 2024

objectNode的情况是已经序列化完毕了. 这个是后续的argument我看你的debug是空.

@Lambdua
Copy link
Owner

Lambdua commented May 23, 2024

你可以提交一个mq

@Lambdua Lambdua added enhancement New feature or request and removed bug Something isn't working labels May 24, 2024
@Lambdua Lambdua closed this as not planned Won't fix, can't repro, duplicate, stale May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants