Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.25k stars 4.58k forks source link

[OpenAI] [Scenario] Add conveniences for function calling #42484

Open joseharriaga opened 6 months ago

joseharriaga commented 6 months ago

Add conveniences to facilitate function calling when using chat completions and assistants. For example, the official OpenAI JavaScript library offers a runTools({...}) convenience helper which automatically calls the JavaScript functions you provide and sends their results back to the /chat/completions endpoint, looping as long as the model requests tool calls (🔗 [[link]].(https://github.com/openai/openai-node?tab=readme-ov-file#automated-function-calls))

More info about function calling: Chat completions: 🔗 https://platform.openai.com/docs/guides/function-calling Assistants: 🔗 https://platform.openai.com/docs/assistants/tools/function-calling

joseharriaga commented 5 months ago

https://github.com/trrwilson/openai-in-typespec/pull/2/files#diff-413a0fb250fb1bcfe10b4f2a109515485e9bdd95e9d48796de23c2b977be6384R31