Azure-Samples / openai

The repository for all Azure OpenAI Samples complementing the OpenAI cookbook.
https://aka.ms/azure-openai
MIT License
1.05k stars 355 forks source link

Chaining function calls #43

Open stephaneey opened 11 months ago

stephaneey commented 11 months ago

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ x] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Hello, for the time being, it seems that the model can determine which function to call but it seems to be limited to only one function, unless I missed something. In the scenario where I split the calculator into four distinct functions (add, divide, substract, multiply) and I would input the following query:

Calculate the total of 10/2 multiplied by 3

The model will determine that divide must be called, but it will not understand that multiply must also be called. Is it something that will be available?

Expected/desired behavior

{ "role": "assistant", "function_calls":[ { "name": "divide", "arguments": "{\n\"num1\": 10,\n\"num2\": 2\n}" }, { "name": "multiply", "arguments": "{\n\"num1\": 5,\n\"num2\": 3\n}" } ] }


Thanks! We'll be in touch soon.