-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Update function calling docs #673
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
||
functions = litellm.utils.function_to_dict(get_current_weather) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling function_to_dict
on get_current_weather
results in a NoneType exception; A docstring must be present.
if location == "Boston, MA": | ||
return "The weather is 12F" | ||
|
||
functions = [litellm.utils.function_to_dict(get_current_weather)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made functions to a list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Thanks for this awesome PR @kevinjyee ! |
Amazing PR - thank you for this @kevinjyee |
For non-openai models, our function calling can be improved, as we currently return the answer in open to suggestions for how we can return things in a more consistent format here: @kevinjyee |
Update Function Calling Examples
Description of Changes
Added a docstring to get_current_weather
litellm.utils.function_to_dict(get_current_weather)
on a function without a docstring will result in aNoneType
exception.Made
functions
an array before passing it as a paremter intocompletion
Updated API key to use Anthropic API Key for the
claude
examples