Guest Christopher Nguyen Posted November 17, 2023 Posted November 17, 2023 At Build 2023, we announced that Windows Terminal users will be able to take advantage of natural language AI to recommend commands, explain errors and take actions within Windows Terminal. Since then, we have been listening to customer feedback and iterating on our AI chat experiments in Windows Terminal. The Windows Terminal team is committed to transparency, and we want to give the open-source community an opportunity to help us define what AI looks like in a terminal application. As a result, we are open sourcing our work on Terminal Chat, our AI chat feature. Open sourcing this feature will allow developers to get a chance to try this experience and build it with us. Terminal Chat is a feature in Windows Terminal Canary that allows the user to chat with an AI service to get intelligent suggestions (such as looking up a command or explaining an error message) while staying in the context of their terminal. [ATTACH=full]42443[/ATTACH] This feature does not ship with its own large-language model. For now, users will need to provide their Azure OpenAI Service endpoint and key to use Terminal Chat. The code for Terminal Chat, our AI chat experience, can be found in the [iCODE]feature/llm[/iCODE] branch of the Windows Terminal repository on GitHub. You can also download the latest build of Windows Terminal Canary from our GitHub repository as well. [HEADING=1]Setting up Terminal Chat[/HEADING] Windows Terminal Canary does not ship with a default model or built-in AI model. To use Terminal Chat, you will need to add an AI service endpoint and key to the AI Settings of Windows Terminal Canary. Terminal Chat only supports Azure OpenAI Service for now. To get an Azure OpenAI Service endpoint and key, you will need to create and deploy an Azure OpenAI Service resource. [ATTACH=full]42444[/ATTACH] [HEADING=1]Creating and Deploying an Azure OpenAI Service resource[/HEADING] To create and deploy an Azure OpenAI Service resource, please follow the official Azure OpenAI documentation on creating and deploying an Azure OpenAI Service resource. In that documentation, you will learn how to: 1. Create a resource 2. Deploy a model You will need to use a [iCODE]gpt-35-turbo[/iCODE] model with your deployment. After creating a resource and deploying a model, you can find your Azure OpenAI Service endpoint and key by navigating to the Chat playground in Azure OpenAI Studio and selecting View code in the Chat session section. The View code pop-up dialog will show you a valid Azure OpenAI Service endpoint and key that you can use for Terminal Chat. [ATTACH=full]42445[/ATTACH] [HEADING=1]Using Terminal Chat[/HEADING] After entering your AI service endpoint and key in AI Settings, select Store and Save to store and save those values. This will allow you to use Terminal Chat with the AI service that is affiliated with your service endpoint. [ATTACH=full]42446[/ATTACH] Clicking on the suggestion will copy it to the input line of your terminal. Terminal Chat will not run the suggestion automatically for you– This way, you will have time to reason over the command before executing it [ATTACH=full]42447[/ATTACH] Terminal Chat also takes the name of the active shell that you are using and sends that name as additional context to the AI service. This allows us to get answers that are more tailored towards the shell that we are currently using– Because as we all know, listing files in a directory is a lot different in Command Prompt than it is in PowerShell [ATTACH=full]42448[/ATTACH] [ATTACH=full]42449[/ATTACH] Windows Terminal Canary only communicates with an AI service when the user sends a message. The chat history and name of the user’s active shell is also appended to the message that is sent to the AI service. The chat history is not saved by Windows Terminal Canary after their terminal session is over. [HEADING=1]Tips & Tricks[/HEADING] You can set Terminal Chat as a keybinding Action to invoke the chat pane without having to click on “Terminal Chat” from the dropdown menu. To do this, you will need to go to Settings then Actions. Select + Add new and then pick Toggle AI chat from the dropdown to add a new keybinding Action for the Terminal Chat feature. I used Alt + a for my keybinding Action, but feel free to use any keybinding you want! [ATTACH=full]42450[/ATTACH] [ATTACH=full]42451[/ATTACH] Your new keybinding will also be reflected in the dropdown menu. [ATTACH=full]42452[/ATTACH] [HEADING=1]Let’s build together![/HEADING] Windows Terminal exists to push the boundaries of what a terminal emulator can do, however, we understand that that “AI in a terminal” can sound daunting. We are committed to transparency and listening to user feedback. We strongly believe that the inclusion of the open-source community will help us define our AI roadmap and help us identify the minimal loveable AI feature set that can go into our core product, Windows Terminal. For now, the Terminal Chat feature will only be available in Windows Terminal Canary. It will not be included in builds of Windows Terminal Preview or Windows Terminal stable. If you are interested in the AI experiences that we are building for Windows Terminal, then please check out the [iCODE]feature/llm[/iCODE] branch of the Windows Terminal repository or download the latest build of Windows Terminal Canary. If you have a feature request or found a bug in Windows Terminal Canary, then please submit a new Issue on our GitHub repository. Send us feedback! Help us grow! And let’s build together! [ATTACH=full]42453[/ATTACH] The post Terminal Chat in Windows Terminal Canary appeared first on Windows Command Line. Continue reading... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.