Thank you for taking time to contribute this pull request! You might have already read the [contributor guide][1], but as a reminder, please make sure to:
- Sign the contributor license agreement
- Rebase your changes on the latest
main
branch and squash your commits - Add/Update unit tests as needed
- Run a build and make sure all tests pass prior to submission
Currently the Xinghuo LLM model doesn't determine whether it's end or not by the finish_reason
in the metadata but by the presence or absence of usage
field.
- streaming
{"code":0,"message":"Success","sid":"cha000bc93f@dx1932638ff83b8f2532","id":"cha000bc93f@dx1932638ff83b8f2532","created":1731513092,"choices":[{"delta":{"role":"assistant","content":"","tool_calls":{"type":"function","function":{"arguments":"{\"format\":\"celsius\",\"location\":\"河北省承德市双桥区\"}","name":"get_current_weather"}}},"index":0}],"usage":{"prompt_tokens":2,"completion_tokens":0,"total_tokens":2}}
- non-streaming
{"code":0,"message":"Success","sid":"cha000bc793@dx19326377f0cb8f2532","choices":[{"message":{"role":"assistant","content":"","tool_calls":{"type":"function","function":{"arguments":"{\"format\":\"celsius\",\"location\":\"河北省承德市双桥区\"}","name":"get_current_weather"}}},"index":0}],"usage":{"prompt_tokens":2,"completion_tokens":0,"total_tokens":2}}
Comment From: liugddx
I've tested it and it works for me.