svpino / openai-function-calling

An example of using Function Calling with OpenAI's API
55 stars 4 forks source link

Looks like the result is incorrect. The answer should be 25 in hexadecimal! The second function has a bug. #2

Open jiaboli007 opened 1 year ago

jiaboli007 commented 1 year ago

In the second function for adding a decimal number to a hexadecimal number, the first argument is already a decimal number, but your code treat it as a hexadecimal.

Ideally, one should create a more convincing example that function-calling can solve a problem that can not be solved well by a simple prompt. Actually, I tried your initial question with both ChatGPT-3.5 and GPT-4, both give the correct answer. Find a more challenge case but still simple enough that people can easily understand and see the advantage of using function call.

I like this general philosophy of AI development: if anything can be partially solved by deterministic methods (functions that can solve sub-tasks in a programatic/deterministic way) we should do that first, and the remaining, we user LLM. Both LangChain and OpenAI's function-calling are share the same spirit. However, we should go further/deeper in this direction.

Thanks for you sharing on Github!

jiaboli007 commented 1 year ago
image
jiaboli007 commented 1 year ago
image