This workflow is designed for developers and data scientists who want to efficiently send multiple prompts to the Azure OpenAI Batch API and retrieve responses in a single batch process. It is particularly useful for applications that require processing large volumes of text data, such as chatbots, content generation, or data analysis.
Sending multiple prompts to the Azure OpenAI API can be time-consuming and inefficient if done sequentially. This workflow automates the process of batching requests, allowing users to submit multiple prompts at once and retrieve the results in a streamlined manner. This not only saves time but also optimizes resource usage.
This workflow:
The Azure OpenAI Batch API is designed to handle large-scale and high-volume processing tasks efficiently. Key features include:
az_openai_endpoint
in the "Setup defaults" node to your Azure OpenAI endpoint.api-version
in the "Set desired 'api-version'" node if necessary.[
{
"api-version": "2025-03-01-preview",
"requests": [
{
"custom_id": "first-prompt-in-my-batch",
"params": {
"messages": [
{
"content": "Hey ChatGPT, tell me a short fun fact about cats!",
"role": "user"
}
]
}
},
{
"custom_id": "second-prompt-in-my-batch",
"params": {
"messages": [
{
"content": "Hey ChatGPT, tell me a short fun fact about bees!",
"role": "user"
}
]
}
}
]
}
]
[
{
"custom_id": "first-prompt-in-my-batch",
"response": {
"body": {
"choices": [
{
"message": {
"content": "Did you know that cats can make over 100 different sounds?"
}
}
]
}
}
},
{
"custom_id": "second-prompt-in-my-batch",
"response": {
"body": {
"choices": [
{
"message": {
"content": "Bees communicate through a unique dance called the 'waggle dance'."
}
}
]
}
}
}
]
This template provides a comprehensive solution for efficiently processing multiple prompts using the Azure OpenAI Batch API, making it a valuable tool for developers and data scientists alike.