Function calling, thousands of functions - best practice #9947
-
Hi all, I'm just getting started with SK, and realize that what I'm about to ask is not strictly a SK "issue", but more of a general question about how to best implement function calling with LLMs if you have a large number of functions. The following article says that I should keep my function schema as small as possible: My company has a product for building business process automations. We support about 2000+ different automation tasks. I made a small prototype using SK and running Ollama locally with different models. I was able to successfully auto generate configurations for all the business process automations through function calling, where each automation consisted or multiple individual tasks. However, what I'm concerned about is whether this approach will work when I scale this up to 2000+ functions, and how expensive it becomes when I move it to the cloud (based on the article above). Note that there's no easy way to categorize my functions so that I can say that "in this context, only functions X,Y,Z will be applicable".
Any thoughts or advice from the community would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
My experience is quite limited, but if you can group the functions by business meaning, you can probably assign them to agents - also easier to teach those about functions usage. |
Beta Was this translation helpful? Give feedback.
-
@toresenneseth straight away I can say that presenting the model with 2K functions is problematic because the model will typically get confused and will produce poor responses. Below is some information which should help you:
I'd recommend joining our community office hours so you can discuss this with the entire team https://github.com/microsoft/semantic-kernel/blob/main/COMMUNITY.md |
Beta Was this translation helpful? Give feedback.
@toresenneseth straight away I can say that presenting the model with 2K functions is problematic because the model will typically get confused and will produce poor responses. Below is some information which should help you: