Skip to content

fix: add binding for name in ChatCompletionRequestToolMessage#1407

Open
JDScript wants to merge 1 commit intoabetlen:mainfrom
JDScript:main
Open

fix: add binding for name in ChatCompletionRequestToolMessage#1407
JDScript wants to merge 1 commit intoabetlen:mainfrom
JDScript:main

Conversation

@JDScript
Copy link
Copy Markdown

Follow issue #1405

@abetlen
Copy link
Copy Markdown
Owner

abetlen commented Apr 30, 2024

@JDScript I'm not sure that's correct based on the OpenAI OpenAPI spec here

@JDScript
Copy link
Copy Markdown
Author

JDScript commented May 2, 2024

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.

@pseudorandomrants
Copy link
Copy Markdown

Any update on this? I am facing same issue while using functionary.

@allenporter
Copy link
Copy Markdown

allenporter commented Jul 15, 2024

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

@allenporter
Copy link
Copy Markdown

Also discussed here openai/openai-python#1078

I see, the tool role template is expecting a name in the chat template:

So a name needs to be populated from somewhere, or the tool role can't be used.

@allenporter
Copy link
Copy Markdown

Perhaps we have to get it by looking at the history of tool calls with the same tool id.

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

Successfully merging this pull request may close these issues.

4 participants