-
-
Notifications
You must be signed in to change notification settings - Fork 13
BatchRunners
Rasmus Wulff Jensen edited this page May 20, 2026
·
1 revision
Batch runners provide helpers for OpenAI and Azure OpenAI batch jobs.
Note
Batch runner APIs are marked experimental with AFT999.
- OpenAI:
dotnet add package AgentFrameworkToolkit.OpenAI - Azure OpenAI:
dotnet add package AgentFrameworkToolkit.AzureOpenAI
OpenAIBatchRunner batchRunner = new("<apiKey>");
ChatBatchRun run = await batchRunner.RunChatBatchAsync(
new ChatBatchOptions
{
Model = "gpt-5-mini"
},
[
ChatBatchRequest.Create("Summarize this text.")
]);OpenAI batch runners support:
- Chat batches with
RunChatBatchAsync - Structured-output chat batches with
RunChatBatchAsync<T> - Existing chat batch lookup with
GetChatBatchAsync - Existing structured chat batch lookup with
GetChatBatchAsync<T> - Embedding batches with
RunEmbeddingBatchAsync - Existing embedding batch lookup with
GetEmbeddingBatchAsync
AzureOpenAIBatchRunner batchRunner = new("<endpoint>", "<apiKey>");
ChatBatchRun run = await batchRunner.RunChatBatchAsync(
new ChatBatchOptions
{
Model = "<deployment-name>"
},
[
ChatBatchRequest.Create("Summarize this text.")
]);Azure OpenAI batch runners support:
- Chat batches with
RunChatBatchAsync - Structured-output chat batches with
RunChatBatchAsync<T> - Existing chat batch lookup with
GetChatBatchAsync - Existing structured chat batch lookup with
GetChatBatchAsync<T>
AzureOpenAIBatchRunner withApiKey = new("<endpoint>", "<apiKey>");
AzureOpenAIBatchRunner withRbac = new("<endpoint>", new AzureCliCredential());
OpenAIBatchRunner withConnection = new(new OpenAIConnection { ApiKey = "<apiKey>" });- In Azure OpenAI,
Modelis your deployment name. - Batch runners reuse the same connection objects as the corresponding provider factories.