-
Notifications
You must be signed in to change notification settings - Fork 253
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
Better ChatCompletionFunctionCall interface #118
Conversation
Actually previous
OR
But yes No worries about breaking changes, because next release v0.15.0 will have other breaking change (already in I'll merge this PR once spec sync is addressed too for v0.15.0. |
Hello @m1guelpf , I took liberty to make some changes and kept your idea intact. Essentially use serde instead custom serialization implementation. Thank you for your patience on this PR! |
According to OpenAI's docs, the
function_call
parameter can only be eithernone
,auto
, or{ "name": function_name }
.The current interface in this library feels counter-intuitive, and I've often tried to call a custom function using
ChatCompletionFunctionCall::String(function_name)
instead ofChatCompletionFunctionCall::Object(json!({ "name": custom_function }))
.This change proposes a more intuitive interface for this (as a breaking change unfortunately).