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 tool_calls index 为 null #254

Open
Kugaaa opened this issue Jun 19, 2024 · 6 comments
Open

streaming 下 function call tool_calls index 为 null #254

Kugaaa opened this issue Jun 19, 2024 · 6 comments

Comments

@Kugaaa
Copy link

Kugaaa commented Jun 19, 2024

Describe the bug 描述bug
streaming 下 function call tool_calls index 为 null

To Reproduce 复现方法

  1. stream 使用 function call

Screenshots 截图
返回结构

{
    "id": "chatcmpl-9bs8FJY0e9Jfp8gRPNQqHps9AG8Dn",
    "object": "chat.completion.chunk",
    "created": 1718813247,
    "model": "gpt-3.5-turbo-0613",
    "choices": [
        {
            "index": 0,
            "delta": {
                "role": "assistant",
                "tool_calls": [
                    {
                        // no index
                        "id": "call_UnVtKL0WOa8iFRgWgrvdf4JY",
                        "type": "function",
                        "function": {
                            "name": "squareRoot",
                            "arguments": ""
                        }
                    }
                ]
            },
            "logprobs": null,
            "finish_reason": null
        }
    ],
    "system_fingerprint": null
}

Tools or Programming Language 使用的工具或编程语言
Java 17

@chatanywhere
Copy link
Owner

image

以上官方文档截图中,tool_calls对象下并没有index字段

猜测您需要的index字段应该在choices字段下,如下图

image

@Kugaaa
Copy link
Author

Kugaaa commented Jun 19, 2024

好的,我再看一下
方便把文档链接发我吗,感谢

@chatanywhere
Copy link
Owner

@Kugaaa
Copy link
Author

Kugaaa commented Jun 20, 2024

@Kugaaa
Copy link
Author

Kugaaa commented Jun 24, 2024

麻烦提高下优先级

@chatanywhere
Copy link
Owner

抱歉上周比较忙没有时间维护

排查发现确实缺失了Stream下的index参数,我们将在6月26日8:00前通过热补丁修复该问题

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

No branches or pull requests

2 participants