Deepfake technology added complexity to the rapid production and distribution of digital content. AI-generated deepfakes, which can mimic real people, pose serious ethical and legal issues, especially concerning copyright and intellectual property.
Blog
-
Using AI responsibly: Best practices
As AI becomes more integrated into our lives, it’s important to understand how to use it ethically and effectively.
Responsible collaboration with AI is essential. Here are some key best practices:
Understand AI: It’s important to grasp the basics of AI and its broad capabilities. This knowledge is the foundation for using AI effectively.
Stay informed: Keep up with the latest advancements and ethical discussions in AI. This will help you leverage AI responsibly.
Recognize AI’s blind spots: AI can reflect societal biases present in the data it learns from. Actively seek unbiased information and understand how AI uses data to navigate these blind spots.
Prioritize safety and privacy: Your data is precious. Choose AI services that value user privacy and prioritize security and transparency.
Cross-verify AI-generated content: Don’t accept AI-generated content at face value. Always cross-verify information from various sources and engage your critical thinking skills.
Evaluate and refine content: Use critical thinking to evaluate and refine AI-generated content by verifying facts and sources, understanding the content’s goals and target audience while considering a range of viewpoints.
Ensure clear policies: Make sure the AI tool or service you’re using has clear policies and guidelines for secure usage.
Promote AI for good: AI should be a tool for good, aiding in areas like healthcare, education, and environmental conservation.
Join the conversation: Start discussions in your community and workplace about responsible AI use. Encourage people to think about how AI will be utilized and take steps to prevent misuse.
These methods will enable you to use AI responsibly and contribute positively to society.
-
Implement RAG in a prompt flow
After uploading data to Azure AI Foundry and creating an index on your data using the integration with Azure AI Search, you can implement the RAG pattern with Prompt Flow to build a generative AI application.
Prompt Flow is a development framework for defining flows that orchestrate interactions with an LLM.
A flow begins with one or more inputs, usually a question or prompt entered by a user, and in the case of iterative conversations the chat history to this point.
The flow is then defined as a series of connected tools, each of which performs a specific operation on the inputs and other environmental variables. There are multiple types of tool that you can include in a prompt flow to perform tasks such as:
- Running custom Python code
- Looking up data values in an index
- Creating prompt variants – enabling you to define multiple versions of a prompt for a large language model (LLM), varying system messages or prompt wording, and compare and evaluate the results from each variant.
- Submitting a prompt to an LLM to generate results.
Finally, the flow has one or more outputs, typically to return the generated results from an LLM.
-
Create a RAG-based client application
When you’ve created an Azure AI Search index for your contextual data, you can use it with an OpenAI model. To ground prompts with data from your index, the Azure OpenAI SDK supports extending the request with connection details for the index.
In this example, the search against the index is keyword-based – in other words, the query consists of the text in the user prompt, which is matched to text in the indexed documents. When using an index that supports it, an alternative approach is to use a vector-based query in which the index and the query use numeric vectors to represent text tokens. Searching with vectors enables matching based on semantic similarity as well as literal text matches.
To use a vector-based query, you can modify the specification of the Azure AI Search data source details to include an embedding model; which is then used to vectorize the query text.
-
Make your data searchable
When you want to create an agent that uses your own data to generate accurate answers, you need to be able to search your data efficiently. When you build an agent with the Azure AI Foundry, you can use the integration with Azure AI Search to retrieve the relevant context in your chat flow.
Azure AI Search is a retriever that you can include when building a language model application with prompt flow. Azure AI Search allows you to bring your own data, index your data, and query the index to retrieve any information you need.
Using a vector index
While a text-based index will improve search efficiency, you can usually achieve a better data retrieval solution by using a vector-based index that contains embeddings that represent the text tokens in your data source.
An embedding is a special format of data representation that a search engine can use to easily find the relevant information. More specifically, an embedding is a vector of floating-point numbers.
For example, imagine you have two documents with the following contents:
- “The children played joyfully in the park.”
- “Kids happily ran around the playground.”
These two documents contain texts that are semantically related, even though different words are used. By creating vector embeddings for the text in the documents, the relation between the words in the text can be mathematically calculated.
-
Understand how to ground your language model
Language models excel in generating engaging text, and are ideal as the base for agents. Agents provide users with an intuitive chat-based application to receive assistance in their work. When designing an agent for a specific use case, you want to ensure your language model is grounded and uses factual information that is relevant to what the user needs.
Though language models are trained on a vast amount of data, they may not have access to the knowledge you want to make available to your users. To ensure that an agent is grounded on specific data to provide accurate and domain-specific responses, you can use Retrieval Augmented Generation (RAG).
-
Set up, configure, and troubleshoot GitHub Copilot
This unit explains how to sign up for GitHub Copilot, how to configure GitHub Copilot by using VS Code, and how to troubleshoot GitHub Copilot by using VS Code.
Sign up for GitHub Copilot
Before you can start using GitHub Copilot, you need to set up a free trial or subscription for your account.
To get started, select your GitHub profile photo, and then select Settings. Copilot is on the left menu under Code, planning, and automation.
After you sign up, you need to install an extension for your preferred environment. GitHub Copilot supports GitHub.com (which doesn’t need an extension), VS Code, Visual Studio, JetBrains IDEs, and Neovim as an unobtrusive extension.
For this module, you’ll just review extensions and configurations for VS Code. The exercise that you’ll complete in the next unit uses VS Code.
If you’re using a different environment, you can find specific links to set up other environments in the “References” section at the end of this module.
-
Interact with Copilot
This unit explores ways that you can maximize your interaction with GitHub Copilot in your development environment. By understanding the service’s features and capabilities, you learn how to use it effectively.
The following sections describe the various ways to trigger and use GitHub Copilot, along with examples and shortcuts to help you get the most out of it.
Inline suggestions
Inline suggestions are the most immediate form of assistance in Copilot. As you type, Copilot analyzes your code and context to offer real-time code completions. This feature predicts what you might want to write next and displays suggestions in a subtle, unobtrusive way.
The suggestions that Copilot offers appear as grayed-out text ahead of your cursor.
- To accept a suggestion, select the
Tabkey or the>(right arrow) key. - To reject a suggestion, keep typing or select the
Esckey.
Inline suggestions are especially useful when you’re working on repetitive tasks or you need quick boilerplate code.
- To accept a suggestion, select the
-
GitHub Copilot, your AI pair programmer
It’s no secret that AI is disrupting the technology industry. AI is shaping how development teams work and build software. These advancements in AI can enhance the productivity of developers around the world.
The addition of AI features to the developer tools that you use and love helps you collaborate, develop, test, and ship your products faster and more efficiently than ever before. GitHub Copilot is a service that provides you with an AI pair programmer that works with all of the popular programming languages.
In recent research, GitHub and Microsoft found that developers experience a significant productivity boost when they use GitHub Copilot to work on real-world projects and tasks. In fact, in the three years since its launch, developers have experienced the following benefits while using GitHub Copilot:
- 46% of new code now written by AI
- 55% faster overall developer productivity
- 74% of developers feeling more focused on satisfying work
Microsoft developed GitHub Copilot in collaboration with OpenAI. GitHub Copilot is powered by the OpenAI Codex system. OpenAI Codex has broad knowledge of how people use code and is more capable than GPT-3 in code generation. OpenAI Codex is more capable, in part, because it was trained on a dataset that included a larger concentration of public source code.
GitHub Copilot is available as an extension for VS Code, Visual Studio, Vim/Neovim, and the JetBrains suite of IDEs.
-
Create a chat client
A common scenario in an AI application is to connect to a generative AI model and use prompts to engage in a chat-based dialog with it.
While you can use the Azure OpenAI SDK, to connect “directly” to a model using key-based or Microsoft Entra ID authentication; when your model is deployed in an Azure AI Foundry project, you can also use the Azure AI Foundry SDK to retrieve a project client, from which you can then get an authenticated OpenAI chat client for any models deployed in the project’s Azure AI Foundry resource. This approach makes it easy to write code that consumes models deployed in your project, switching between them easily by changing the model deployment name parameter.