Running the function-calling python example verbatim gives an unexpected result, I found a fix just adding ** - I think this is what was intended by the author.
The example here gives a get_horoscope function, and the prompt instructions are to “Respond only with a horoscope generated by a tool.” with the example user prompt saying “I’m an Aquarius” so the expected result is to be printed is just the output of get_horoscope with “Aquarius” being passed in as the sign, but the example accidentally passes a dictionary with the arguments by name to the function, and that whole dictionary ends up being the “sign”, output is:
{‘sign’: ‘Aquarius’}: Next Tuesday you will befriend a baby otter.
Fix is to call get_horoscope(**json.loads(item.arguments)) instead! Fix is only on line 47 but you should check the javascript for the same issue:
`horoscope = get_horoscope(**json.loads(item.arguments))`
