Develop AI apps with Python
This article contains an organized list of the best learning resources for Python developers who are getting started building AI apps. Resources include popular quickstart articles, reference samples, documentation, training courses, and so on.
Resources for Azure OpenAI Service
Azure OpenAI Service provides REST API access to OpenAI's powerful language models. These models can be easily adapted to your specific task including but not limited to content generation, summarization, image understanding, semantic search, and natural language to code translation. Users can access the service through REST APIs, the OpenAI SDK, or via the Azure AI Foundry portal.
[!INFO] While OpenAI and Azure OpenAI Service rely on a common Python client library, small code changes are needed when using Azure OpenAI endpoints.
SDKs and libraries
Link | Description |
---|---|
OpenAI SDK for Python | The GitHub source code version of the OpenAI Python library provides convenient access to the OpenAI API from applications written in the Python language. |
OpenAI Python Package | The PyPi version of the OpenAI Python library. |
Switch from OpenAI to Azure OpenAI | Guidance article on the small changes you need to make to your code in order to swap back and forth between OpenAI and the Azure OpenAI Service. |
Streaming Chat completions | A notebook containing example of getting chat completions to work using the Azure endpoints. This example focuses on chat completions but also touches on some other operations that are also available using the API. |
Embeddings | A notebook demonstrating operations how to use embeddings that can be done using the Azure endpoints. This example focuses on embeddings but also touches some other operations that are also available using the API. |
Deploy a model and generate text | An article with minimal, straightforward detailing steps to programmatically chat. |
OpenAI with Microsoft Entry ID Role based access control | A look at authentication using Microsoft Entra ID. |
OpenAI with Managed Identities | An article with more complex security scenarios requires Azure role-based access control (Azure RBAC). This document covers how to authenticate to your OpenAI resource using Microsoft Entra ID. |
More samples | A compilation of useful Azure OpenAI Service resources and code samples to help you get started and accelerate your technology adoption journey. |
Documentation
Link | Description |
---|---|
Azure OpenAI Service Documentation | The hub page for Azure OpenAI Service documentation. |
Quickstart: Get started generating text using Azure OpenAI Service | A very quick set of instructions to set up the services you need and code you must write to prompt a model using Python. |
Quickstart: Get started using GPT-35-Turbo and GPT-4 with Azure OpenAI Service | Similar to the previous quickstart, but provides an example of system, assistant and user roles to tailor the content when asked certain questions. |
Quickstart: Chat with Azure OpenAI models using your own data | Similar to the first quickstart, but this time you add your own data (like a PDF or other document). |
Quickstart: Get started using Azure OpenAI Assistants (Preview) | Similar to the first quickstart in this list, but this time you tell the model to use the built-in Python code interpreter to solve math problems step by step. This is a starting point to using your own AI assistants accessed through custom instructions. |
Quickstart: Use images in your AI chats | How to programmatically ask the model to describe the contents of an image. |
Quickstart: Generate images with Azure OpenAI Service | Programmatically generate images using Dall-E based on a prompt. |
Resources for other Azure AI services
In addition to Azure OpenAI Service, there are many other Azure AI services that help developers and organizations rapidly create intelligent, market-ready, and responsible applications with out-of-the-box and prebuilt customizable APIs and models. Example applications include natural language processing for conversations, search, monitoring, translation, speech, vision, and decision-making.
Samples
Link | Description |
---|---|
Integrate Speech into your apps with Speech SDK Samples | Samples for the Azure Cognitive Services Speech SDK. Links to samples for speech recognition, translation, speech synthesis, and more. |
Azure AI Document Intelligence SDK | Azure AI Document Intelligence (formerly Form Recognizer) is a cloud service that uses machine learning to analyze text and structured data from documents. The Document Intelligence software development kit (SDK) is a set of libraries and tools that enable you to easily integrate Document Intelligence models and capabilities into your applications. |
Extract structured data from forms, receipts, invoices, and cards using Form Recognizer in Python | Samples for the Azure.AI.FormRecognizer client library. |
Extract, classify, and understand text within documents using Text Analytics in Python | The client Library for Text Analytics. This is part of the Azure AI Language service, which provides Natural Language Processing (NLP) features for understanding and analyzing text. |
Document Translation in Python | A quickstart article that uses Document Translation to translate a source document into a target language while preserving structure and text formatting. |
Question Answering in Python | A quickstart article with steps to get an answer (and confidence score) from a body of text that you send along with your question. |
Conversational Language Understanding in Python | The client library for Conversational Language Understanding (CLU), a cloud-based conversational AI service, which can extract intents and entities in conversations and acts like an orchestrator to select the best candidate to analyze conversations to get best response from apps like Qna, Luis, and Conversation App. |
Analyze images | Sample code and setup documents for the Microsoft Azure AI Image Analysis SDK |
Azure AI Content Safety SDK for Python | Detects harmful user-generated and AI-generated content in applications and services. Content Safety includes text and image APIs that allow you to detect material that is harmful. |
Documentation
AI service | Description | API reference | Quickstart |
---|---|---|---|
Content Safety | An AI service that detects unwanted content. | Content Safety API reference | Quickstart |
Document Intelligence | Turn documents into intelligent data-driven solutions. | Document Intelligence API reference | Quickstart |
Language | Build apps with industry-leading natural language understanding capabilities. | Text Analytics API reference | Quickstart |
Search | Bring AI-powered cloud search to your applications. | Search API reference | Quickstart |
Speech | Speech to text, text to speech, translation, and speaker recognition. | Speech API reference | Quickstart |
Translator | Use AI-powered translation to translate more than 100 in-use, at-risk and endangered languages and dialects. | Translation API reference | Quickstart |
Vision | Analyze content in images and videos. | Image Analysis API reference | Quickstart |
Training
Link | Description |
---|---|
Generative AI for Beginners Workshop | Learn the fundamentals of building Generative AI apps with our 18-lesson comprehensive course by Microsoft Cloud Advocates. |
Get started with Azure AI Services | Azure AI Services is a collection of services that are building blocks of AI functionality you can integrate into your applications. In this learning path, you'll learn how to provision, secure, monitor, and deploy Azure AI Services resources and use them to build intelligent solutions. |
Microsoft Azure AI Fundamentals: Generative AI | Training path to help you understand how large language models form the foundation of generative AI: how Azure OpenAI Service provides access to the latest generative AI technology, how prompts and responses can be fine-tuned and how Microsoft's responsible AI principles drive ethical AI advancements. |
Develop Generative AI solutions with Azure OpenAI Service | Azure OpenAI Service provides access to OpenAI's powerful large language models such as ChatGPT, GPT, Codex, and Embeddings models. This learning path teaches developers how to generate code, images, and text using the Azure OpenAI SDK and other Azure services. |
Build AI apps with Azure Database for PostgreSQL | This learning path explores how the Azure AI and Azure Machine Learning Services integrations provided by the Azure AI extension for Azure Database for PostgreSQL - Flexible Server can enable you to build AI-powered apps. |
AI app templates
AI app templates provide you with well-maintained, easy to deploy reference implementations that provide a high-quality starting point for your AI apps.
There are two categories of AI app templates, building blocks and end-to-end solutions. Building blocks are smaller-scale samples that focus on specific scenarios and tasks. End-to-end solutions are comprehensive reference samples including documentation, source code, and deployment to allow you to take and extend for your own purposes.
To review a list of key templates available for each programming language, see AI app templates. To browse all available templates, see the AI app templates on the AI App Template gallery.