fix: add binding for name in ChatCompletionRequestToolMessage
Follow issue #1405
@JDScript I'm not sure that's correct based on the OpenAI OpenAPI spec here
Yeah, but I checked the document here, under Example invoking multiple function calls in one response. Examples given by OpenAI also adds the name parameter, which is the same as in the examples/notebooks/Functions.ipynb. Therefore, I used an optional binding.
Any update on this? I am facing same issue while using functionary.
This does not seem like the correct fix.
I see this message when specifying a message "role": "tool" and if its missing a name. so you can workaround with another role e.g. system if missing a name
Also discussed here https://github.com/openai/openai-python/issues/1078
I see, the tool role template is expecting a name in the chat template:
- https://huggingface.co/meetkai/functionary-7b-v2/blob/68795699d4632529a92530ab55bbe8efbd62707a/tokenizer_config.json#L67
- https://huggingface.co/meetkai/functionary-small-v2.5/blob/89e6716271825c203b7e9c7836d2d3b1ed191bea/tokenizer_config.json#L2053
So a name needs to be populated from somewhere, or the tool role can't be used.
Perhaps we have to get it by looking at the history of tool calls with the same tool id.