A chatbot must answer questions exclusively based on a company's internal, frequently updated knowledge base, not its general pre-trained knowledge.
→Implement the Retrieval-Augmented Generation (RAG) pattern. Use Azure AI Search to retrieve relevant documents and pass them as context to an Azure OpenAI model to generate a grounded answer.
Why: RAG grounds the model in specific, current data without expensive retraining, reducing hallucinations and ensuring factual accuracy from a trusted source.
A developer needs a GPT model to respond in a specific format (e.g., JSON).
→Use few-shot prompting. Provide 2-3 examples of the desired input-output format directly in the prompt before the actual request.
Why: Few-shot prompting guides the model's behavior and output structure through in-context examples, which is faster and cheaper than fine-tuning.
Improve a model's accuracy on a multi-step reasoning problem (e.g., a math word problem).
→Use Chain-of-Thought (CoT) prompting by adding a phrase like "Think step by step" to the prompt.
Why: CoT encourages the model to break down the problem and show its reasoning, which significantly improves performance on complex logical tasks.
Control the creativity versus predictability of a generative model's text output.
→Adjust the `temperature` parameter. A low value (~0.1) makes output more deterministic and focused. A high value (~0.9) makes it more creative and random.
Why: Temperature directly controls the randomness of token selection, allowing you to tune the output style for the specific use case (e.g., factual summary vs. creative writing).
An enterprise needs to use OpenAI's GPT-4 and DALL-E models within their secure Azure environment, with private networking and integrated identity management.
→Use the Azure OpenAI Service. It provides OpenAI models with Azure's enterprise-grade security, compliance, regional availability, and content filtering.
Why: Azure OpenAI provides a secure, enterprise-ready wrapper around OpenAI models, integrating them into the Azure ecosystem.
Reference↗
Build a search system that finds documents based on semantic meaning, not just keyword matches (e.g., "car maintenance" finds "vehicle service intervals").
→Use an Azure OpenAI embeddings model (e.g., `text-embedding-ada-002`) to convert documents and queries into numerical vectors. Use a vector database (like Azure AI Search) to find the closest vectors by cosine similarity.
Why: Embeddings capture the semantic meaning of text, enabling searches based on conceptual similarity rather than lexical overlap.
An application using Azure OpenAI must automatically prevent the generation of content related to violence, hate speech, sexual content, or self-harm.
→Rely on the built-in content filtering, powered by Azure AI Content Safety. Configure the severity levels (low, medium, high) for each harm category.
Why: Azure OpenAI includes a mandatory, multi-layered safety system that filters both prompts and completions to align with responsible AI principles.
A marketing team needs to generate custom product images for advertising campaigns from text descriptions.
→Use the DALL-E model available through Azure OpenAI Service. Craft a detailed prompt describing the desired image.
Why: DALL-E is a text-to-image generation model, specifically designed for creating novel images from natural language prompts.
A generative AI assistant needs to access real-time data (e.g., current stock prices) or execute actions (e.g., book a meeting) by calling external APIs.
→Use the function calling capability of Azure OpenAI models. Define available functions in the API request; the model will generate a structured JSON object specifying which function to call with which arguments.
Why: Function calling allows LLMs to interact with external tools and APIs, overcoming the limitation of their static training data and enabling them to take action.
A team needs to build, evaluate, and deploy a complex generative AI application by orchestrating LLM calls, Python scripts, and prompt templates in a visual workflow.
→Use Azure AI Foundry (formerly AI Studio) and its Prompt flow feature. Build the application as a visual graph of connected tools.
Why: Prompt flow is the orchestration tool for building and testing complex LLM-based applications, chaining together multiple components into a reproducible workflow.
An IT team needs to build a custom copilot for internal use that can answer employee questions and integrate with enterprise systems (e.g., ServiceNow, SAP) using a low-code platform.
→Use Microsoft Copilot Studio. It provides a low-code graphical interface for building custom copilots with pre-built connectors and generative AI capabilities.
Why: Copilot Studio abstracts the complexity of building enterprise-grade AI assistants, enabling rapid development without extensive coding.