Tutorials AI & LLM Engineering for .NET Architects

Function Calling: Letting the LLM use your SQL and API tools

On this page

Mastering Function Calling

Function calling is the bridge between the Imagination of the LLM and the Reality of your computer. It allows the AI to execute real C# code and interact with the real world.

1. Semantic Description as API

In function calling, the 'API' is the description you write for your methods. If you describe a function as "Cancels a subscription based on user ID," the LLM will provide the `userId` and call that function whenever a user says "I want to quit."

2. Parallel Function Calling

Modern models can call multiple functions at once. If a user asks "What's the weather in London and Paris?", the AI will return TWO function calls in a single response, allowing your C# app to fetch both results in parallel for maximum speed.

3. Security: The Sandbox Requirement

Never let an LLM write and execute raw SQL. Instead, give it a function like `SearchCustomers(string name)`. The C# code inside that function should use parameterized queries and strict RBAC to ensure the AI cannot perform a 'Prompt Injection' on your database.

4. Interview Mastery

Q: "What is 'Few-shot Function Calling'?"

Architect Answer: "Sometimes the AI gets the parameters wrong. Few-shot function calling is when you provide examples of *previous* correctly formatted function calls in the prompt history. This 'Trains' the model on how to correctly map complex user requests to your specific C# method signatures, reducing errors by 70%."

Questions on this lesson 0

Sign in to ask a question or upvote helpful answers.

No questions yet — be the first to ask!

AI & LLM Engineering for .NET Architects
Course syllabus
1. AI Foundations & Prompt Engineering
2. Semantic Kernel & Integration
3. Vector Databases & RAG
4. Advanced RAG Techniques
5. AI Safety & Guardrails
6. Small Language Models (SLMs) & Local AI
7. Multimodal & Agentic AI
8. FAANG AI Engineer Interview
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details