developer
7342 TopicsGetting Started with the AI Dev Gallery
The AI Dev Gallery is a new open-source project designed to inspire and support developers in integrating on-device AI functionality into their Windows apps. It offers an intuitive UX for exploring and testing interactive AI samples powered by local models. Key features include: Quickly explore and download models from well-known sources on GitHub and HuggingFace. Test different models with interactive samples over 25 different scenarios, including text, image, audio, and video use cases. See all relevant code and library references for every sample. Switch between models that run on CPU and GPU depending on your device capabilities. Quickly get started with your own projects by exporting any sample to a fresh Visual Studio project that references the same model cache, preventing duplicate downloads. Part of the motivation behind the Gallery was exposing developers to the host of benefits that come with on-device AI. Some of these benefits include improved data security and privacy, increased control and parameterization, and no dependence on an internet connection or third-party cloud provider. Requirements Device Requirements Minimum OS Version: Windows 10, version 1809 (10.0; Build 17763) Architecture: x64, ARM64 Memory: At least 16 GB is recommended Disk Space: At least 20GB free space is recommended GPU: 8GB of VRAM is recommended for running samples on the GPU Visual Studio 2022 You will need Visual Studio 2022 with the Windows Application Development workload. Running the Gallery To run the gallery: Clone the repository: git clone https://github.com/microsoft/AI-Dev-Gallery.git Run the solution: .\AIDevGallery.sln HitF5 to build and run the Gallery Using the Gallery The AI Dev Gallery has can be navigated in two ways: The Samples View The Models View Navigating Samples In this view, samples are broken up into categories (Text, Code, Image, etc.) and then into more specific samples, like in the Translate Text pictured below: On clicking a sample, you will be prompted to choose a model to download if you haven’t run this sample before: Next to the model you can see the size of the model, whether it will run on CPU or GPU, and the associated license. Pick the model that makes the most sense for your machine. You can also download new models and change the model for a sample later from the sample view. Just click the model drop down at the top of the sample: The last thing you can do from the Sample pane is view the sample code and export the project to Visual Studio. Both buttons are found in the top right corner of the sample, and the code view will look like this: Navigating Models If you would rather navigate by models instead of samples, the Gallery also provides the model view: The model view contains a similar navigation menu on the right to navigate between models based on category. Clicking on a model will allow you to see a description of the model, the versions of it that are available to download, and the samples that use the model. Clicking on a sample will take back over to the samples view where you can see the model in action. Deleting and Managing Models If you need to clear up space or see download details for the models you are using, you can head over the Settings page to manage your downloads: From here, you can easily see every model you have downloaded and how much space on your drive they are taking up. You can clear your entire cache for a fresh start or delete individual models that you are no longer using. Any deleted model can be redownload through either the models or samples view. Next Steps for the Gallery The AI Dev Gallery is still a work in progress, and we plan on adding more samples and features to take the experience even further. If you have feedback, noticed a bug, or any ideas for features or samples, head over to the issue board and submit an issue. We also have a discussion board for any other topics relevant to the Gallery. The Gallery is an open-source project, and we would love contribution, feedback, and ideation! Happy modeling!Working with Arrays of Ranges
OK, so strictly speaking an array of ranges is an error in Excel right from the outset. However, I set up an array of tables contained within the named Range 'allocatedRange', here shown with a red outline. I then set up a function that would return the range corresponding to a country SelectDataλ = LAMBDA(country, LET( countries, FILTER(TAKE(allocatedRange, , 1), markers = "Country:"), recordNum, FILTER(SEQUENCE(ROWS(allocatedRange)), markers = "Country:"), recordEnd, VSTACK(DROP(recordNum - 1, 1), ROWS(allocatedRange)), rangeRows, recordEnd - recordNum, countryArrϑ, MAP( recordNum, rangeRows, LAMBDA(start, rows, LAMBDA(TRIMRANGE(TAKE(DROP(allocatedRange, start), rows)))) ), XLOOKUP(country, countries, countryArrϑ)() ) ) The start and row count of each table is determined by using the string "Country:" as a marker and differencing row numbers. A combination of TRIMRANGE/TAKE/DROP picks out each range in turn and assembles them into an array by turning the range references into thunks (TYPE=128). The function SelectDataλ is used to look up any specific country and return the corresponding range. To demonstrate that the function indeed returns ranges, the COUNTIFS function is used to count the number of cities within each country that have a population exceeding 100 000. = LET( countries, FILTER(TAKE(allocatedRange,,1), markers="Country:"), countLarge, MAP(countries, LAMBDA(country, COUNTIFS(TAKE(SelectDataλ(country),,-1), ">1000000") ) ), HSTACK(countries, countLarge) ) The point of this post is to introduce the idea of treating tables as elements of an array, so allowing further tables to be inserted or removed dynamically. TRIMRANGE ensures that each range is sized correctly and MAP is used to analyse each table in turn. Whilst Excel throws hissy fits at being asked to store arrays of arrays, arrays of ranges, or nested arrays, it is perfectly happy to store arrays of functions. When evaluated, each element of the function array is perfectly free to return an array or even a range. The effect is to permit Excel to process 'arrays of Tables' faultlessly.25Views0likes1CommentResponsible AI Resources for Developers
In the rapidly evolving world of technology, AI stands at the forefront of innovation. However, with great power comes great responsibility. As developers, we play a pivotal role in shaping the future of AI, ensuring it aligns with ethical standards and societal values. Microsoft is committed to guiding developers on this journey with resources and tools designed to develop responsible AI.My first Add-In
Hello everyone, I’m working on developing my first Add-In for Outlook 365. In theory, it’s quite simple—it’s a drop-down menu with two options. Each option opens a new email and loads a different template, depending on the selection. So far, the menu is functioning smoothly. Selecting option A displays the corresponding template, and the same goes for option B. However, I’m facing a problem: I can’t get the user’s signature to load automatically as expected, even though the signature is properly configured and set as the default for new emails. I’ve attached part of mymanifest.xml and command.ts files for you to review. If you could provide some guidance on how to resolve this issue, I’d greatly appreciate it. Thank you so much for your support! manifest.xml <Requirements> <Sets> <Set Name="Mailbox" MinVersion="1.5"/> </Sets> </Requirements> <FormSettings> <Form xsi:type="ItemRead"> <DesktopSettings> <SourceLocation DefaultValue="https://localhost:3000/taskpane.html"/> <RequestedHeight>250</RequestedHeight> </DesktopSettings> </Form> </FormSettings> <Permissions>ReadWriteItem</Permissions> <Rule xsi:type="RuleCollection" Mode="Or"> <Rule xsi:type="ItemIs" ItemType="Message" FormType="Read"/> <Rule xsi:type="ItemIs" ItemType="Message" FormType="Edit"/> </Rule> <DisableEntityHighlighting>false</DisableEntityHighlighting> <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0"> <Requirements> <bt:Sets DefaultMinVersion="1.5"> <bt:Set Name="Mailbox"/> </bt:Sets> </Requirements> <Hosts> <Host xsi:type="MailHost"> <DesktopFormFactor> <FunctionFile resid="Commands.Url"/> <ExtensionPoint xsi:type="MessageReadCommandSurface"> <OfficeTab id="TabDefault"> <Group id="msgReadGroup"> <Label resid="GroupLabel"/> <!-- Menú desplegable para las opciones --> <Control xsi:type="Menu" id="DropdownMenu"> <Label resid="DropdownMenu.Label"/> <Supertip> <Title resid="DropdownMenu.Label"/> <Description resid="DropdownMenu.Tooltip"/> </Supertip> <Icon> <bt:Image size="16" resid="MenuIcon.16x16"/> <bt:Image size="32" resid="MenuIcon.32x32"/> <bt:Image size="80" resid="MenuIcon.80x80"/> </Icon> <Items> <Item id="InternalAction"> <Label resid="InternalAction.Label"/> <Supertip> <Title resid="InternalAction.Label"/> <Description resid="InternalAction.Tooltip"/> </Supertip> <!-- Imagen para la opción Internal --> <Icon> <bt:Image size="16" resid="InternalIcon.16x16"/> <bt:Image size="32" resid="InternalIcon.32x32"/> <bt:Image size="80" resid="InternalIcon.80x80"/> </Icon> <Action xsi:type="ExecuteFunction"> <FunctionName>handleInternalAction</FunctionName> </Action> </Item> <Item id="ExternalAction"> <Label resid="ExternalAction.Label"/> <Supertip> <Title resid="ExternalAction.Label"/> <Description resid="ExternalAction.Tooltip"/> </Supertip> <!-- Imagen para la opción External --> <Icon> <bt:Image size="16" resid="ExternalIcon.16x16"/> <bt:Image size="32" resid="ExternalIcon.32x32"/> <bt:Image size="80" resid="ExternalIcon.80x80"/> </Icon> <Action xsi:type="ExecuteFunction"> <FunctionName>handleExternalAction</FunctionName> </Action> </Item> </Items> </Control> </Group> </OfficeTab> </ExtensionPoint> </DesktopFormFactor> </Host> </Hosts> <Resources> <bt:Images> <!-- Iconos del menú --> <bt:Image id="MenuIcon.16x16" DefaultValue="https://localhost:3000/assets/menu-icon-16.png"/> <bt:Image id="MenuIcon.32x32" DefaultValue="https://localhost:3000/assets/menu-icon-32.png"/> <bt:Image id="MenuIcon.80x80" DefaultValue="https://localhost:3000/assets/menu-icon-80.png"/> <!-- Iconos para la opción Internal --> <bt:Image id="InternalIcon.16x16" DefaultValue="https://localhost:3000/assets/int-16.png"/> <bt:Image id="InternalIcon.32x32" DefaultValue="https://localhost:3000/assets/int-32.png"/> <bt:Image id="InternalIcon.80x80" DefaultValue="https://localhost:3000/assets/int-80.png"/> <!-- Iconos para la opción External --> <bt:Image id="ExternalIcon.16x16" DefaultValue="https://localhost:3000/assets/ext-16.png"/> <bt:Image id="ExternalIcon.32x32" DefaultValue="https://localhost:3000/assets/ext-32.png"/> <bt:Image id="ExternalIcon.80x80" DefaultValue="https://localhost:3000/assets/ext-80.png"/> </bt:Images> <bt:Urls> <bt:Url id="Commands.Url" DefaultValue="https://localhost:3000/commands.html"/> <bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html"/> <bt:Url id="CommandsJs.Url" DefaultValue="https://localhost:3000/commands/commands.js"/> </bt:Urls> <bt:ShortStrings> <!-- Nombre del grupo --> <bt:String id="GroupLabel" DefaultValue="New Client/Matter"/> <!-- Etiqueta para el menú desplegable --> <bt:String id="DropdownMenu.Label" DefaultValue="Choose Action"/> <!-- Etiqueta para la opción Internal --> <bt:String id="InternalAction.Label" DefaultValue="Internal"/> <!-- Etiqueta para la opción External --> <bt:String id="ExternalAction.Label" DefaultValue="External"/> </bt:ShortStrings> <bt:LongStrings> <!-- Tooltip para el menú --> <bt:String id="DropdownMenu.Tooltip" DefaultValue="Select an action to perform."/> <!-- Tooltip para la opción Internal --> <bt:String id="InternalAction.Tooltip" DefaultValue="Opens an internal email template."/> <!-- Tooltip para la opción External --> <bt:String id="ExternalAction.Tooltip" DefaultValue="Opens an external email template."/> </bt:LongStrings> </Resources> </VersionOverrides> </OfficeApp> command.ts /* global Office */ Office.onReady(function (info) { if (info.host === Office.HostType.Outlook) { Office.actions.associate("handleInternalAction", handleInternalAction); Office.actions.associate("handleExternalAction", handleExternalAction); } }); /** * Handles the "Internal" action. * param event The Office Add-in event. */ function handleInternalAction(event) { console.log("Handling internal action..."); openEmailTemplate("internal"); event.completed(); } /** * Handles the "External" action. * param event The Office Add-in event. */ function handleExternalAction(event) { console.log("Handling external action..."); openEmailTemplate("external"); event.completed(); } /** * Opens an email template with the user's signature. * param templateType The type of template ("internal" or "external"). */ function openEmailTemplate(templateType) { var templateBody = templateType === "internal" ? "This is the internal email template." : "This is the external email template."; var subject = templateType === "internal" ? "Internal Client/Matter" : "External Client/Matter"; console.log("Opening email template..."); // Open a new email draft Office.context.mailbox.displayNewMessageForm({ subject: subject, htmlBody: templateBody, }); // Insert the user's signature after the draft is created Office.context.mailbox.item.body.getAsync(Office.CoercionType.Html, function (result) { console.log("Attempting to get user's signature..."); if (result.status === Office.AsyncResultStatus.Succeeded) { var userSignature = result.value || ""; console.log("User's signature retrieved: ", userSignature); // Combine the template body with the user's signature var combinedBody = templateBody + "<br/><br/>" + userSignature; console.log("Updating email body with template and signature..."); // Update the email body with the template and the user's signature Office.context.mailbox.item.body.setAsync(combinedBody, { coercionType: Office.CoercionType.Html, asyncContext: { value: "setBody" }, // Optional: track async operation }); } else { console.error("Failed to get user's signature:", result.error); } }); } //# sourceMappingURL=commands.js.map26Views0likes0CommentsSide-panel Teams meeting app becomes unusable but stays open/visible when user joins a breakout room
I am working with a side-panel Teams meeting app. A customer noticed behavior that I have been able to replicate but have not found an explanation for, or a way to prevent. Issue summary When a user has a side panel app open, and the user is pushed into a Teams meeting breakout room, the side panel app remains open/visible but the app content disappears (making the app unusable). Replicating this behavior 1. User has app open in Teams meeting side panel. In the below screenshot, note that the app is listed in the interface (red circle), and open in the side panel. 2. User is pushed into a breakout room. The user does not interact with the interface and is automatically pushed into a breakout room. 3. Upon joining the breakout room, the app appears to remain open in the side panel, but the content disappears. In the below screenshot, note that: The side panel app content is now empty/blank. The app icon disappears from the Teams meeting interface (red circle). This is expected, but just want to note that the app is not attached to the breakout room at all. Thoughts My understanding is that apps don't carry over from the main Teams meeting into breakout rooms (though apps can still be added inside of breakout rooms), so the curiosity here is why the side panel app remains open when moving from the main room to a breakout room. And one more interesting note — using the three dots and "Reload" on a side panel app gets the app to reload and work again inside the breakout room, despite the app not being listed as an interface tab within the breakout room. I don't necessarily need the app to remain usable as a user joins a breakout room, but I am wondering what's going on here with the app remaining open/visible.71Views0likes3CommentsHow to restore selected ribbon tab after report with a custom ribbon is closed?
We have a database which has two ribbons. A Switchboard ribbon with multiple tabs and a hidden PrintPreview ribbon used through report “Ribbon Name” property. The PrintPreview ribbon has startFromScratch="true". The tabs of Switchboard ribbon have multiple buttons use for opening a corresponding report. The problem is that each time a user opens and closes a report the Switchboard ribbon jumps back to first tab. Example: Switchboard has tab1, tab2. The tab1 has button1 and button2 to open report1 and report2 correspondently. The tab2 has button3 and button4 to open report3 and report4 correspondently All 4 reports have “Ribbon Name” property set to PrintPreview ribbon. User clicks report3 from tab2. The report3 is opens, Switchboard ribbon is hidden and PrintPreview ribbon is visible. User close report3. The Switchboard ribbon became visible and tab1 is an active tab. Now user need to click on tab2 again if he/she want to open report4 or even report3 again. If we extrapolate this situation for 17 tabs on Switchboard ribbon with each tab having ~20 reports we can see user frustration with moving focus back to first tab. Is where a way to remember which tab in Switchboard ribbon was active before opening PrintPreview ribbon and make it active after report is closed? Note: the only possible solution I found was with use of Ribbon Accessibility here www.wordarticles.com/Shorts/RibbonVBA/RibbonVBADemo.php It is a quite complicated and does not works under Access 365 too. Any help would be appreciated! Thank you!35Views0likes3Comments