From 850a58c8dd65052bf5e005a5fe94395df7fea76d Mon Sep 17 00:00:00 2001 From: Jakob Nielsen Date: Mon, 19 Sep 2016 18:25:54 -0700 Subject: [PATCH] Initial commit --- .gitattributes | 63 + .gitignore | 10 + CONTRIBUTING.md | 191 + ExcelBot.sln | 28 + ExcelBot/App_Start/WebApiConfig.cs | 42 + ExcelBot/ApplicationInsights.config | 89 + ExcelBot/Constants/Constants.cs | 36 + ExcelBot/Controllers/ChartController.cs | 66 + ExcelBot/Controllers/LoginController.cs | 51 + ExcelBot/Controllers/MessagesController.cs | 130 + ExcelBot/Dialogs/CellsDialog.cs | 221 + ExcelBot/Dialogs/ChartsDialog.cs | 108 + ExcelBot/Dialogs/ExcelBotDialog.cs | 108 + ExcelBot/Dialogs/NamedItemsDialog.cs | 157 + ExcelBot/Dialogs/OpenWorkbookDialog.cs | 70 + ExcelBot/Dialogs/TablesDialog.cs | 100 + ExcelBot/Dialogs/WorkbooksDialog.cs | 99 + ExcelBot/Dialogs/WorksheetsDialog.cs | 156 + ExcelBot/ExcelBot.csproj | 235 + ExcelBot/ExcelBot.csproj.user | 32 + ExcelBot/Forms/OpenWorkbookForm.cs | 28 + ExcelBot/Forms/SelectWorksheetForm.cs | 46 + ExcelBot/Global.asax | 1 + ExcelBot/Global.asax.cs | 22 + ExcelBot/Helpers/AuthHelper.cs | 74 + ExcelBot/Helpers/BotDataHelper.cs | 66 + ExcelBot/Helpers/ExcelHelper.cs | 183 + ExcelBot/Helpers/IndexOf.cs | 21 + ExcelBot/Helpers/LuisHelper.cs | 111 + ExcelBot/Helpers/RequestHelper.cs | 32 + ExcelBot/Helpers/ServicesHelper.cs | 172 + ExcelBot/Helpers/TelemetryHelper.cs | 65 + ExcelBot/Luis/ExcelBot.json | 11888 +++++++++++++++++++ ExcelBot/Model/ObjectType.cs | 20 + ExcelBot/Model/UserData.cs | 17 + ExcelBot/Properties/AssemblyInfo.cs | 35 + ExcelBot/Web.Debug.config | 32 + ExcelBot/Web.Release.config | 33 + ExcelBot/Web.config | 88 + ExcelBot/Workers/CellWorker.cs | 104 + ExcelBot/Workers/ChartsWorker.cs | 122 + ExcelBot/Workers/NamedItemsWorker.cs | 304 + ExcelBot/Workers/TablesWorker.cs | 286 + ExcelBot/Workers/WorkbookWorker.cs | 67 + ExcelBot/Workers/WorksheetWorker.cs | 133 + ExcelBot/chat.htm | 24 + ExcelBot/default.htm | 24 + ExcelBot/loggedin.htm | 23 + ExcelBot/packages.config | 24 + LICENSE | 26 + README.md | 48 + 51 files changed, 16111 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 CONTRIBUTING.md create mode 100644 ExcelBot.sln create mode 100644 ExcelBot/App_Start/WebApiConfig.cs create mode 100644 ExcelBot/ApplicationInsights.config create mode 100644 ExcelBot/Constants/Constants.cs create mode 100644 ExcelBot/Controllers/ChartController.cs create mode 100644 ExcelBot/Controllers/LoginController.cs create mode 100644 ExcelBot/Controllers/MessagesController.cs create mode 100644 ExcelBot/Dialogs/CellsDialog.cs create mode 100644 ExcelBot/Dialogs/ChartsDialog.cs create mode 100644 ExcelBot/Dialogs/ExcelBotDialog.cs create mode 100644 ExcelBot/Dialogs/NamedItemsDialog.cs create mode 100644 ExcelBot/Dialogs/OpenWorkbookDialog.cs create mode 100644 ExcelBot/Dialogs/TablesDialog.cs create mode 100644 ExcelBot/Dialogs/WorkbooksDialog.cs create mode 100644 ExcelBot/Dialogs/WorksheetsDialog.cs create mode 100644 ExcelBot/ExcelBot.csproj create mode 100644 ExcelBot/ExcelBot.csproj.user create mode 100644 ExcelBot/Forms/OpenWorkbookForm.cs create mode 100644 ExcelBot/Forms/SelectWorksheetForm.cs create mode 100644 ExcelBot/Global.asax create mode 100644 ExcelBot/Global.asax.cs create mode 100644 ExcelBot/Helpers/AuthHelper.cs create mode 100644 ExcelBot/Helpers/BotDataHelper.cs create mode 100644 ExcelBot/Helpers/ExcelHelper.cs create mode 100644 ExcelBot/Helpers/IndexOf.cs create mode 100644 ExcelBot/Helpers/LuisHelper.cs create mode 100644 ExcelBot/Helpers/RequestHelper.cs create mode 100644 ExcelBot/Helpers/ServicesHelper.cs create mode 100644 ExcelBot/Helpers/TelemetryHelper.cs create mode 100644 ExcelBot/Luis/ExcelBot.json create mode 100644 ExcelBot/Model/ObjectType.cs create mode 100644 ExcelBot/Model/UserData.cs create mode 100644 ExcelBot/Properties/AssemblyInfo.cs create mode 100644 ExcelBot/Web.Debug.config create mode 100644 ExcelBot/Web.Release.config create mode 100644 ExcelBot/Web.config create mode 100644 ExcelBot/Workers/CellWorker.cs create mode 100644 ExcelBot/Workers/ChartsWorker.cs create mode 100644 ExcelBot/Workers/NamedItemsWorker.cs create mode 100644 ExcelBot/Workers/TablesWorker.cs create mode 100644 ExcelBot/Workers/WorkbookWorker.cs create mode 100644 ExcelBot/Workers/WorksheetWorker.cs create mode 100644 ExcelBot/chat.htm create mode 100644 ExcelBot/default.htm create mode 100644 ExcelBot/loggedin.htm create mode 100644 ExcelBot/packages.config create mode 100644 LICENSE create mode 100644 README.md diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a1ac16d --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +################################################################################ +# This .gitignore file was automatically created by Microsoft(R) Visual Studio. +################################################################################ + +/.vs/config +/ExcelBot/bin +/ExcelBot/obj +/packages +/.vs/ExcelBot/v14 +/ExcelBotEmbedded/ExcelBotEmbedded/bin diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..6b65526 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,191 @@ +# Contribute to this code sample + +Thank you for your interest in our sample + +* [Ways to contribute](#ways-to-contribute) +* [To contribute using Git](#to-contribute-using-git) +* [Contribute code](#contribute-code) +* [FAQ](#faq) +* [More resources](#more-resources) + +## Ways to contribute + +Here are some ways you can contribute to this sample: + +* Add better comments to the sample code. +* Fix issues opened in GitHub against this sample. +* Add a new feature to the sample. + +We want your contributions. Help the developer community by improving this sample. +Contributions can include Bug fixes, new features, and better code documentation. +Submit code comment contributions where you want a better explanation of what's going on. +See a good example of [code commenting](https://github.com/OfficeDev/O365-Android-Microsoft-Graph-Connect/blob/master/app/src/main/java/com/microsoft/office365/connectmicrosoftgraph/AuthenticationManager.java). + +Another great way to improve the sample in this repository is to take on some of the open issues filed against the repository. You may have a solution to an bug in the sample code that hasn't been addressed. Fix the issue and then create a pull request following our [Contribute code](#contribute-code) guidance. + +If you want to add a new feature to the sample, be sure you have the agreement of the repository owner before writing the code. Start by opening an issue in the repository. Use the new issue to propose the feature. The repository owner will respond and will usually ask you for more information. When the owner agrees to take the new feature, code it and submit a pull request. + +## To contribute using Git +For most contributions, you'll be asked to sign a Contribution License Agreement (CLA). For those contributions that need it, The Office 365 organization on GitHub will send a link to the CLA that we want you to sign via email. +By signing the CLA, you acknowledge the rights of the GitHub community to use any code that you submit. The intellectual property represented by the code contribution is licensed for use by Microsoft open source projects. + +If Office 365 emails an CLA to you, you need to sign it before you can contribute large submissions to a project. You only need to complete and submit it once. +Read the CLA carefully. You may need to have your employer sign it. + +Signing the CLA does not grant you rights to commit to the main repository, but it does mean that the Office Developer and Office Developer Content Publishing teams will be able to review and approve your contributions. You will be credited for your submissions. + +Pull requests are typically reviewed within 10 business days. + +## Use GitHub, Git, and this repository + +**Note:** Most of the information in this section can be found in [GitHub Help] articles. If you're familiar with Git and GitHub, skip to the **Contribute code** section for the specifics of the code contributions for this repository. + +### To set up your fork of the repository + +1. Set up a GitHub account so you can contribute to this project. If you haven't done this, go to [GitHub](https://github.com/join) and do it now. +2. Install Git on your computer. Follow the steps in the [Setting up Git Tutorial] [Set Up Git]. +3. Create your own fork of this repository. To do this, at the top of the page, choose the **Fork** button. +4. Copy your fork to your computer. To do this, open Git Bash. At the command prompt enter: + + git clone https://github.com//.git + + Next, create a reference to the root repository by entering these commands: + + cd + git remote add upstream https://github.com/OfficeDev/.git + git fetch upstream + +Congratulations! You've now set up your repository. You won't need to repeat these steps again. + +## Contribute code + +To make the contribution process as seamless as possible, follow these steps. + +### To contribute code + +1. Create a new branch. +2. Add new code or modify existing code. +3. Submit a pull request to the main repository. +4. Await notification of acceptance and merge. +5. Delete the branch. + + +### To create a new branch + +1. Open Git Bash. +2. At the Git Bash command prompt, type `git pull upstream master:`. This creates a new branch locally that is copied from the latest OfficeDev master branch. +3. At the Git Bash command prompt, type `git push origin `. This alerts GitHub to the new branch. You should now see the new branch in your fork of the repository on GitHub. +4. At the Git Bash command prompt, type `git checkout ` to switch to your new branch. + +### Add new code or modify existing code + +Navigate to the repository on your computer. On a Windows PC, the repository files are in `C:\Users\\`. + +Use the IDE of your choice to modify and build the sample. Once you have completed your change, commented your code, and test, check the code +into the remote branch on GitHub. + +#### Code contribution checklist +Be sure to satisfy all of the requirements in the following list before submitting a pull request: +- Follow the code style found in the cloned repository code. Our Android code follows the style conventions found in the [Code Style for Contributors](https://source.android.com/source/code-style.html) guide. +- Code must be tested. +- Test the sample UI thoroughly to be sure nothing has been broken by your change. +- Keep the size of your code change reasonable. if the repository owner cannot review your code change in 4 hours or less, your pull request may not be reviewed and approved quickly. +- Avoid unnecessary changes to cloned or forked code. The reviewer will use a tool to find the differences between your code and the original code. Whitespace changes are called out along with your code. Be sure your changes will help improve the content. + +### Push your code to the remote GitHub branch +The files in `C:\Users\\` are a working copy of the new branch that you created in your local repository. Changing anything in this folder doesn't affect the local repository until you commit a change. To commit a change to the local repository, type the following commands in GitBash: + + git add . + git commit -v -a -m "" + +The `add` command adds your changes to a staging area in preparation for committing them to the repository. The period after the `add` command specifies that you want to stage all of the files that you added or modified, checking subfolders recursively. (If you don't want to commit all of the changes, you can add specific files. You can also undo a commit. For help, type `git add -help` or `git status`.) + +The `commit` command applies the staged changes to the repository. The switch `-m` means you are providing the commit comment in the command line. The -v and -a switches can be omitted. The -v switch is for verbose output from the command, and -a does what you already did with the add command. + +You can commit multiple times while you are doing your work, or you can commit once when you're done. + +### Submit a pull request to the master repository + +When you're finished with your work and are ready to have it merged into the master repository, follow these steps. + +#### To submit a pull request to the master repository + +1. In the Git Bash command prompt, type `git push origin `. In your local repository, `origin` refers to your GitHub repository that you cloned the local repository from. This command pushes the current state of your new branch, including all commits made in the previous steps, to your GitHub fork. +2. On the GitHub site, navigate in your fork to the new branch. +3. Choose the **Pull Request** button at the top of the page. +4. Verify the Base branch is `OfficeDev/@master` and the Head branch is `/@`. +5. Choose the **Update Commit Range** button. +6. Add a title to your pull request, and describe all the changes you're making. +7. Submit the pull request. + +One of the site administrators will process your pull request. Your pull request will surface on the `OfficeDev/` site under Issues. When the pull request is accepted, the issue will be resolved. + +### Repository owner code review +The owner of the repository will review your pull request to be sure that all requirements are met. If the reviewer +finds any issues, she will communicate with you and ask you to address them and then submit a new pull request. If your pull +request is accepted, then the repository owner will tell you that your pull request is to be merged. + +### Create a new branch after merge + +After a branch is successfully merged (that is, your pull request is accepted), don't continue working in that local branch. This can lead to merge conflicts if you submit another pull request. To do another update, create a new local branch from the successfully merged upstream branch, and then delete your initial local branch. + +For example, if your local branch X was successfully merged into the OfficeDev/O365-Android-Microsoft-Graph-Connect master branch and you want to make additional updates to the code that was merged. Create a new local branch, X2, from the OfficeDev/O365-Android-Microsoft-Graph-Connect branch. To do this, open GitBash and execute the following commands: + + cd + git pull upstream master:X2 + git push origin X2 + +You now have local copies (in a new local branch) of the work that you submitted in branch X. The X2 branch also contains all the work other developers have merged, so if your work depends on others' work (for example, a base class), it is available in the new branch. You can verify that your previous work (and others' work) is in the branch by checking out the new branch... + + git checkout X2 + +...and verifying the code. (The `checkout` command updates the files in `C:\Users\\O365-Android-Microsoft-Graph-Connect` to the current state of the X2 branch.) Once you check out the new branch, you can make updates to the code and commit them as usual. However, to avoid working in the merged branch (X) by mistake, it's best to delete it (see the following **Delete a branch** section). + +### Delete a branch + +Once your changes are successfully merged into the main repository, delete the branch you used because you no longer need it. Any additional work should be done in a new branch. + +#### To delete a branch + +1. In the Git Bash command prompt, type `git checkout master`. This ensures that you aren't in the branch to be deleted (which isn't allowed). +2. Next, at the command prompt, type `git branch -d `. This deletes the branch on your computer only if it has been successfully merged to the upstream repository. (You can override this behavior with the `-D` flag, but first be sure you want to do this.) +3. Finally, type `git push origin :` at the command prompt (a space before the colon and no space after it). This will delete the branch on your github fork. + +Congratulations, you have successfully contributed to the sample app! + + +## FAQ + +### How do I get a GitHub account? + +Fill out the form at [Join GitHub](https://github.com/join) to open a free GitHub account. + +### Where do I get a Contributor's License Agreement? + +You will automatically be sent a notice that you need to sign the Contributor's License Agreement (CLA) if your pull request requires one. + +As a community member, **you must sign the CLA before you can contribute large submissions to this project**. You only need complete and submit the CLA document once. Carefully review the document. You may be required to have your employer sign the document. + +### What happens with my contributions? + +When you submit your changes, via a pull request, our team will be notified and will review your pull request. You will receive notifications about your pull request from GitHub; you may also be notified by someone from our team if we need more information. If your pull request is approved, we'll update the documentation on GitHub and on MSDN. We reserve the right to edit your submission for legal, style, clarity, or other issues. + +### Who approves pull requests? + +The owner of the sample repository approves pull requests. + +### How soon will I get a response about my change request? + +Pull requests are typically reviewed within 10 business days. + + +## More resources + +* To learn more about Markdown, go to the Git creator's site [Daring Fireball]. +* To learn more about using Git and GitHub, check out the [GitHub Help section] [GitHub Help]. + +[GitHub Home]: http://github.com +[GitHub Help]: http://help.github.com/ +[Set Up Git]: http://help.github.com/win-set-up-git/ +[Markdown Home]: http://daringfireball.net/projects/markdown/ +[Daring Fireball]: http://daringfireball.net/ diff --git a/ExcelBot.sln b/ExcelBot.sln new file mode 100644 index 0000000..e7c5fa0 --- /dev/null +++ b/ExcelBot.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExcelBot", "ExcelBot\ExcelBot.csproj", "{A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExcelRESTService.Portable", "..\uwp-csharp-excel-snippets-rest-sample\src\ExcelRESTService.Portable\ExcelRESTService.Portable.csproj", "{0BDA3891-AFD6-42F7-9005-3A1DF72766EC}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Release|Any CPU.Build.0 = Release|Any CPU + {0BDA3891-AFD6-42F7-9005-3A1DF72766EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0BDA3891-AFD6-42F7-9005-3A1DF72766EC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0BDA3891-AFD6-42F7-9005-3A1DF72766EC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0BDA3891-AFD6-42F7-9005-3A1DF72766EC}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/ExcelBot/App_Start/WebApiConfig.cs b/ExcelBot/App_Start/WebApiConfig.cs new file mode 100644 index 0000000..fc33f55 --- /dev/null +++ b/ExcelBot/App_Start/WebApiConfig.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web.Http; + +namespace ExcelBot +{ + public static class WebApiConfig + { + public static void Register(HttpConfiguration config) + { + // Json settings + config.Formatters.JsonFormatter.SerializerSettings.NullValueHandling = NullValueHandling.Ignore; + config.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + config.Formatters.JsonFormatter.SerializerSettings.Formatting = Formatting.Indented; + JsonConvert.DefaultSettings = () => new JsonSerializerSettings() + { + ContractResolver = new CamelCasePropertyNamesContractResolver(), + Formatting = Newtonsoft.Json.Formatting.Indented, + NullValueHandling = NullValueHandling.Ignore, + }; + + // Web API configuration and services + + // Web API routes + config.MapHttpAttributeRoutes(); + + config.Routes.MapHttpRoute( + name: "DefaultApi", + routeTemplate: "api/{controller}/{id}", + defaults: new { id = RouteParameter.Optional } + ); + } + } +} diff --git a/ExcelBot/ApplicationInsights.config b/ExcelBot/ApplicationInsights.config new file mode 100644 index 0000000..c990655 --- /dev/null +++ b/ExcelBot/ApplicationInsights.config @@ -0,0 +1,89 @@ + + + + + YOUR APPLICATION INSIGHTS KEY + + + + + + + + + + + + + System.Web.Handlers.TransferRequestHandler + Microsoft.VisualStudio.Web.PageInspector.Runtime.Tracing.RequestDataHttpHandler + System.Web.StaticFileHandler + System.Web.Handlers.AssemblyResourceLoader + System.Web.Optimization.BundleHandler + System.Web.Script.Services.ScriptHandlerFactory + System.Web.Handlers.TraceHandler + System.Web.Services.Discovery.DiscoveryRequestHandler + System.Web.HttpDebugHandler + + + + + + + + 5 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ExcelBot/Constants/Constants.cs b/ExcelBot/Constants/Constants.cs new file mode 100644 index 0000000..9ac320f --- /dev/null +++ b/ExcelBot/Constants/Constants.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Linq; +using System.Web; + +namespace ExcelBot +{ + public static class Constants + { + #region + + internal static string LogicAppQueryUrl = ConfigurationManager.AppSettings["logicAppQueryUrl"]; + internal static string LogicAppCreateUrl = ConfigurationManager.AppSettings["logicAppCreateUrl"]; + internal static string LogicAppCommandUrl = ConfigurationManager.AppSettings["logicAppCommandUrl"]; + + internal static string ADClientId = ConfigurationManager.AppSettings["ADClientId"]; + internal static string ADClientSecret = ConfigurationManager.AppSettings["ADClientSecret"]; + + internal static string apiBasePath = ConfigurationManager.AppSettings["apiBasePath"].ToLower(); + + internal static string botId = ConfigurationManager.AppSettings["AppId"]; + internal static string botSecret = ConfigurationManager.AppSettings["AppSecret"]; + + internal static string regex_create = "\\s(.*):\\s?(.*)"; + internal static string regex_command = "^\\/(\\w*)\\s*"; + + #endregion + } + +} \ No newline at end of file diff --git a/ExcelBot/Controllers/ChartController.cs b/ExcelBot/Controllers/ChartController.cs new file mode 100644 index 0000000..800a7bb --- /dev/null +++ b/ExcelBot/Controllers/ChartController.cs @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Web; +using System.Web.Http; +using System.Threading.Tasks; +using System.IO; +using System.Net.Http.Headers; + +using ExcelBot.Helpers; + +namespace ExcelBot +{ + public class ChartController : ApiController + { + [HttpGet, Route("api/{channelId}/{conversationId}/{userId}/{workbookId}/{worksheetId}/{chartId}/image")] + public async Task Image(string channelId, string conversationId, string userId, string workbookId, string worksheetId, string chartId) + { + // Save the request url + RequestHelper.RequestUri = Request.RequestUri; + + // Check authentication + try + { + ServicesHelper.AccessToken = await AuthHelper.GetAccessToken(channelId, userId); + } + catch + { + var forbiddenResponse = Request.CreateResponse(HttpStatusCode.Forbidden); + return forbiddenResponse; + } + + // Get session id + var conversationData = await BotDataHelper.GetConversationData(channelId, conversationId); + + // Get the chart image + var imageAsString = await ServicesHelper.ExcelService.GetChartImageAsync(workbookId, worksheetId, chartId, ExcelHelper.GetSessionIdForRead(conversationData, workbookId)); + + // Convert the image from a string to an image + byte[] byteBuffer = Convert.FromBase64String(imageAsString); + + var memoryStream = new MemoryStream(byteBuffer); + memoryStream.Position = 0; + + // Send the image back in the response + var response = Request.CreateResponse(HttpStatusCode.OK); + response.Headers.AcceptRanges.Add("bytes"); + response.Content = new StreamContent(memoryStream); + response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("render"); + response.Content.Headers.ContentDisposition.FileName = "chart.png"; + response.Content.Headers.ContentType = new MediaTypeHeaderValue("image/png"); + response.Content.Headers.ContentLength = memoryStream.Length; + response.Headers.CacheControl = new CacheControlHeaderValue() { NoCache = true, NoStore = true }; + return response; + } + } +} + diff --git a/ExcelBot/Controllers/LoginController.cs b/ExcelBot/Controllers/LoginController.cs new file mode 100644 index 0000000..4c5bf49 --- /dev/null +++ b/ExcelBot/Controllers/LoginController.cs @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Web; +using System.Web.Http; +using System.Web.Http.Results; +using System.Threading.Tasks; + +using Microsoft.IdentityModel.Clients.ActiveDirectory; + +using ExcelBot.Helpers; + +namespace ExcelBot +{ + public class LoginController : ApiController + { + [HttpGet, Route("api/{channelid}/{userid}/login")] + public RedirectResult Login(string channelid, string userid) + { + return Redirect(String.Format("https://login.windows.net/common/oauth2/authorize?response_type=code&client_id={0}&redirect_uri={1}&resource={2}", + Constants.ADClientId, HttpUtility.UrlEncode(Constants.apiBasePath + channelid + "/" + userid + "/authorize"), HttpUtility.UrlEncode("https://graph.microsoft.com/"))); + } + + [HttpGet, Route("api/{channelid}/{userid}/authorize")] + public async Task Authorize(string channelid, string userid, string code) + { + AuthenticationContext ac = new AuthenticationContext("https://login.windows.net/common/oauth2/authorize/"); + ClientCredential cc = new ClientCredential(Constants.ADClientId, Constants.ADClientSecret); + AuthenticationResult ar = await ac.AcquireTokenByAuthorizationCodeAsync(code, new Uri(Constants.apiBasePath + channelid + "/" + userid + "/authorize"), cc); + if (!String.IsNullOrEmpty(ar.AccessToken)) + { + await AuthHelper.SaveAuthResult(Request, channelid, userid, ar.Serialize()); + + var response = Request.CreateResponse(HttpStatusCode.Moved); + response.Headers.Location = new Uri("/loggedin.htm", UriKind.Relative); + return response; + } + else + return Request.CreateResponse(HttpStatusCode.Unauthorized); + } + } +} + diff --git a/ExcelBot/Controllers/MessagesController.cs b/ExcelBot/Controllers/MessagesController.cs new file mode 100644 index 0000000..398b045 --- /dev/null +++ b/ExcelBot/Controllers/MessagesController.cs @@ -0,0 +1,130 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +using System.Web.Http; + +using Microsoft.Bot.Builder.Dialogs; +using Microsoft.Bot.Connector; + +using ExcelBot.Dialogs; +using ExcelBot.Helpers; + +namespace ExcelBot +{ + [BotAuthentication] + public class MessagesController : ApiController + { + + /// + /// POST: api/Messages + /// Receive a message from a user and reply to it + /// + public async Task Post([FromBody]Message message) + { + // Add User, Conversation and Channel Id to instrumentation + TelemetryHelper.SetIds(message); + + // Save the request url + RequestHelper.RequestUri = Request.RequestUri; + + // Check authentication + try + { + ServicesHelper.AccessToken = await AuthHelper.GetAccessToken(message); + } + catch (Exception) + { + return message.CreateReplyMessage($"You must sign in to use the bot: {Request.RequestUri.Scheme}://{Request.RequestUri.Authority}/api/{message.From.ChannelId}/{message.From.Id}/login"); + } + + // Process the message + if ((message.Type == "Message") && (message.Text.StartsWith("!"))) + { + return HandleCommandMessage(message); + } + else if (message.Type == "Message") + { + ServicesHelper.StartLogging(message); + return await Conversation.SendAsync(message, () => new ExcelBotDialog()); + } + else + { + return HandleSystemMessage(message); + } + } + + private Message HandleCommandMessage(Message message) + { + Message reply = message.CreateReplyMessage(); + + var messageParts = message.Text.ToLower().Split(' '); + + switch (messageParts[0]) + { + case "!verbose": + if ((messageParts.Length >= 2) && (messageParts[1] == "on")) + { + reply.SetBotConversationData("Verbose", true); + reply.Text = @"Verbose mode is **On**"; + } + else if ((messageParts.Length >= 2) && (messageParts[1] == "off")) + { + reply.SetBotConversationData("Verbose", false); + reply.Text = @"Verbose mode is **Off**"; + } + else + { + var verbose = message.GetBotConversationData("Verbose"); + var verboseState = verbose ? "On":"Off"; + reply.Text = $@"Verbose mode is **{verboseState}**"; + } + break; + default: + reply.Text = @"Sorry, I don't understand what you want to do."; + break; + } + return reply; + } + + private Message HandleSystemMessage(Message message) + { + if (message.Type == "Ping") + { + Message reply = message.CreateReplyMessage(); + reply.Type = "Ping"; + return reply; + } + else if (message.Type == "DeleteUserData") + { + } + else if (message.Type == "BotAddedToConversation") + { + + } + else if (message.Type == "BotRemovedFromConversation") + { + + } + else if (message.Type == "UserAddedToConversation") + { + return message.CreateReplyMessage($"Hi there!"); + } + else if (message.Type == "UserRemovedFromConversation") + { + return message.CreateReplyMessage($"Goodbye!"); + } + else if (message.Type == "EndOfConversation") + { + } + + return null; + } + } +} \ No newline at end of file diff --git a/ExcelBot/Dialogs/CellsDialog.cs b/ExcelBot/Dialogs/CellsDialog.cs new file mode 100644 index 0000000..bf1a8e3 --- /dev/null +++ b/ExcelBot/Dialogs/CellsDialog.cs @@ -0,0 +1,221 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Threading.Tasks; + +using Microsoft.Bot.Builder.Dialogs; +using Microsoft.Bot.Builder.Luis.Models; + +using ExcelBot.Helpers; +using ExcelBot.Workers; +using ExcelBot.Model; + +namespace ExcelBot.Dialogs +{ + public partial class ExcelBotDialog : LuisDialog + { + #region Properties + internal object Value { get; set; } + #endregion + + #region Intents + #region - Get Cell Values + [LuisIntent("getCellValue")] + public async Task GetCellValue(IDialogContext context, LuisResult result) + { + // Telemetry + TelemetryHelper.TrackDialog(context, result, "Cells", "GetCellValue"); + + var cellAddress = result.Entities[0].Entity.ToUpper(); + context.UserData.SetValue("CellAddress", cellAddress); + + context.UserData.SetValue("Type", ObjectType.Cell); + context.UserData.SetValue("Name", cellAddress); + + string workbookId = String.Empty; + context.UserData.TryGetValue("WorkbookId", out workbookId); + + if (!(String.IsNullOrEmpty(workbookId))) + { + await CellWorker.DoGetCellValue(context); + context.Wait(MessageReceived); + } + else + { + context.Call(new ConfirmOpenWorkbookDialog(), AfterConfirm_GetCellValue); + } + } + public async Task AfterConfirm_GetCellValue(IDialogContext context, IAwaitable result) + { + if (await result) + { + await CellWorker.DoGetCellValue(context); + } + context.Wait(MessageReceived); + } + + [LuisIntent("getActiveCellValue")] + public async Task GetActiveCellValue(IDialogContext context, LuisResult result) + { + // Telemetry + TelemetryHelper.TrackDialog(context, result, "Cells", "GetActiveCellValue"); + + string workbookId = String.Empty; + context.UserData.TryGetValue("WorkbookId", out workbookId); + + if (!(String.IsNullOrEmpty(workbookId))) + { + await NamedItemsWorker.DoGetNamedItemValue(context); + context.Wait(MessageReceived); + } + else + { + context.Call(new ConfirmOpenWorkbookDialog(), AfterConfirm_GetActiveCellValue); + } + } + public async Task AfterConfirm_GetActiveCellValue(IDialogContext context, IAwaitable result) + { + if (await result) + { + await NamedItemsWorker.DoGetNamedItemValue(context); + } + context.Wait(MessageReceived); + } + + #endregion + #region - Set Cell Value + [LuisIntent("setCellNumberValue")] + public async Task SetCellNumberValue(IDialogContext context, LuisResult result) + { + // Telemetry + TelemetryHelper.TrackDialog(context, result, "Cells", "SetCellNumberValue"); + + var cellAddress = LuisHelper.GetCellEntity(result.Entities); + context.UserData.SetValue("CellAddress", cellAddress); + + context.UserData.SetValue("Type", ObjectType.Cell); + context.UserData.SetValue("Name", cellAddress); + + Value = LuisHelper.GetValue(result); + + string workbookId = String.Empty; + context.UserData.TryGetValue("WorkbookId", out workbookId); + + if (!(String.IsNullOrEmpty(workbookId))) + { + if (cellAddress != null) + { + await CellWorker.DoSetCellValue(context, Value); + } + else + { + await context.PostAsync($"You need to provide the address of a cell to set the value"); + } + context.Wait(MessageReceived); + } + else + { + context.Call(new ConfirmOpenWorkbookDialog(), AfterConfirm_SetCellNumberValue); + } + } + + public async Task AfterConfirm_SetCellNumberValue(IDialogContext context, IAwaitable result) + { + if (await result) + { + await CellWorker.DoSetCellValue(context, Value); + } + context.Wait(MessageReceived); + } + + [LuisIntent("setCellStringValue")] + public async Task SetCellStringValue(IDialogContext context, LuisResult result) + { + // Telemetry + TelemetryHelper.TrackDialog(context, result, "Cells", "SetCellStringValue"); + + var cellAddress = LuisHelper.GetCellEntity(result.Entities); + context.UserData.SetValue("CellAddress", cellAddress); + + context.UserData.SetValue("Type", ObjectType.Cell); + context.UserData.SetValue("Name", cellAddress); + + Value = LuisHelper.GetValue(result); + + string workbookId = String.Empty; + context.UserData.TryGetValue("WorkbookId", out workbookId); + + if (!(String.IsNullOrEmpty(workbookId))) + { + if (cellAddress != null) + { + await CellWorker.DoSetCellValue(context, Value); + } + else + { + await context.PostAsync($"You need to provide the name of a cell to set the value"); + } + context.Wait(MessageReceived); + } + else + { + context.Call(new ConfirmOpenWorkbookDialog(), AfterConfirm_SetCellStringValue); + } + } + + public async Task AfterConfirm_SetCellStringValue(IDialogContext context, IAwaitable result) + { + if (await result) + { + await CellWorker.DoSetCellValue(context, Value); + } + context.Wait(MessageReceived); + } + + [LuisIntent("setActiveCellValue")] + public async Task SetActiveCellValue(IDialogContext context, LuisResult result) + { + // Telemetry + TelemetryHelper.TrackDialog(context, result, "Cells", "SetActiveCellValue"); + + ObjectType? type = null; + context.UserData.TryGetValue("Type", out type); + + var name = string.Empty; + context.UserData.TryGetValue("Name", out name); + + Value = LuisHelper.GetValue(result); + + string workbookId = String.Empty; + context.UserData.TryGetValue("WorkbookId", out workbookId); + + if (!(String.IsNullOrEmpty(workbookId))) + { + await NamedItemsWorker.DoSetNamedItemValue(context, Value); + context.Wait(MessageReceived); + } + else + { + context.Call(new ConfirmOpenWorkbookDialog(), AfterConfirm_SetActiveCellValue); + } + } + + public async Task AfterConfirm_SetActiveCellValue(IDialogContext context, IAwaitable result) + { + if (await result) + { + await NamedItemsWorker.DoSetNamedItemValue(context, Value); + } + context.Wait(MessageReceived); + } + + #endregion + #endregion + } +} \ No newline at end of file diff --git a/ExcelBot/Dialogs/ChartsDialog.cs b/ExcelBot/Dialogs/ChartsDialog.cs new file mode 100644 index 0000000..e251fa9 --- /dev/null +++ b/ExcelBot/Dialogs/ChartsDialog.cs @@ -0,0 +1,108 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Threading.Tasks; +using System.Text; + +using Microsoft.Bot.Builder.Dialogs; +using Microsoft.Bot.Builder.Luis.Models; + +using ExcelBot.Helpers; +using ExcelBot.Workers; + +namespace ExcelBot.Dialogs +{ + public partial class ExcelBotDialog : LuisDialog + { + #region Properties + #endregion + + #region Intents + #region - List Charts + [LuisIntent("listCharts")] + public async Task ListCharts(IDialogContext context, LuisResult result) + { + // Telemetry + TelemetryHelper.TrackDialog(context, result, "Charts", "ListCharts"); + + string workbookId = String.Empty; + context.UserData.TryGetValue("WorkbookId", out workbookId); + + if ((workbookId != null) && (workbookId != String.Empty)) + { + await ChartsWorker.DoListCharts(context); + context.Wait(MessageReceived); + } + else + { + context.Call(new ConfirmOpenWorkbookDialog(), AfterConfirm_ListCharts); + } + } + public async Task AfterConfirm_ListCharts(IDialogContext context, IAwaitable result) + { + if (await result) + { + await ChartsWorker.DoListCharts(context); + } + context.Wait(MessageReceived); + } + + #endregion + #region - Get Chart Image + [LuisIntent("getChartImage")] + public async Task GetChartImage(IDialogContext context, LuisResult result) + { + // Telemetry + TelemetryHelper.TrackDialog(context, result, "Charts", "GetChartImage"); + + var name = LuisHelper.GetChartEntity(result.Entities); + context.UserData.SetValue("ChartName", name); + + string workbookId = String.Empty; + context.UserData.TryGetValue("WorkbookId", out workbookId); + + if ((workbookId != null) && (workbookId != String.Empty)) + { + if (result.Entities.Count > 0) + { + string worksheetId = String.Empty; + context.UserData.TryGetValue("WorksheetId", out worksheetId); + + if ((worksheetId != null) && (worksheetId != String.Empty)) + { + await ChartsWorker.DoGetChartImage(context); + } + else + { + await context.PostAsync($"You need to provide the name of a worksheet to get a chart"); + } + } + else + { + await context.PostAsync($"You need to provide the name of the chart"); + } + context.Wait(MessageReceived); + } + else + { + context.Call(new ConfirmOpenWorkbookDialog(), AfterConfirm_GetChartImage); + } + } + public async Task AfterConfirm_GetChartImage(IDialogContext context, IAwaitable result) + { + if (await result) + { + await ChartsWorker.DoGetChartImage(context); + } + context.Wait(MessageReceived); + } + #endregion + #endregion + } +} \ No newline at end of file diff --git a/ExcelBot/Dialogs/ExcelBotDialog.cs b/ExcelBot/Dialogs/ExcelBotDialog.cs new file mode 100644 index 0000000..15450a0 --- /dev/null +++ b/ExcelBot/Dialogs/ExcelBotDialog.cs @@ -0,0 +1,108 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Threading.Tasks; +using System.Text; + +using Microsoft.Bot.Builder.Dialogs; +using Microsoft.Bot.Builder.Luis; +using Microsoft.Bot.Builder.Luis.Models; + +using ExcelBot.Helpers; + +namespace ExcelBot.Dialogs +{ + [LuisModel("LUIS MODEL ID", "LUIS SUBSCRIPTION KEY")] + [Serializable] + public partial class ExcelBotDialog : LuisDialog + { + #region Constructor + public ExcelBotDialog(ILuisService service = null) + : base(service) + { + } + #endregion + + #region Intents + [LuisIntent("")] + public async Task None(IDialogContext context, LuisResult result) + { + // Telemetry + TelemetryHelper.TrackDialog(context, result, "Bot", "None"); + + // Respond + await context.PostAsync(@"Sorry, I don't understand what you want to do. Type ""help"" to see a list of things I can do."); + context.Wait(MessageReceived); + } + + + [LuisIntent("sayHello")] + public async Task SayHello(IDialogContext context, LuisResult result) + { + try + { + // Telemetry + TelemetryHelper.TrackDialog(context, result, "Bot", "SayHello"); + + // Did the bot already greet the user? + bool saidHello = false; + context.PerUserInConversationData.TryGetValue("SaidHello", out saidHello); + + // Get the user data + var user = await ServicesHelper.UserService.GetUserAsync(); + await ServicesHelper.LogUserServiceResponse(context); + + // Respond + if (saidHello) + { + await context.PostAsync($"Hi again, {user.GivenName}!"); + } + else + { + await context.PostAsync($"Hi, {user.GivenName}!"); + } + + // Record that the bot said hello + context.PerUserInConversationData.SetValue("SaidHello", true); + } + catch (Exception ex) + { + await context.PostAsync($"Sorry, something went wrong trying to get information about you ({ex.Message})"); + } + context.Wait(MessageReceived); + } + + [LuisIntent("showHelp")] + public async Task ShowHelp(IDialogContext context, LuisResult result) + { + // Telemetry + TelemetryHelper.TrackDialog(context, result, "Bot", "ShowHelp"); + + // Respond + await context.PostAsync($@"Here is a list of things I can do for you: +* Open a workbook on your OneDrive for Business. For example, type ""look at sales 2016"" if you want to work with ""Sales 2016.xlsx"" in the root folder of your OneDrive for Business +* List worksheets in the workbook and select a worksheet. For example, ""which worksheets are in the workbook?"", ""select worksheet"" or ""select Sheet3"" +* Get and set the value of a cell. For example, type ""what is the value of A1?"" or ""change B57 to 5"" +* List names defined in the workbook. For example, type ""Which names are in the workbook?"" +* Get and set the value of a named item, for example, type ""show me TotalSales"" or ""set cost to 100"" +* List the tables in the workbook. For example, type ""Show me the tables"" +* Show the rows in a table. For example, type ""Show customers"" +* Look up a row in a table. For example, type ""Lookup Contoso in customers"" or ""lookup Contoso"" +* Change the value of a cell in a table row. For example, first type ""lookup contoso in customers"", then type ""change segment to enterprise"" +* List the charts in the workbook. For example, type ""Which charts are in the workbook?"" +* Get the image of a chart. For example, type ""Show me Chart 1"""); + + await context.PostAsync($@"Remember I'm just a bot. There are many things I still need to learn, so please tell me what you want me to get better at."); + + context.Wait(MessageReceived); + } + + #endregion + } +} \ No newline at end of file diff --git a/ExcelBot/Dialogs/NamedItemsDialog.cs b/ExcelBot/Dialogs/NamedItemsDialog.cs new file mode 100644 index 0000000..0cebf2b --- /dev/null +++ b/ExcelBot/Dialogs/NamedItemsDialog.cs @@ -0,0 +1,157 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Threading.Tasks; + +using Microsoft.Bot.Builder.Dialogs; +using Microsoft.Bot.Builder.Luis.Models; + +using ExcelBot.Helpers; +using ExcelBot.Workers; +using ExcelBot.Model; + +namespace ExcelBot.Dialogs +{ + public partial class ExcelBotDialog : LuisDialog + { + #region Properties + #endregion + + #region Intents + #region - List Named Items + [LuisIntent("listNamedItems")] + public async Task ListNamedItems(IDialogContext context, LuisResult result) + { + // Telemetry + TelemetryHelper.TrackDialog(context, result, "NamedItems", "ListNamedItems"); + + string workbookId = String.Empty; + context.UserData.TryGetValue("WorkbookId", out workbookId); + + if (!(String.IsNullOrEmpty(workbookId))) + { + await NamedItemsWorker.DoListNamedItems(context); + context.Wait(MessageReceived); + } + else + { + context.Call(new ConfirmOpenWorkbookDialog(), AfterConfirm_ListNamedItems); + } + } + public async Task AfterConfirm_ListNamedItems(IDialogContext context, IAwaitable result) + { + if (await result) + { + await NamedItemsWorker.DoListNamedItems(context); + } + context.Wait(MessageReceived); + } + + #endregion + #region - Get Value of Named Item + [LuisIntent("getNamedItemValue")] + public async Task GetNamedItemValue(IDialogContext context, LuisResult result) + { + // Telemetry + TelemetryHelper.TrackDialog(context, result, "NamedItems", "GetNamedItemValue"); + + var name = LuisHelper.GetNameEntity(result.Entities); + + if (!(String.IsNullOrEmpty(name))) + { + context.UserData.SetValue("Name", name); + context.UserData.SetValue("Type", ObjectType.NamedItem); + + string workbookId = String.Empty; + context.UserData.TryGetValue("WorkbookId", out workbookId); + + if (!(String.IsNullOrEmpty(workbookId))) + { + await NamedItemsWorker.DoGetNamedItemValue(context); + context.Wait(MessageReceived); + } + else + { + context.Call(new ConfirmOpenWorkbookDialog(), AfterConfirm_GetNamedItemValue); + } + } + else + { + await context.PostAsync($"You need to provide a name to get the value"); + context.Wait(MessageReceived); + } + } + public async Task AfterConfirm_GetNamedItemValue(IDialogContext context, IAwaitable result) + { + if (await result) + { + await NamedItemsWorker.DoGetNamedItemValue(context); + } + context.Wait(MessageReceived); + } + #endregion + #region - Set Value of Named Item + + [LuisIntent("setNamedItemValue")] + public async Task SetNamedItemValue(IDialogContext context, LuisResult result) + { + // Telemetry + TelemetryHelper.TrackDialog(context, result, "NamedItems", "SetNamedItemValue"); + + ObjectType type; + if (!(context.UserData.TryGetValue("Type", out type))) + { + type = ObjectType.NamedItem; + context.UserData.SetValue("Type", type); + } + + var name = LuisHelper.GetNameEntity(result.Entities); + if (name != null) + { + context.UserData.SetValue("Name", name); + } + + Value = LuisHelper.GetValue(result); + + string workbookId = String.Empty; + context.UserData.TryGetValue("WorkbookId", out workbookId); + + if (!(String.IsNullOrEmpty(name))) + { + string worksheetId = String.Empty; + context.UserData.TryGetValue("WorksheetId", out worksheetId); + + if (name != null) + { + await NamedItemsWorker.DoSetNamedItemValue(context, Value); + } + else + { + await context.PostAsync($"You need to provide a name to set the value"); + } + context.Wait(MessageReceived); + } + else + { + context.Call(new ConfirmOpenWorkbookDialog(), AfterConfirm_SetNamedItem); + } + } + + public async Task AfterConfirm_SetNamedItem(IDialogContext context, IAwaitable result) + { + if (await result) + { + await NamedItemsWorker.DoSetNamedItemValue(context, Value); + } + context.Wait(MessageReceived); + } + #endregion + #endregion + } +} \ No newline at end of file diff --git a/ExcelBot/Dialogs/OpenWorkbookDialog.cs b/ExcelBot/Dialogs/OpenWorkbookDialog.cs new file mode 100644 index 0000000..8f30717 --- /dev/null +++ b/ExcelBot/Dialogs/OpenWorkbookDialog.cs @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Web; + +using Microsoft.Bot.Builder.Dialogs; +using Microsoft.Bot.Builder.FormFlow; + +using ExcelBot.Forms; +using ExcelBot.Helpers; +using ExcelBot.Workers; + +namespace ExcelBot.Dialogs +{ + [Serializable] + public class ConfirmOpenWorkbookDialog : IDialog + { +#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously + public async Task StartAsync(IDialogContext context) +#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously + { + PromptDialog.Confirm(context, AfterConfirming_OpenWorkbook, $"I don't have a workbook open. Do you want me to open a workbook?"); + } + + private async Task AfterConfirming_OpenWorkbook(IDialogContext context, IAwaitable confirmation) + { + if (await confirmation) + { + // Call the OpenWorkbook Form + context.Call( + new FormDialog(new OpenWorkbookForm(), OpenWorkbookForm.BuildForm, FormOptions.PromptInStart), + OpenWorkbook_FormComplete); + } + else + { + await context.PostAsync("Okay! I will just sit tight until you tell me which workbook we should work with"); + context.Done(false); + } + } + + private async Task OpenWorkbook_FormComplete(IDialogContext context, IAwaitable result) + { + OpenWorkbookForm form = null; + try + { + form = await result; + } + catch + { + } + + if (form != null) + { + await WorkbookWorker.DoOpenWorkbookAsync(context, form.WorkbookName); + context.Done(true); + } + else + { + await context.PostAsync("Okay! I will just sit tight until you tell me which workbook we should work with"); + context.Done(false); + } + } + } +} \ No newline at end of file diff --git a/ExcelBot/Dialogs/TablesDialog.cs b/ExcelBot/Dialogs/TablesDialog.cs new file mode 100644 index 0000000..b1ea7c4 --- /dev/null +++ b/ExcelBot/Dialogs/TablesDialog.cs @@ -0,0 +1,100 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Threading.Tasks; + +using Microsoft.Bot.Builder.Dialogs; +using Microsoft.Bot.Builder.Luis.Models; + +using ExcelBot.Helpers; +using ExcelBot.Workers; +using ExcelBot.Model; + +namespace ExcelBot.Dialogs +{ + public partial class ExcelBotDialog : LuisDialog + { + #region Properties + #endregion + + #region Intents + #region - List Tables + [LuisIntent("listTables")] + public async Task ListTables(IDialogContext context, LuisResult result) + { + // Telemetry + TelemetryHelper.TrackDialog(context, result, "Tables", "ListTables"); + + string workbookId = String.Empty; + context.UserData.TryGetValue("WorkbookId", out workbookId); + + if (!(String.IsNullOrEmpty(workbookId))) + { + await TablesWorker.DoListTables(context); + context.Wait(MessageReceived); + } + else + { + context.Call(new ConfirmOpenWorkbookDialog(), AfterConfirm_ListTables); + } + } + public async Task AfterConfirm_ListTables(IDialogContext context, IAwaitable result) + { + if (await result) + { + await TablesWorker.DoListTables(context); + } + context.Wait(MessageReceived); + } + + #endregion + #region - Lookup Table Row + [LuisIntent("lookupTableRow")] + public async Task LookupTableRow(IDialogContext context, LuisResult result) + { + // Telemetry + TelemetryHelper.TrackDialog(context, result, "Tables", "LookupTableRow"); + + string workbookId = String.Empty; + context.UserData.TryGetValue("WorkbookId", out workbookId); + + var name = LuisHelper.GetNameEntity(result.Entities); + if (name != null) + { + context.UserData.SetValue("TableName", name); + + context.UserData.SetValue("Type", ObjectType.Table); + context.UserData.SetValue("Name", name); + } + + Value = (LuisHelper.GetValue(result))?.ToString(); + + if (!(String.IsNullOrEmpty(workbookId))) + { + await TablesWorker.DoLookupTableRow(context, (string)Value); + context.Wait(MessageReceived); + } + else + { + context.Call(new ConfirmOpenWorkbookDialog(), AfterConfirm_LookupTableRow); + } + } + public async Task AfterConfirm_LookupTableRow(IDialogContext context, IAwaitable result) + { + if (await result) + { + await TablesWorker.DoLookupTableRow(context, (string)Value); + } + context.Wait(MessageReceived); + } + + #endregion + #endregion + } +} \ No newline at end of file diff --git a/ExcelBot/Dialogs/WorkbooksDialog.cs b/ExcelBot/Dialogs/WorkbooksDialog.cs new file mode 100644 index 0000000..72fe84c --- /dev/null +++ b/ExcelBot/Dialogs/WorkbooksDialog.cs @@ -0,0 +1,99 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Threading.Tasks; +using System.Text; + +using Microsoft.Bot.Builder.Dialogs; +using Microsoft.Bot.Builder.Luis.Models; +using Microsoft.Bot.Builder.FormFlow; + +using ExcelBot.Helpers; +using ExcelBot.Forms; +using ExcelBot.Workers; + +namespace ExcelBot.Dialogs +{ + public partial class ExcelBotDialog : LuisDialog + { + #region Intents + [LuisIntent("openWorkbook")] +#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously + public async Task OpenWorkbook(IDialogContext context, LuisResult result) +#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously + { + // Telemetry + TelemetryHelper.TrackDialog(context, result, "Workbooks", "OpenWorkbook"); + + // Create the Open workbook form and extract the workbook name from the query + var form = new OpenWorkbookForm(); + form.WorkbookName = (string)(LuisHelper.GetValue(result)); + + // Call the OpenWorkbook Form + context.Call( + new FormDialog(form, OpenWorkbookForm.BuildForm, FormOptions.PromptInStart), + OpenWorkbookFormComplete); + } + + private async Task OpenWorkbookFormComplete(IDialogContext context, IAwaitable result) + { + OpenWorkbookForm form = null; + try + { + form = await result; + } + catch + { + await context.PostAsync("You canceled opening a workbook. No problem! I can move on to something else"); + return; + } + + if (form != null) + { + await WorkbookWorker.DoOpenWorkbookAsync(context, form.WorkbookName); + } + else + { + await context.PostAsync("Sorry, something went wrong (form is empty)"); + } + context.Wait(MessageReceived); + } + + [LuisIntent("getActiveWorkbook")] + public async Task GetActiveWorkbook(IDialogContext context, LuisResult result) + { + // Telemetry + TelemetryHelper.TrackDialog(context, result, "Workbooks", "GetActiveWorkbook"); + + string workbookId = String.Empty; + context.UserData.TryGetValue("WorkbookId", out workbookId); + + if ((workbookId != null) && (workbookId != String.Empty)) + { + await WorkbookWorker.DoGetActiveWorkbookAsync(context); + context.Wait(MessageReceived); + } + else + { + context.Call(new ConfirmOpenWorkbookDialog(), AfterConfirm_GetActiveWorkbook); + } + } + + public async Task AfterConfirm_GetActiveWorkbook(IDialogContext context, IAwaitable result) + { + if (await result) + { + await WorkbookWorker.DoGetActiveWorkbookAsync(context); + } + context.Wait(MessageReceived); + } + + #endregion + } +} \ No newline at end of file diff --git a/ExcelBot/Dialogs/WorksheetsDialog.cs b/ExcelBot/Dialogs/WorksheetsDialog.cs new file mode 100644 index 0000000..ac351fb --- /dev/null +++ b/ExcelBot/Dialogs/WorksheetsDialog.cs @@ -0,0 +1,156 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Threading.Tasks; +using System.Text; + +using Microsoft.Bot.Builder.Dialogs; +using Microsoft.Bot.Builder.Luis.Models; +using Microsoft.Bot.Builder.FormFlow; + +using ExcelBot.Helpers; +using ExcelBot.Forms; +using ExcelBot.Workers; + +namespace ExcelBot.Dialogs +{ + public partial class ExcelBotDialog : LuisDialog + { + #region Properties + internal string WorksheetName { get; set; } + #endregion + + #region Intents + #region - List Worksheets + [LuisIntent("listWorksheets")] + public async Task ListWorksheets(IDialogContext context, LuisResult result) + { + // Telemetry + TelemetryHelper.TrackDialog(context, result, "Worksheets", "ListWorksheets"); + + string workbookId = String.Empty; + context.UserData.TryGetValue("WorkbookId", out workbookId); + + if ((workbookId != null) && (workbookId != String.Empty)) + { + await WorksheetWorker.DoListWorksheetsAsync(context); + context.Wait(MessageReceived); + } + else + { + context.Call(new ConfirmOpenWorkbookDialog(), AfterConfirm_ListWorksheets); + } + } + public async Task AfterConfirm_ListWorksheets(IDialogContext context, IAwaitable result) + { + if (await result) + { + await WorksheetWorker.DoListWorksheetsAsync(context); + } + context.Wait(MessageReceived); + } + #endregion + + [LuisIntent("selectWorksheet")] + public async Task SelectWorksheet(IDialogContext context, LuisResult result) + { + // Telemetry + TelemetryHelper.TrackDialog(context, result, "Worksheets", "SelectWorksheet"); + + string workbookId = String.Empty; + context.UserData.TryGetValue("WorkbookId", out workbookId); + + WorksheetName = LuisHelper.GetNameEntity(result.Entities); + + if (!(String.IsNullOrEmpty(workbookId))) + { + if (!(String.IsNullOrEmpty(WorksheetName))) + { + await WorksheetWorker.DoSelectWorksheetAsync(context, WorksheetName); + context.Wait(MessageReceived); + } + else + { + // Call the SelectWorksheet Form + SelectWorksheetForm.Worksheets = await WorksheetWorker.GetWorksheetNamesAsync(context, workbookId); + + context.Call( + new FormDialog(new SelectWorksheetForm(), SelectWorksheetForm.BuildForm, FormOptions.PromptInStart), + SelectWorksheet_FormComplete); + } + } + else + { + context.Call(new ConfirmOpenWorkbookDialog(), AfterConfirm_SelectWorksheet); + } + } + public async Task AfterConfirm_SelectWorksheet(IDialogContext context, IAwaitable result) + { + if (await result) + { + await WorksheetWorker.DoSelectWorksheetAsync(context, WorksheetName); + } + context.Wait(MessageReceived); + } + + private async Task SelectWorksheet_FormComplete(IDialogContext context, IAwaitable result) + { + SelectWorksheetForm form = null; + try + { + form = await result; + } + catch + { + } + + if (form != null) + { + await WorksheetWorker.DoSelectWorksheetAsync(context, form.WorksheetName); + context.Done(true); + } + else + { + await context.PostAsync("Okay! I will just sit tight until you tell me what to do"); + context.Done(false); + } + } + + [LuisIntent("getActiveWorksheet")] + public async Task GetActiveWorksheet(IDialogContext context, LuisResult result) + { + // Telemetry + TelemetryHelper.TrackDialog(context, result, "Worksheets", "GetActiveWorksheet"); + + string workbookId = String.Empty; + context.UserData.TryGetValue("WorkbookId", out workbookId); + + if ((workbookId != null) && (workbookId != String.Empty)) + { + await WorksheetWorker.DoGetActiveWorksheetAsync(context); + context.Wait(MessageReceived); + } + else + { + context.Call(new ConfirmOpenWorkbookDialog(), AfterConfirm_GetActiveWorksheet); + } + } + + public async Task AfterConfirm_GetActiveWorksheet(IDialogContext context, IAwaitable result) + { + if (await result) + { + await WorksheetWorker.DoGetActiveWorksheetAsync(context); + } + context.Wait(MessageReceived); + } + + #endregion + } +} \ No newline at end of file diff --git a/ExcelBot/ExcelBot.csproj b/ExcelBot/ExcelBot.csproj new file mode 100644 index 0000000..bb10cd0 --- /dev/null +++ b/ExcelBot/ExcelBot.csproj @@ -0,0 +1,235 @@ + + + + + Debug + AnyCPU + + + 2.0 + {A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + ExcelBot + ExcelBot + v4.6 + true + + + + + + + + + + + true + full + false + bin\ + TRACE;DEBUG;PCL + prompt + 4 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + + + + ..\packages\Autofac.3.5.2\lib\net40\Autofac.dll + True + + + ..\packages\Microsoft.ApplicationInsights.Agent.Intercept.1.2.1\lib\net45\Microsoft.AI.Agent.Intercept.dll + True + + + ..\packages\Microsoft.ApplicationInsights.DependencyCollector.2.1.0-beta3\lib\net45\Microsoft.AI.DependencyCollector.dll + True + + + ..\packages\Microsoft.ApplicationInsights.PerfCounterCollector.2.1.0-beta3\lib\net45\Microsoft.AI.PerfCounterCollector.dll + True + + + ..\packages\Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.2.1.0-beta3\lib\net45\Microsoft.AI.ServerTelemetryChannel.dll + True + + + ..\packages\Microsoft.ApplicationInsights.Web.2.1.0-beta3\lib\net45\Microsoft.AI.Web.dll + True + + + ..\packages\Microsoft.ApplicationInsights.WindowsServer.2.1.0-beta3\lib\net45\Microsoft.AI.WindowsServer.dll + True + + + ..\packages\Microsoft.ApplicationInsights.2.1.0-beta3\lib\net46\Microsoft.ApplicationInsights.dll + True + + + ..\packages\Microsoft.Bot.Builder.1.2.0\lib\net46\Microsoft.Bot.Builder.dll + True + + + ..\packages\Microsoft.Bot.Connector.1.1.0.0\lib\net45\Microsoft.Bot.Connector.dll + True + + + + ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.24.304111323\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll + True + + + ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.24.304111323\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll + True + + + ..\packages\Microsoft.Rest.ClientRuntime.1.8.2\lib\net45\Microsoft.Rest.ClientRuntime.dll + True + + + ..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.1\lib\net40\Microsoft.WindowsAzure.Configuration.dll + True + + + ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll + True + + + + + + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll + True + + + + + + + + + + + + + ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll + True + + + ..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Global.asax + + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + + + + Web.config + + + Web.config + + + + + {0bda3891-afd6-42f7-9005-3a1df72766ec} + ExcelRESTService.Portable + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + true + + + + + + + + + True + True + 3978 + / + http://localhost:3978/ + False + False + + + False + + + + + + \ No newline at end of file diff --git a/ExcelBot/ExcelBot.csproj.user b/ExcelBot/ExcelBot.csproj.user new file mode 100644 index 0000000..6d35160 --- /dev/null +++ b/ExcelBot/ExcelBot.csproj.user @@ -0,0 +1,32 @@ + + + + true + excelbot - Web Deploy + ProjectFiles + + + + + + default.htm + NoStartPage + True + False + False + False + + + + + + + + + True + True + + + + + \ No newline at end of file diff --git a/ExcelBot/Forms/OpenWorkbookForm.cs b/ExcelBot/Forms/OpenWorkbookForm.cs new file mode 100644 index 0000000..f35a77b --- /dev/null +++ b/ExcelBot/Forms/OpenWorkbookForm.cs @@ -0,0 +1,28 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +using Microsoft.Bot.Builder.FormFlow; + +namespace ExcelBot.Forms +{ + [Serializable] + public class OpenWorkbookForm + { + [Prompt("What is the name of the workbook you want to work with?")] + public string WorkbookName; + + public static IForm BuildForm() + { + return new FormBuilder() + .AddRemainingFields() + .Build(); + } + }; +} \ No newline at end of file diff --git a/ExcelBot/Forms/SelectWorksheetForm.cs b/ExcelBot/Forms/SelectWorksheetForm.cs new file mode 100644 index 0000000..24a3507 --- /dev/null +++ b/ExcelBot/Forms/SelectWorksheetForm.cs @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +using Microsoft.Bot.Builder.FormFlow; +using Microsoft.Bot.Builder.FormFlow.Advanced; + +namespace ExcelBot.Forms +{ + [Serializable] + public class SelectWorksheetForm + { + public static string[] Worksheets; + public string WorksheetName; + + public static IForm BuildForm() + { + return new FormBuilder() + .Field(new FieldReflector(nameof(WorksheetName)) + .SetType(null) + .SetActive((state) => true) +#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously + .SetDefine(async (state, field) => + { + foreach (var worksheet in Worksheets) + { + field + .AddDescription(worksheet, worksheet) + .AddTerms(worksheet, worksheet, worksheet.ToLower()); + } + field + .SetPrompt(new PromptAttribute("Which worksheet do you want to work with? {||}") { ChoiceFormat = @"{0}. {1}"}); + return true; + }) +#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously + ) + .Build(); + } + }; +} \ No newline at end of file diff --git a/ExcelBot/Global.asax b/ExcelBot/Global.asax new file mode 100644 index 0000000..bb6e1b3 --- /dev/null +++ b/ExcelBot/Global.asax @@ -0,0 +1 @@ +<%@ Application Codebehind="Global.asax.cs" Inherits="ExcelBot.WebApiApplication" Language="C#" %> diff --git a/ExcelBot/Global.asax.cs b/ExcelBot/Global.asax.cs new file mode 100644 index 0000000..98b4465 --- /dev/null +++ b/ExcelBot/Global.asax.cs @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Http; +using System.Web.Routing; + +namespace ExcelBot +{ + public class WebApiApplication : System.Web.HttpApplication + { + protected void Application_Start() + { + GlobalConfiguration.Configure(WebApiConfig.Register); + } + } +} diff --git a/ExcelBot/Helpers/AuthHelper.cs b/ExcelBot/Helpers/AuthHelper.cs new file mode 100644 index 0000000..c74b450 --- /dev/null +++ b/ExcelBot/Helpers/AuthHelper.cs @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Net.Http; + +using Microsoft.IdentityModel.Clients.ActiveDirectory; + +using Microsoft.Bot.Connector; + +using Newtonsoft.Json.Linq; + +namespace ExcelBot.Helpers +{ + public static class AuthHelper + { + #region Methods + public static async Task SaveAuthResult(HttpRequestMessage request, string channelId, string userId, string authResult) + { + var userData = await BotDataHelper.GetUserData(channelId, userId); + userData["AuthResult"] = authResult; + await BotDataHelper.SaveUserData(channelId, userId, userData); + } + + public async static Task GetAccessToken(Message message) + { + if (message.BotUserData != null) + { + var userData = ((JObject)(message.BotUserData)).ToObject>(); + AuthenticationResult ar = AuthenticationResult.Deserialize(userData["AuthResult"]); + AuthenticationContext ac = new AuthenticationContext("https://login.windows.net/common/oauth2/authorize/"); + if (DateTimeOffset.Compare(DateTimeOffset.Now, ar.ExpiresOn) >= 0) + { + // Refresh access token + ar = await ac.AcquireTokenByRefreshTokenAsync(ar.RefreshToken, new ClientCredential(Constants.ADClientId, Constants.ADClientSecret)); + message.SetBotUserData("AuthResult", ar.Serialize()); + } + return ar.AccessToken; + } + else + { + throw new Exception("UserData not found"); + } + } + + public async static Task GetAccessToken(string channelId, string userId) + { + var userData = await BotDataHelper.GetUserData(channelId, userId); + if (!userData.ContainsKey("AuthResult")) + { + throw new Exception("AuthResult not found"); + } + + AuthenticationResult ar = AuthenticationResult.Deserialize((string)(userData["AuthResult"])); + AuthenticationContext ac = new AuthenticationContext("https://login.windows.net/common/oauth2/authorize/"); + + if (DateTimeOffset.Compare(DateTimeOffset.Now, ar.ExpiresOn) >= 0) + { + // Refresh access token + ar = await ac.AcquireTokenByRefreshTokenAsync(ar.RefreshToken, new ClientCredential(Constants.ADClientId, Constants.ADClientSecret)); + userData["AuthResult"] = ar.Serialize(); + await BotDataHelper.SaveUserData(channelId, userId, userData); + } + return ar.AccessToken; + } + #endregion + } +} \ No newline at end of file diff --git a/ExcelBot/Helpers/BotDataHelper.cs b/ExcelBot/Helpers/BotDataHelper.cs new file mode 100644 index 0000000..e6d696b --- /dev/null +++ b/ExcelBot/Helpers/BotDataHelper.cs @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Net.Http; + +using Microsoft.Bot.Connector; + +using Newtonsoft.Json.Linq; + +namespace ExcelBot.Helpers +{ + public static class BotDataHelper + { + #region Methods + // UserData + public static async Task> GetUserData(string channelId, string userId) + { + var client = GetConnectorClient(channelId); + + var botData = await client.Bots.GetUserDataAsync(Constants.botId, userId); + + return (botData.Data != null) ? + ((JObject)(botData.Data)).ToObject>() : + new Dictionary(); + } + + public static async Task SaveUserData(string channelId, string userId, Dictionary userData) + { + var client = GetConnectorClient(channelId); + + var botData = await client.Bots.GetUserDataAsync(Constants.botId, userId); + botData.Data = userData; + + await client.Bots.SetUserDataAsync(Constants.botId, userId, botData); + } + + // ConversationData + public static async Task> GetConversationData(string channelId, string conversationId) + { + var client = GetConnectorClient(channelId); + + var botData = await client.Bots.GetConversationDataAsync(Constants.botId, conversationId); + + return (botData.Data != null) ? + ((JObject)(botData.Data)).ToObject>() : + new Dictionary(); + } + #endregion + + #region Helpers + private static ConnectorClient GetConnectorClient(string channelId) + { + return (channelId == "emulator") ? + new ConnectorClient(new Uri("http://localhost:9000"), new ConnectorClientCredentials()) : + new ConnectorClient(); + } + #endregion + } +} \ No newline at end of file diff --git a/ExcelBot/Helpers/ExcelHelper.cs b/ExcelBot/Helpers/ExcelHelper.cs new file mode 100644 index 0000000..8ca8b27 --- /dev/null +++ b/ExcelBot/Helpers/ExcelHelper.cs @@ -0,0 +1,183 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web; + +using Microsoft.Bot.Builder.Dialogs; + +namespace ExcelBot.Helpers +{ + public static class ExcelHelper + { + #region Workbook Link + public static string GetWorkbookLinkMarkdown(IDialogContext context) + { + string workbookWebUrl = String.Empty; + if (context.ConversationData.TryGetValue("WorkbookWebUrl", out workbookWebUrl)) + { + var workbookName = context.ConversationData.Get("WorkbookName"); + return $"[{workbookName}]({workbookWebUrl})"; + } + else + { + return "NOT IMPLEMENTED"; + } + } + #endregion + + #region Session + public static string GetSessionIdForRead(IDialogContext context) + { + string sessionId = String.Empty; + if (TryGetSession(context, out sessionId)) + { + return sessionId; + } + else + { + return string.Empty; + } + } + + public static string GetSessionIdForRead(Dictionary conversationData, string workbookId) + { + string sessionId = String.Empty; + if (TryGetSession(conversationData, workbookId, out sessionId)) + { + return sessionId; + } + else + { + return string.Empty; + } + } + + public static async Task GetSessionIdForUpdateAsync(IDialogContext context) + { + string sessionId = String.Empty; + if (TryGetSession(context, out sessionId)) + { + return sessionId; + } + else + { + return await CreateSession(context); + } + } + + private static async Task CreateSession(IDialogContext context) + { + var workbookId = context.UserData.Get("WorkbookId"); + var sessionId = (await ServicesHelper.ExcelService.CreateSessionAsync(workbookId)).Id; + await ServicesHelper.LogExcelServiceResponse(context); + + context.ConversationData.SetValue("SessionId", sessionId); + context.ConversationData.SetValue("SessionWorkbookId", workbookId); + context.ConversationData.SetValue("SessionExpiresOn", DateTime.Now.AddMinutes(5)); + return sessionId; + } + + private static bool TryGetSession(IDialogContext context, out string sessionId) + { + sessionId = String.Empty; + if (context.ConversationData.TryGetValue("SessionId", out sessionId)) + { + // Check that the session is for the right workbook + var workbookId = context.UserData.Get("WorkbookId"); + + var sessionWorkbookId = ""; + if ((context.ConversationData.TryGetValue("SessionWorkbookId", out sessionWorkbookId)) && (workbookId != sessionWorkbookId)) + { + // Session is with another workbook + sessionId = ""; + return false; + } + + // Check that the session hasn't expired + var sessionExpiresOn = DateTime.MinValue; + if ((context.ConversationData.TryGetValue("SessionExpiresOn", out sessionExpiresOn)) && (DateTime.Compare(DateTime.Now, sessionExpiresOn) < 0)) + { + // Session is still valid + context.ConversationData.SetValue("SessionExpiresOn", DateTime.Now.AddMinutes(5)); + return true; + } + } + // Session was not found or has expired + sessionId = ""; + return false; + } + + private static bool TryGetSession(Dictionary conversationData, string workbookId, out string sessionId) + { + object sessionIdObj = string.Empty; + if (conversationData.TryGetValue("SessionId", out sessionIdObj)) + { + // Check that the session is for the right workbook + object sessionWorkbookIdObj = ""; + if ((conversationData.TryGetValue("SessionWorkbookId", out sessionWorkbookIdObj)) && (workbookId != (string)sessionWorkbookIdObj)) + { + // Session is with another workbook + sessionId = ""; + return false; + } + + // Check that the session hasn't expired + object sessionExpiresOnObj = DateTime.MinValue; + if ((conversationData.TryGetValue("SessionExpiresOn", out sessionExpiresOnObj)) && (DateTime.Compare(DateTime.Now, (DateTime)sessionExpiresOnObj) < 0)) + { + sessionId = (string)sessionIdObj; + return true; + } + } + // Session was not found or has expired + sessionId = ""; + return false; + } + #endregion + + #region Helpers + public static string GetWorksheetName(string address) + { + var pos = address.IndexOf("!"); + if (pos >= 0) + { + return address.Substring(0, pos).Replace("'","").Replace(@"""",""); + } + else + { + return ""; + } + } + + public static string GetCellAddress(string address) + { + var pos = address.IndexOf("!"); + if (pos >= 0) + { + return address.Substring(pos+1); + } + else + { + return address; + } + } + + + private static string[] columns = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" }; + + public static string GetRangeAddress(int column, int row, int width, int height) + { + return $"{columns[column]}{row + 1}:{columns[column + width - 1]}{row + height}"; + } + + #endregion + } + +} \ No newline at end of file diff --git a/ExcelBot/Helpers/IndexOf.cs b/ExcelBot/Helpers/IndexOf.cs new file mode 100644 index 0000000..c6c3729 --- /dev/null +++ b/ExcelBot/Helpers/IndexOf.cs @@ -0,0 +1,21 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace ExcelBot.Helpers +{ + public static class Extensions + { + public static int IndexOf(this IEnumerable list, Predicate condition) + { + int i = -1; + return list.Any(x => { i++; return condition(x); }) ? i : -1; + } + } +} \ No newline at end of file diff --git a/ExcelBot/Helpers/LuisHelper.cs b/ExcelBot/Helpers/LuisHelper.cs new file mode 100644 index 0000000..f1a2de0 --- /dev/null +++ b/ExcelBot/Helpers/LuisHelper.cs @@ -0,0 +1,111 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; + +using Microsoft.Bot.Builder.Luis.Models; + +namespace ExcelBot.Helpers +{ + public static class LuisHelper + { + public static string GetCellEntity(IList entities) + { + var entity = entities.FirstOrDefault((e) => e.Type == "Cell"); + return (entity != null) ? entity.Entity.ToUpper() : null; + } + + public static string GetNameEntity(IList entities) + { + var index = entities.IndexOf((e) => e.Type == "Name"); + if (index >= 0) + { + var name = new StringBuilder(); + var separator = ""; + while ((index < entities.Count) && (entities[index].Type == "Name")) + { + name.Append($"{separator}{entities[index].Entity}"); + separator = " "; + ++index; + } + return name.ToString().Replace(" _ ","_").Replace(" - ", "-"); + } + else + { + return null; + } + } + + public static string GetChartEntity(IList entities) + { + var namesAndNumbers = entities.Where((e) => ((e.Type == "Name") || (e.Type == "builtin.number"))); + if (namesAndNumbers != null) + { + var name = new StringBuilder(); + var separator = ""; + foreach (var entitiy in namesAndNumbers) + { + name.Append($"{separator}{entitiy.Entity}"); + separator = " "; + } + return name.ToString(); + } + else + { + return null; + } + } + + public static object GetValue(LuisResult result) + { + if (result.Entities.Count == 0) + { + // There is no entities in the query + return null; + } + + // Check for a string value + var first = result.Entities.FirstOrDefault(er => ((er.Type == "builtin.number") || (er.Type == "Text") || (er.Type == "Workbook"))); + if (first != null) + { + var startIndex = (int)(result.Entities.Where(er => ((er.Type == "builtin.number") || (er.Type == "Text") || (er.Type == "Workbook"))).Min(er => er.StartIndex)); + var endIndex = (int)(result.Entities.Where(er => ((er.Type == "builtin.number") || (er.Type == "Text") || (er.Type == "Workbook"))).Max(er => er.EndIndex)); + return result.Query.Substring(startIndex, endIndex - startIndex + 1); + } + + // Check for a number value + var numberEntity = result.Entities.FirstOrDefault(er => er.Type == "builtin.number"); + if (numberEntity != null) + { + // There is a number entity in the query + return Double.Parse(numberEntity.Entity.Replace(" ", "")); + } + + // No value was found + return null; + } + + public static string GetFilenameEntity(IList entities) + { + var sb = new StringBuilder(); + var separator = ""; + foreach (var entity in entities) + { + if (entity.Entity != "xlsx") + { + sb.Append(separator); + sb.Append(entity.Entity); + separator = " "; + } + } + var filename = sb.ToString().Replace(" _ ", "_").Replace(" - ", "-"); + return filename; + } + } +} \ No newline at end of file diff --git a/ExcelBot/Helpers/RequestHelper.cs b/ExcelBot/Helpers/RequestHelper.cs new file mode 100644 index 0000000..001c272 --- /dev/null +++ b/ExcelBot/Helpers/RequestHelper.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Microsoft.ApplicationInsights; + +using Microsoft.Bot.Connector; + +using ExcelBot.Dialogs; +using ExcelBot.Model; +using System.Net.Http; +using Newtonsoft.Json.Linq; + +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +namespace ExcelBot.Helpers +{ + public static class RequestHelper + { + #region Properties + public static Uri RequestUri { get; set; } + #endregion + + #region Methods + #endregion + } +} \ No newline at end of file diff --git a/ExcelBot/Helpers/ServicesHelper.cs b/ExcelBot/Helpers/ServicesHelper.cs new file mode 100644 index 0000000..9730322 --- /dev/null +++ b/ExcelBot/Helpers/ServicesHelper.cs @@ -0,0 +1,172 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Web; +using System.Web.Http; + +using Microsoft.Bot.Builder.Dialogs; +using Microsoft.Bot.Connector; + +using Office365Service; +using Office365Service.ViewModel; + +namespace ExcelBot.Helpers +{ + public static class ServicesHelper + { + // Excel Service Settings + public const string Resource = "https://graph.microsoft.com"; + + private const string UserApiVersion = "v1.0"; + private const string OneDriveApiVersion = "v1.0"; + private const string ExcelApiVersion = "v1.0"; + + #region Properties + public static string AccessToken + { + get + { + return (string)(HttpContext.Current.Items["AccessToken"]); + } + set + { + HttpContext.Current.Items["AccessToken"] = value; + } + } + + public static Office365Service.User.UserService UserService + { + get + { + if (!(HttpContext.Current.Items.Contains("UserService"))) + { + var service = new Office365Service.User.UserService( +#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously + async () => + { + return AccessToken; + } +#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously + ) + { + Url = $"{Resource}/{UserApiVersion}" + }; + HttpContext.Current.Items["UserService"] = service; + } + return (Office365Service.User.UserService)(HttpContext.Current.Items["UserService"]); + } + } + + public static Office365Service.OneDrive.OneDriveService OneDriveService + { + get + { + if (!(HttpContext.Current.Items.Contains("OneDriveService"))) + { + var service = new Office365Service.OneDrive.OneDriveService( +#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously + async () => + { + return AccessToken; + } +#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously + ) + { + Url = $"{Resource}/{OneDriveApiVersion}" + }; + HttpContext.Current.Items["OneDriveService"] = service; + } + return (Office365Service.OneDrive.OneDriveService)(HttpContext.Current.Items["OneDriveService"]); + } + } + + public static Office365Service.Excel.ExcelRESTService ExcelService + { + get + { + if (!(HttpContext.Current.Items.Contains("ExcelService"))) + { + var service = new Office365Service.Excel.ExcelRESTService( +#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously + async () => + { + return AccessToken; + } +#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously + ) + { + Url = $"{Resource}/{ExcelApiVersion}" + }; + HttpContext.Current.Items["ExcelService"] = service; + } + return (Office365Service.Excel.ExcelRESTService)(HttpContext.Current.Items["ExcelService"]); + } + } + #endregion + + #region Methods + public static void StartLogging(Message message) + { + var verbose = message.GetBotConversationData("Verbose"); + if (verbose) + { + UserService.RequestViewModel = new RequestViewModel(); + UserService.ResponseViewModel = new ResponseViewModel(); + + OneDriveService.RequestViewModel = new RequestViewModel(); + OneDriveService.ResponseViewModel = new ResponseViewModel(); + + ExcelService.RequestViewModel = new RequestViewModel(); + ExcelService.ResponseViewModel = new ResponseViewModel(); + } + else + { + UserService.RequestViewModel = null; + UserService.ResponseViewModel = null; + + OneDriveService.RequestViewModel = null; + OneDriveService.ResponseViewModel = null; + + ExcelService.RequestViewModel = null; + ExcelService.ResponseViewModel = null; + } + } + + public static async Task LogUserServiceResponse(IDialogContext context) + { + await LogResponse(context, UserService); + } + + public static async Task LogOneDriveServiceResponse(IDialogContext context) + { + await LogResponse(context, OneDriveService); + } + public static async Task LogExcelServiceResponse(IDialogContext context) + { + await LogResponse(context, ExcelService); + } + + public static async Task LogResponse(IDialogContext context, RESTService service) + { + if (service.ResponseViewModel != null) + { + var request = service.RequestViewModel; + if ((request.Api.Method == "POST") || (request.Api.Method == "PATCH")) + { + await context.PostAsync($"{request.Model.Api.Method} {request.Model.Api.RequestUri}\n\n{request.Body}"); + } + else + { + await context.PostAsync($"{request.Model.Api.Method} {request.Model.Api.RequestUri}"); + } + } + } + #endregion + } +} \ No newline at end of file diff --git a/ExcelBot/Helpers/TelemetryHelper.cs b/ExcelBot/Helpers/TelemetryHelper.cs new file mode 100644 index 0000000..80ede04 --- /dev/null +++ b/ExcelBot/Helpers/TelemetryHelper.cs @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web; + +using Microsoft.ApplicationInsights; + +using Microsoft.Bot.Connector; +using Microsoft.Bot.Builder.Dialogs; +using Microsoft.Bot.Builder.Luis.Models; + +namespace ExcelBot.Helpers +{ + public static class TelemetryHelper + { + #region Methods + public static void SetIds(Message message) + { + HttpContext.Current.Items["UserId"] = message.From.Id; + HttpContext.Current.Items["ConversationId"] = message.ConversationId; + HttpContext.Current.Items["ChannelId"] = message.From.ChannelId; + } + public static void TrackEvent(string eventName, Dictionary properties = null, Dictionary metrics = null) + { + var tc = new TelemetryClient(); + + tc.Context.User.AccountId = (string)(HttpContext.Current.Items["UserId"]); + tc.Context.User.Id = (string)(HttpContext.Current.Items["UserId"]); + tc.Context.Session.Id = (string)(HttpContext.Current.Items["ConversationId"]); + tc.Context.Device.Type = (string)(HttpContext.Current.Items["ChannelId"]); + + tc.TrackEvent(eventName, properties, metrics); + } + + public static void TrackDialog(IDialogContext context, LuisResult result, string moduleName, string dialogName) + { + var properties = new Dictionary(); + properties.Add("Module", moduleName); + properties.Add("Dialog", dialogName); + properties.Add("Query", result.Query); + + var metrics = new Dictionary(); + metrics.Add("EntityCount", result.Entities.Count); + + var entityTypes = new StringBuilder(); + var separator = ""; + foreach (var entity in result.Entities) + { + entityTypes.Append($"{separator}{entity.Type}"); + separator = ","; + } + properties.Add("EntityTypes", entityTypes.ToString()); + + TrackEvent($"Dialog/{moduleName}/{dialogName}", properties, metrics); + } + #endregion + } +} \ No newline at end of file diff --git a/ExcelBot/Luis/ExcelBot.json b/ExcelBot/Luis/ExcelBot.json new file mode 100644 index 0000000..5702b73 --- /dev/null +++ b/ExcelBot/Luis/ExcelBot.json @@ -0,0 +1,11888 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information --> +{ + "luis_schema_version": "1.3.0", + "name": "ExcelBot", + "desc": "", + "culture": "en-us", + "intents": [ + { + "name": "listWorksheets" + }, + { + "name": "setCellNumberValue" + }, + { + "name": "lookupTableRow" + }, + { + "name": "getActiveWorkbook" + }, + { + "name": "setCellStringValue" + }, + { + "name": "getActiveWorksheet" + }, + { + "name": "listTables" + }, + { + "name": "listCharts" + }, + { + "name": "sayHello" + }, + { + "name": "None" + }, + { + "name": "getCellValue" + }, + { + "name": "showHelp" + }, + { + "name": "getNamedItemValue" + }, + { + "name": "listNamedItems" + }, + { + "name": "openWorkbook" + }, + { + "name": "setActiveCellValue" + }, + { + "name": "setNamedItemValue" + }, + { + "name": "selectWorksheet" + }, + { + "name": "getActiveCellValue" + }, + { + "name": "getChartImage" + } + ], + "entities": [ + { + "name": "Text" + }, + { + "name": "Workbook" + }, + { + "name": "Name" + }, + { + "name": "Cell" + } + ], + "composites": [ ], + "bing_entities": [ + "number" + ], + "actions": [ + { + "actionName": "getChartImage", + "intentName": "getChartImage", + "actionParameters": [ + { + "parameterName": "Name", + "entityName": "Name", + "required": false + } + ] + }, + { + "actionName": "setCellStringValue", + "intentName": "setCellStringValue", + "actionParameters": [ + { + "parameterName": "CellAddress", + "entityName": "Cell", + "required": true + }, + { + "parameterName": "Value", + "entityName": "Text", + "required": true + } + ] + }, + { + "actionName": "lookupTableRow", + "intentName": "lookupTableRow", + "actionParameters": [ + { + "parameterName": "TableName", + "entityName": "Name", + "required": false + }, + { + "parameterName": "NumberValue", + "entityName": "number", + "required": false + }, + { + "parameterName": "StringValue", + "entityName": "Text", + "required": false + } + ] + }, + { + "actionName": "setActiveCellValue", + "intentName": "setActiveCellValue", + "actionParameters": [ + { + "parameterName": "StringValue", + "entityName": "Text", + "required": false + }, + { + "parameterName": "NumberValue", + "entityName": "number", + "required": false + } + ] + }, + { + "actionName": "getCellValue", + "intentName": "getCellValue", + "actionParameters": [ + { + "parameterName": "CellAddress", + "entityName": "Cell", + "required": true + } + ] + }, + { + "actionName": "setNamedItemValue", + "intentName": "setNamedItemValue", + "actionParameters": [ + { + "parameterName": "StringValue", + "entityName": "Text", + "required": false + }, + { + "parameterName": "NumberValue", + "entityName": "number", + "required": false + }, + { + "parameterName": "Name", + "entityName": "Name", + "required": false + } + ] + }, + { + "actionName": "openWorkbook", + "intentName": "openWorkbook", + "actionParameters": [ + { + "parameterName": "Filename", + "entityName": "Workbook", + "required": true + } + ] + }, + { + "actionName": "getNamedItemValue", + "intentName": "getNamedItemValue", + "actionParameters": [ + { + "parameterName": "Name", + "entityName": "Name", + "required": false + } + ] + }, + { + "actionName": "selectWorksheet", + "intentName": "selectWorksheet", + "actionParameters": [ + { + "parameterName": "Worksheet", + "entityName": "Name", + "required": false + } + ] + }, + { + "actionName": "setCellNumberValue", + "intentName": "setCellNumberValue", + "actionParameters": [ + { + "parameterName": "CellAddress", + "entityName": "Cell", + "required": false + }, + { + "parameterName": "Value", + "entityName": "number", + "required": false + } + ] + } + ], + "model_features": [ ], + "regex_features": [ + { + "name": "Workbook Name", + "pattern": "[\\w,\\s-]+\\.xlsx", + "activated": true + }, + { + "name": "CellAddress", + "pattern": "[a-z]+[1-9][0-9]*", + "activated": true + }, + { + "name": "Name", + "pattern": "([a-z_\\\\])[\\w\\d\\._]*", + "activated": true + } + ], + "utterances": [ + { + "text": "chart 2", + "intent": "getChartImage", + "entities": [ + { + "entity": "Name", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "=hello", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "hello", + "intent": "sayHello", + "entities": [ ] + }, + { + "text": "change a1 to hello", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what is the value of c1?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "open cars", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "done!", + "intent": "None", + "entities": [ ] + }, + { + "text": "open booksales.xlsx", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change b57 to 3.14", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "show chart 1", + "intent": "getChartImage", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "=hello!", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is the value of a14?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "show chart 2", + "intent": "getChartImage", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "delete cell a3", + "intent": "None", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is in a3?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "value of a10?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "show chart", + "intent": "getChartImage", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "open the list of incoming interns this year", + "intent": "openWorkbook", + "entities": [ ] + }, + { + "text": "show me chart 2", + "intent": "getChartImage", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "set a3 to 1", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "what is the value in cell a1?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "value of b2", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is the value of b6", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "value of a2?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is the name of a1?", + "intent": "None", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "set onecount to 100", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "value of c1?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "open cycling training diary 2009 example", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Workbook", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Workbook", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "value of a999?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "show me the list of charts", + "intent": "listCharts", + "entities": [ ] + }, + { + "text": "let cost be 100", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "can you put a 10 in a1?", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "show me chart 1", + "intent": "getChartImage", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is in row 2", + "intent": "None", + "entities": [ ] + }, + { + "text": "value of a1001?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "set nameditem to 10", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "any charts?", + "intent": "listCharts", + "entities": [ ] + }, + { + "text": "set onecount to 5", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change it to year 1", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "set hidden to 5", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "what is the value in cell a1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "am i signed in now?", + "intent": "None", + "entities": [ ] + }, + { + "text": "wow, that's annoying :)", + "intent": "None", + "entities": [ ] + }, + { + "text": "set onecount to 10", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "look at rest", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "how many rows have work in them?", + "intent": "None", + "entities": [ ] + }, + { + "text": "change the value of a1 to magic", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "=world", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set a2 to volvo", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change that to hej!", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "year=2016", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "change months to 12", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change the value of a1 to say \"hiya\"", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 8, + "endPos": 8 + } + ] + }, + { + "text": "change the value of a1 to hi", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "maybe i'm not logged into onedrive for business?", + "intent": "None", + "entities": [ ] + }, + { + "text": "change b1 to hello", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set counts to 5", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "what is a3?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "let cost be 590.99", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set sales to 1000", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "how about a1?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "show me counts", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "which names are in the workbook?", + "intent": "listNamedItems", + "entities": [ ] + }, + { + "text": "set a1 to 78", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "what is hidden?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "set that to 5", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "let a1 be 10", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set value of b2 to magic", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "what is in counts?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set a1 to 100", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set cell a2 to 10", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "look at coauth test", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "a3 is?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "what is counts?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "a7?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "value of a1000?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "set it to fantastic", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change that name to \"car model\" please", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Text", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "what is the value of chartdata?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "what is sales?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "open christian 2016", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "read b1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "list names", + "intent": "listNamedItems", + "entities": [ ] + }, + { + "text": "what is the value in cell a1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "what are the names in the workbook?", + "intent": "listNamedItems", + "entities": [ ] + }, + { + "text": "set it to 10.5", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "what is the date range in column b?", + "intent": "None", + "entities": [ ] + }, + { + "text": "set it to hello world!", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "read b57", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "i have a file open already", + "intent": "getActiveWorkbook", + "entities": [ ] + }, + { + "text": "set a3 to \"=sum(a1:a2)\"", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 10 + } + ] + }, + { + "text": "set it to bla", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set it to hello world i am tired", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Text", + "startPos": 6, + "endPos": 6 + }, + { + "entity": "Text", + "startPos": 7, + "endPos": 7 + } + ] + }, + { + "text": "=hello world!", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set onecell to 10", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change that to goodbye", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what is the value of a4", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "hi, i'd like help", + "intent": "showHelp", + "entities": [ ] + }, + { + "text": "change a3 to 46464", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set i1 to =sum(f2:f10)", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 9 + } + ] + }, + { + "text": "change to 5", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "set a1 to 55", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "what is in chartdata?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "demo data", + "intent": "None", + "entities": [ ] + }, + { + "text": "change the value of a2 to \"hi mikeyvi\"", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 7, + "endPos": 7 + }, + { + "entity": "Text", + "startPos": 8, + "endPos": 8 + } + ] + }, + { + "text": "show me totalsales", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is the value of b1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "show chartdata", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "what's in a2?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "set it to 67", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "what is counts", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "change the value of b2 to magic", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "set value in cell a2 to 10", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "a3?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "move value b3 to a1", + "intent": "None", + "entities": [ ] + }, + { + "text": "what is name", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "set a2 to 35", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set a2 to 200", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "a1=fabrikam", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + }, + { + "entity": "Text", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "set a3 to =rand(5)", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Text", + "startPos": 6, + "endPos": 6 + }, + { + "entity": "Text", + "startPos": 7, + "endPos": 7 + } + ] + }, + { + "text": "change b2 to magic", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "categories?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "change a1 to uid", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "open \"messages for office.com\"", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Workbook", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Workbook", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Workbook", + "startPos": 6, + "endPos": 6 + }, + { + "entity": "Workbook", + "startPos": 7, + "endPos": 7 + } + ] + }, + { + "text": "sales?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "booleanconstant?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "change it to 10", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "=underground tour in seattle", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "what is the value of b7?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "names?", + "intent": "listNamedItems", + "entities": [ ] + }, + { + "text": "open the test workbook", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what are the named items in the workbook?", + "intent": "listNamedItems", + "entities": [ ] + }, + { + "text": "close book.xlsx", + "intent": "None", + "entities": [ ] + }, + { + "text": "open book.xlsx", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set it to 10", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "set it to hello", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change i1 to =f2+f3", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Text", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "change that to hej", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "=hello world again", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "a1?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "open book1.xlsx", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "=78", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "your help text needs to have the correct syntax to enable me to follow your instructions!", + "intent": "None", + "entities": [ ] + }, + { + "text": "change b1 to 25", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set b58 to 20", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set value of a1 to 40", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "can you show my how to make a box and whisker chart", + "intent": "None", + "entities": [ ] + }, + { + "text": "change to hello", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is the value a1?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "what is the value of a1, a2 and a5", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Cell", + "startPos": 7, + "endPos": 7 + }, + { + "entity": "Cell", + "startPos": 9, + "endPos": 9 + } + ] + }, + { + "text": "change that to james bond casino royale", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Text", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "revenue=78000", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "open workbooks", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set a1 to 25", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "show me table 1", + "intent": "None", + "entities": [ ] + }, + { + "text": "what is the value of a2", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "set a1 to 500", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set a1 to 67", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set a2 to =a1+a2", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Text", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "sum a1 & a3", + "intent": "None", + "entities": [ ] + }, + { + "text": "sum a1:a1", + "intent": "None", + "entities": [ ] + }, + { + "text": "show me a1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "i have team ipads opened", + "intent": "None", + "entities": [ ] + }, + { + "text": "open timesheet", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "list charts in workbook", + "intent": "listCharts", + "entities": [ ] + }, + { + "text": "open \"demo data - tobacco sales to minors enforcement checks.xlsx\"", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Workbook", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Workbook", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Workbook", + "startPos": 6, + "endPos": 6 + }, + { + "entity": "Workbook", + "startPos": 7, + "endPos": 7 + }, + { + "entity": "Workbook", + "startPos": 8, + "endPos": 8 + }, + { + "entity": "Workbook", + "startPos": 9, + "endPos": 9 + }, + { + "entity": "Workbook", + "startPos": 10, + "endPos": 10 + }, + { + "entity": "Workbook", + "startPos": 11, + "endPos": 11 + }, + { + "entity": "Workbook", + "startPos": 12, + "endPos": 12 + } + ] + }, + { + "text": "look at apollo easy backlog", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Workbook", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "set a1 to =a1+a2", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Text", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "change it to 20", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "set it to wonderful copenhagen", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "look at \"giving campaign 2015\"", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "set b2=sum(a1:a3)", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 8 + } + ] + }, + { + "text": "=5", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "change it to wonderful world!", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "edit a1", + "intent": "None", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "tell me the value of a1?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "getcellvalue a1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "let's open a workbook", + "intent": "openWorkbook", + "entities": [ ] + }, + { + "text": "open \"giving campaign 2015\"", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Text", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "who is natalie?", + "intent": "None", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "show me the workbooks", + "intent": "None", + "entities": [ ] + }, + { + "text": "the value of a3 is =a1+a2", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Text", + "startPos": 6, + "endPos": 6 + }, + { + "entity": "Text", + "startPos": 7, + "endPos": 7 + }, + { + "entity": "Text", + "startPos": 8, + "endPos": 8 + } + ] + }, + { + "text": "hello? are you alive?!", + "intent": "sayHello", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "what is it now?", + "intent": "getActiveCellValue", + "entities": [ ] + }, + { + "text": "open contractor extension.xlsx", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Workbook", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "how about showing me a thumbnail so i know i have the correct workbook?", + "intent": "None", + "entities": [ ] + }, + { + "text": "a14?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "set the value of a6 to be =a1 + a2 + a5", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 7, + "endPos": 7 + }, + { + "entity": "Text", + "startPos": 8, + "endPos": 8 + }, + { + "entity": "Text", + "startPos": 9, + "endPos": 9 + }, + { + "entity": "Text", + "startPos": 10, + "endPos": 10 + }, + { + "entity": "Text", + "startPos": 11, + "endPos": 11 + }, + { + "entity": "Text", + "startPos": 12, + "endPos": 12 + } + ] + }, + { + "text": "value of a1100?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "can you tell me what books i can open?", + "intent": "None", + "entities": [ ] + }, + { + "text": "get link", + "intent": "getActiveWorkbook", + "entities": [ ] + }, + { + "text": "which workbook are you working with?", + "intent": "getActiveWorkbook", + "entities": [ ] + }, + { + "text": "what is the highest value in this document", + "intent": "None", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Cell", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "value of a1304?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "get active", + "intent": "getActiveWorkbook", + "entities": [ ] + }, + { + "text": "open giving campaign 2015", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "show my files", + "intent": "None", + "entities": [ ] + }, + { + "text": "set a1 to 5.5", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set the value of a2 to 25", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "h78=this is exciting", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + }, + { + "entity": "Text", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "change the value of a1 to 20", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "set a1 to 50", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "open messages for office.com.xlsx", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Workbook", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Workbook", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Workbook", + "startPos": 7, + "endPos": 7 + } + ] + }, + { + "text": "show me the headers please", + "intent": "None", + "entities": [ ] + }, + { + "text": "show me the list of the workbook", + "intent": "None", + "entities": [ ] + }, + { + "text": "show me sheet1", + "intent": "None", + "entities": [ ] + }, + { + "text": "a1 = 1", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "getcellvalue a1:a6", + "intent": "None", + "entities": [ ] + }, + { + "text": "set a2 to 20", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set a1 to 60", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set the value of a1 to id", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "what names are in the workbook?", + "intent": "listNamedItems", + "entities": [ ] + }, + { + "text": "set it to 25", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "set a67 to contoso engineering", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "which charts?", + "intent": "listCharts", + "entities": [ ] + }, + { + "text": "open apollo", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set a1 to 788", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set a7 to what a wonderful day", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Text", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "open rest.xlsx", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "get value of a1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change a57 to 78", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "b27?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "set it to 5", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "set it to here is a long text", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Text", + "startPos": 6, + "endPos": 6 + }, + { + "entity": "Text", + "startPos": 7, + "endPos": 7 + } + ] + }, + { + "text": "set a5 to be 5", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change that to 5", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "set b2 =sum(a1:a3)", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 8 + } + ] + }, + { + "text": "set a1 to world!", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "opeb workbook book", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "look in book", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what's in the entire first column?", + "intent": "None", + "entities": [ + { + "entity": "Cell", + "startPos": 7, + "endPos": 7 + } + ] + }, + { + "text": "value of c1304", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "show me the ranges", + "intent": "None", + "entities": [ ] + }, + { + "text": "give me the value of a1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "a1=78", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "thanks is that your attempt to give me the list of words you understand?", + "intent": "None", + "entities": [ ] + }, + { + "text": "what's in a1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "a1=1", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "name the brands in the brand column", + "intent": "None", + "entities": [ ] + }, + { + "text": "a3 = = a1 + a2", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + }, + { + "entity": "Text", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "a3 = =a1+a2", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + }, + { + "entity": "Text", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "hi excelbot", + "intent": "sayHello", + "entities": [ ] + }, + { + "text": "get link to workbook", + "intent": "getActiveWorkbook", + "entities": [ ] + }, + { + "text": "c:\\users\\chelli\\documents\\world boss data.xlsx", + "intent": "None", + "entities": [ + { + "entity": "Workbook", + "startPos": 13, + "endPos": 13 + } + ] + }, + { + "text": "what can you tell me what to do", + "intent": "showHelp", + "entities": [ ] + }, + { + "text": "set g1 to contoso engineering inc.", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Text", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "setvalue a1 car type", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 2, + "endPos": 3 + } + ] + }, + { + "text": "change a1 to 234", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "spreadsheet?", + "intent": "getActiveWorkbook", + "entities": [ ] + }, + { + "text": "a1=fabrilkam world headquarter", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + }, + { + "entity": "Text", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "can you show me how to sum?", + "intent": "None", + "entities": [ ] + }, + { + "text": "have a1 = 1", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "what is the value of a2?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "set b1 to 56.78", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "a11?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "get values from a1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set the value of a1 to 70", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "set h78 to 567", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set a1 to hello world!", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "what's the value of a1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "show choices", + "intent": "showHelp", + "entities": [ ] + }, + { + "text": "what is the value of b16?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "what is in a1?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set the value of b7 to hello world!", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 6, + "endPos": 6 + }, + { + "entity": "Text", + "startPos": 7, + "endPos": 7 + }, + { + "entity": "Text", + "startPos": 8, + "endPos": 8 + } + ] + }, + { + "text": "d78=this is a test", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + }, + { + "entity": "Text", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "what's in cell a1?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "set a1 to contoso industries inc.", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Text", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "a1=788", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "make a1 1", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "what do i have in my onedrive", + "intent": "None", + "entities": [ ] + }, + { + "text": "what does bad mean is that relative?", + "intent": "None", + "entities": [ + { + "entity": "Cell", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "set a1 to id", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set it to hello world", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "b2?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "sum a1 and a2", + "intent": "None", + "entities": [ ] + }, + { + "text": "how many columns", + "intent": "None", + "entities": [ ] + }, + { + "text": "look at giving campaign 2015", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Text", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "a28", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "i'm getting #value", + "intent": "None", + "entities": [ ] + }, + { + "text": "a1 + a3", + "intent": "None", + "entities": [ ] + }, + { + "text": "get value of a3", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "value of a2", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "open xyz workbook", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "open carsales", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "what is the total miles logged?", + "intent": "None", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "open formula_cloud.xlsx", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Workbook", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Workbook", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "which workbook?", + "intent": "getActiveWorkbook", + "entities": [ ] + }, + { + "text": "please talk to me about what you are thinking!", + "intent": "None", + "entities": [ ] + }, + { + "text": "what is the value of b27?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "set a1 to 234", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "hi excel", + "intent": "sayHello", + "entities": [ ] + }, + { + "text": "open a workbook", + "intent": "openWorkbook", + "entities": [ ] + }, + { + "text": "set a3 to a1 + a2", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "what are we looking at?", + "intent": "getActiveWorkbook", + "entities": [ ] + }, + { + "text": "the value of a1 is 1", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "open test", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change a1 to 20", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set a1 to 1", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "get me the damn value of c`1", + "intent": "None", + "entities": [ + { + "entity": "Cell", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "set g5 to 0.5", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set a1 to 30", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "tell me the value of a1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "what is the value of a3?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "set it to good, bad and ugly", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Text", + "startPos": 6, + "endPos": 6 + }, + { + "entity": "Text", + "startPos": 7, + "endPos": 7 + } + ] + }, + { + "text": "set a1 to 64", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "look at food", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "can you show me a thumbnail for the cell (and surrounding cells) when you change its value?", + "intent": "None", + "entities": [ ] + }, + { + "text": "set value of a1 to 5", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what is the value a1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "what were the sales for bmw in 1/1/2008?", + "intent": "None", + "entities": [ + { + "entity": "Cell", + "startPos": 11, + "endPos": 11 + } + ] + }, + { + "text": "list worksheets", + "intent": "listWorksheets", + "entities": [ ] + }, + { + "text": "clear a1", + "intent": "None", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "what is the value of a1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "read a1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set cc67 to wonderful", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "=wonderful copenhagen", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "value of a14?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "b1?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "add a1 and a4", + "intent": "None", + "entities": [ ] + }, + { + "text": "taxes-2015.xlsx", + "intent": "None", + "entities": [ + { + "entity": "Workbook", + "startPos": 0, + "endPos": 0 + }, + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Workbook", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "open car sales_notes", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Workbook", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "close test", + "intent": "None", + "entities": [ ] + }, + { + "text": "show me the ranges in a1", + "intent": "None", + "entities": [ ] + }, + { + "text": "set a1 to 68", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set a1 to 20", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "showvalue a1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "a3 = a1 + a2", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + }, + { + "entity": "Text", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "why are we here?", + "intent": "None", + "entities": [ ] + }, + { + "text": "what is in a7?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change a1", + "intent": "None", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "do you understand the nature of the universe?", + "intent": "showHelp", + "entities": [ ] + }, + { + "text": "goodmorning!", + "intent": "sayHello", + "entities": [ ] + }, + { + "text": "which workbook am i working with?", + "intent": "getActiveWorkbook", + "entities": [ ] + }, + { + "text": "what is the active workbook", + "intent": "getActiveWorkbook", + "entities": [ ] + }, + { + "text": "valut of aa1?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "change a1 to 10", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "open christian.xlsx", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "i need you to show me you heard and are processing my chat it's hard to know if you are listening!!", + "intent": "None", + "entities": [ ] + }, + { + "text": "what is a1?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "show me a:1", + "intent": "None", + "entities": [ ] + }, + { + "text": "which workbook is open?", + "intent": "getActiveWorkbook", + "entities": [ ] + }, + { + "text": "set b59 to =b57+b58", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Text", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "greetings!", + "intent": "sayHello", + "entities": [ ] + }, + { + "text": "set a2 to 25", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "hi!", + "intent": "sayHello", + "entities": [ ] + }, + { + "text": "set a3 to =a1+a2", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Text", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "where are you?", + "intent": "sayHello", + "entities": [ ] + }, + { + "text": "set b57 to 1000.50", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "=57", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "is a1 part of a table?", + "intent": "None", + "entities": [ ] + }, + { + "text": "change a2 to 20", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "open test.xlsx", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "open workbook", + "intent": "openWorkbook", + "entities": [ ] + }, + { + "text": "value of b1?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "b7 value?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "h1?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "what is in b5", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "open food workbook", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "open tobacco sale.xlsx", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Workbook", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "open team ipads", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "set a1 to hello", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what is z78?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "value c1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "what is the value of b5?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "help?", + "intent": "showHelp", + "entities": [ ] + }, + { + "text": "hi again", + "intent": "sayHello", + "entities": [ ] + }, + { + "text": "how can you help me?", + "intent": "showHelp", + "entities": [ ] + }, + { + "text": "set a1 to 10", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "value of a100?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "open revenue 2016", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "b22", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "value of a1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "set h88 to 89", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "h1 value?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "hi bot", + "intent": "sayHello", + "entities": [ ] + }, + { + "text": "value a1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "look in testbook", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "set a1 to 5", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "what can you do for me?", + "intent": "showHelp", + "entities": [ ] + }, + { + "text": "d8?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "b2 value?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "hello!", + "intent": "None", + "entities": [ ] + }, + { + "text": "open revenue", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "value of a1304", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "set the value of b7 to 10", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "value of h1?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "look in food.xlsx", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Workbook", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "yeah?", + "intent": "None", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "what is b7?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is in b6", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what can you do?", + "intent": "showHelp", + "entities": [ ] + }, + { + "text": "and now?", + "intent": "getActiveCellValue", + "entities": [ ] + }, + { + "text": "what is the value of h1?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "work with revenue forcast 2015", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Workbook", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "what is the value of a1304?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "hi", + "intent": "sayHello", + "entities": [ ] + }, + { + "text": "what can i do?", + "intent": "showHelp", + "entities": [ ] + }, + { + "text": "open carsales.xlsx", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "value of a1?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "a27?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "set value of a1 to 10", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "look at sales 2016", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "hi there", + "intent": "sayHello", + "entities": [ ] + }, + { + "text": "value of?", + "intent": "None", + "entities": [ ] + }, + { + "text": "hej", + "intent": "sayHello", + "entities": [ ] + }, + { + "text": "b1 value", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "what is the value of a1?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "value of b7?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "work with issue log", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what's up?", + "intent": "None", + "entities": [ ] + }, + { + "text": "get a1", + "intent": "getCellValue", + "entities": [ ] + }, + { + "text": "what is the value?", + "intent": "None", + "entities": [ ] + }, + { + "text": "get c1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "open messages for office.com", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Workbook", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Workbook", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "a1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "open gift tracking", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "hlep", + "intent": "showHelp", + "entities": [ ] + }, + { + "text": "?", + "intent": "None", + "entities": [ ] + }, + { + "text": "read b2", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "hello?", + "intent": "sayHello", + "entities": [ ] + }, + { + "text": "open book1", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "open", + "intent": "openWorkbook", + "entities": [ ] + }, + { + "text": "read a2", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "list workbooks", + "intent": "None", + "entities": [ ] + }, + { + "text": "show sales", + "intent": "getChartImage", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "get a2", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "which tables are in the workbook?", + "intent": "listTables", + "entities": [ ] + }, + { + "text": "tables?", + "intent": "listTables", + "entities": [ ] + }, + { + "text": "show me the tables", + "intent": "listTables", + "entities": [ ] + }, + { + "text": "lookup 23 in logentries", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "show me 35 in logentries", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Name", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "show me percent sale", + "intent": "getNamedItemValue", + "entities": [ ] + }, + { + "text": "show me citydata", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "show me categories", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "show me charts", + "intent": "listCharts", + "entities": [ ] + }, + { + "text": "print logentries", + "intent": "getNamedItemValue", + "entities": [ ] + }, + { + "text": "logentries", + "intent": "getNamedItemValue", + "entities": [ ] + }, + { + "text": "list logentries", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "show logentries", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "show the logentries table", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "show me logentries", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "lookup 89 in logentries", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "lookup 5 in logentries", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "lookup 22 in logasjdksad", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "lookup 19 in logentries", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "lookup 25 in logentries", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "lookup 22 in logentries", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "look up 22 in logentries", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "look at book", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "look at carsales.xlsx", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Workbook", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "look at testcoauth2", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "look at apollo", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "look at testcoauth", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "look at book1", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "look in carsales", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "look at test", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "look for pivot_table_example", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Workbook", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Workbook", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Workbook", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "look at loan", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "look for \"pivot_table_example\"", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Workbook", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Workbook", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Workbook", + "startPos": 6, + "endPos": 6 + }, + { + "entity": "Workbook", + "startPos": 7, + "endPos": 7 + } + ] + }, + { + "text": "look at incoming interns 2016", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what's up", + "intent": "sayHello", + "entities": [ ] + }, + { + "text": "look at carsales", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "look up 18 in logentries", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "show table1", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "show cars", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "show tables", + "intent": "listTables", + "entities": [ ] + }, + { + "text": "show couning", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "show names", + "intent": "listNamedItems", + "entities": [ ] + }, + { + "text": "show a1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "show charts1", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "show counts", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "show table15", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "show me table15", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "show me onechart", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "show me chartdata", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "show customers", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "show customers table", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "show me customers", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "customers", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "lookup 6fddc491-7042-42fb-9cba-e956e9f79e6e in customers", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 11, + "endPos": 11 + }, + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Text", + "startPos": 6, + "endPos": 6 + }, + { + "entity": "Text", + "startPos": 7, + "endPos": 7 + }, + { + "entity": "Text", + "startPos": 8, + "endPos": 8 + }, + { + "entity": "Text", + "startPos": 9, + "endPos": 9 + } + ] + }, + { + "text": "lookup 18 in logentries", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "lookup 21 in logentries", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "stringconstant?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "chartdata?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "integerconstant?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "totalinterest?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "change b57 to hello", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "a3 = sum(a1:a2)", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 0, + "endPos": 0 + }, + { + "entity": "Text", + "startPos": 2, + "endPos": 7 + } + ] + }, + { + "text": "change that to loan calculator", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "change note to hello world!", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "change a1 to cat", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change a1 to dog", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "lookup dow in customers", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "lookup deepthi murali in customers", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "let onecount be 10", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "look up 17 in logentries", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "loogup 22 in logentries", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "=10", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "open customers", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "lookup xyz in hello", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "look up this thing in this table", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Name", + "startPos": 6, + "endPos": 6 + }, + { + "entity": "Text", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "look up mike in customers", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "lookup xay in hello", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "lookup mind in customers", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "lookup smith in customers", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "look up dow in customers", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "lookup deepthi in customers", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "lookup hello in customers", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "lookup hello in customes", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "list names in cars", + "intent": "listNamedItems", + "entities": [ ] + }, + { + "text": "what are the tables in this worksheet?", + "intent": "listTables", + "entities": [ + { + "entity": "Name", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "lookup sudi", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set note to bla!", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "get counts", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change hello to 5", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set note to test", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change note to test", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set note to 5", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "let counts be 10", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change d8 to 157", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "lookup mindtree in customers", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "lookup sedan", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "lookup sap", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "lookup jetta", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "show me the results of applying conditional formatting to [a1:a1]", + "intent": "None", + "entities": [ ] + }, + { + "text": "lookup sage", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change status to open", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "look up james", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Text", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "lookup mazda", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "lookup try", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "lookup ford", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "work with loan", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "change id to 5", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set hidden to 10", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set id to 25", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "it's open", + "intent": "None", + "entities": [ ] + }, + { + "text": "change that to world", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set c3 to 999", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "goodbye", + "intent": "None", + "entities": [ ] + }, + { + "text": "set d7 to 175", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "counts=10", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "counts?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "set name to contoso", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set note to hello", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change status to closed", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "note=test", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 0, + "endPos": 0 + }, + { + "entity": "Text", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "change that to hello", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "select sheet3", + "intent": "selectWorksheet", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "goto log entries", + "intent": "selectWorksheet", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is the active worksheet?", + "intent": "getActiveWorksheet", + "entities": [ ] + }, + { + "text": "get active worksheet", + "intent": "getActiveWorksheet", + "entities": [ ] + }, + { + "text": "worksheet?", + "intent": "getActiveWorksheet", + "entities": [ ] + }, + { + "text": "switch to sheet4", + "intent": "selectWorksheet", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "select worksheet", + "intent": "selectWorksheet", + "entities": [ ] + }, + { + "text": "select sheet", + "intent": "selectWorksheet", + "entities": [ ] + }, + { + "text": "goto sheet", + "intent": "selectWorksheet", + "entities": [ ] + }, + { + "text": "which worksheets are in the workbook?", + "intent": "listWorksheets", + "entities": [ ] + }, + { + "text": "worksheets?", + "intent": "listWorksheets", + "entities": [ ] + }, + { + "text": "which worksheets?", + "intent": "listWorksheets", + "entities": [ ] + }, + { + "text": "get worksheets", + "intent": "listWorksheets", + "entities": [ ] + }, + { + "text": "switch to sheet3", + "intent": "selectWorksheet", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is the active sheet?", + "intent": "getActiveWorksheet", + "entities": [ ] + }, + { + "text": "tell me loanamount", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is the value of?", + "intent": "None", + "entities": [ ] + }, + { + "text": "select sheet 2", + "intent": "selectWorksheet", + "entities": [ ] + }, + { + "text": "switch to sheet 2", + "intent": "selectWorksheet", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "which sheet are we on?", + "intent": "getActiveWorksheet", + "entities": [ ] + }, + { + "text": "create a new sheet", + "intent": "None", + "entities": [ ] + }, + { + "text": "create excel sheet", + "intent": "None", + "entities": [ ] + }, + { + "text": "list sheets", + "intent": "listWorksheets", + "entities": [ ] + }, + { + "text": "select sheets", + "intent": "selectWorksheet", + "entities": [ ] + }, + { + "text": "what sheets are there?", + "intent": "listWorksheets", + "entities": [ ] + }, + { + "text": "how many sheets do i have", + "intent": "listWorksheets", + "entities": [ ] + }, + { + "text": "what sheets are in there?", + "intent": "listWorksheets", + "entities": [ ] + }, + { + "text": "what sheets are in this book", + "intent": "listWorksheets", + "entities": [ ] + }, + { + "text": "what sheets are in the workbook", + "intent": "listWorksheets", + "entities": [ ] + }, + { + "text": "change transmission to manual", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "lookup mike", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set interestrate to .0325", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Workbook", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "what is stringconstant?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what are the charts in the workbook?", + "intent": "listCharts", + "entities": [ ] + }, + { + "text": "get cars", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "tell me about the sheets", + "intent": "listWorksheets", + "entities": [ ] + }, + { + "text": "what worksheets are there?", + "intent": "listWorksheets", + "entities": [ ] + }, + { + "text": "how many table in the workbook", + "intent": "listTables", + "entities": [ ] + }, + { + "text": "which workbook are we in", + "intent": "getActiveWorkbook", + "entities": [ ] + }, + { + "text": "what tables are in this workbook", + "intent": "listTables", + "entities": [ ] + }, + { + "text": "how are you", + "intent": "sayHello", + "entities": [ ] + }, + { + "text": "what are the worksheets in this workbook?", + "intent": "listWorksheets", + "entities": [ ] + }, + { + "text": "which names are in the workbook", + "intent": "listNamedItems", + "entities": [ ] + }, + { + "text": "what charts are in this workbook?", + "intent": "listCharts", + "entities": [ ] + }, + { + "text": "what is thisisa1?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "thisisaname?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 0, + "endPos": 0 + } + ] + }, + { + "text": "get hello", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "work with customerlist", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "active workbook", + "intent": "getActiveWorkbook", + "entities": [ ] + }, + { + "text": "what's the value in a5", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "get total_interest", + "intent": "getNamedItemValue", + "entities": [ ] + }, + { + "text": "what is j18?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is s4?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "show me kia", + "intent": "getNamedItemValue", + "entities": [ ] + }, + { + "text": "what is total_interest?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Name", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "put \"priorities\" in cell b2", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 6, + "endPos": 6 + }, + { + "entity": "Text", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is the value of total_interest", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Name", + "startPos": 6, + "endPos": 6 + }, + { + "entity": "Name", + "startPos": 7, + "endPos": 7 + } + ] + }, + { + "text": "what is j18", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is s3?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "change c2 to tasks", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what is the value of total_interest?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Name", + "startPos": 6, + "endPos": 6 + }, + { + "entity": "Name", + "startPos": 7, + "endPos": 7 + } + ] + }, + { + "text": "good mornings", + "intent": "sayHello", + "entities": [ ] + }, + { + "text": "display ford focus", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Text", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "set interestrate to 4", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "what is pladder", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what's the value of b3", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "make p5 5", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "open boo", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "open tobacco sales", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "set email to rob.smith@contoso.com", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Text", + "startPos": 6, + "endPos": 6 + }, + { + "entity": "Text", + "startPos": 7, + "endPos": 7 + }, + { + "entity": "Text", + "startPos": 8, + "endPos": 8 + }, + { + "entity": "Text", + "startPos": 9, + "endPos": 9 + } + ] + }, + { + "text": "set cell z1 as \"test\"", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "set odometer to 32350", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set note to personal", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set status to closed", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set name to mike", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set g1 to 10", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set a1 to 100 test", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "change b1 to 5", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set interestrate to 3.25", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change to 2000", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "set interestrate to 0.04", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set interestrate to 0.0325", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set interestrate to 0.035", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set interestrate to 0.03", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set b57 to 10", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change loanamount to 10000", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change a2 to 500", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change loanyears to 7", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change that to ios", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change to 10000", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "change that to 33", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "change that to 10", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "change loanamount to 2000", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change a1 to 12", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change that to owner", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change loanyears to 6", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change a3 to 50", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change to 4%", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change interestrate to 4", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change it to 7", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "change that to 79", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "change jobtitle to founder", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change zipcode to 98899", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change jobtitle to ceo", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change note to work", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change zipcode to 99989", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change city to redmond", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change that to name", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change that to android", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change that to 10000", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "change that to 2000", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change a2 to 23", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change loanyears to 10", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change loanamount to 7000", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change city to portland", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change b2 to priorities", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change z1 to \"test\"", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "change loanamount to 3000", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change it to 33", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "change city to seattle", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change that to 5000", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change that to id", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change that to 3000", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change it to 99.99", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "change that to 67", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "change jobtitle to owner", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change jobtile to ceo", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change that 5000", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "change note to world!", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "change that to car name", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "change company to company rr", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "change state/province to wa", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "change company to company dd", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "can you change the value in b2", + "intent": "None", + "entities": [ + { + "entity": "Cell", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "change jobtitle to supply chain manager", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "change title to supply chain manager", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "edited previous message: change loanyears to 8", + "intent": "None", + "entities": [ + { + "entity": "Name", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Text", + "startPos": 25, + "endPos": 25 + }, + { + "entity": "Text", + "startPos": 27, + "endPos": 27 + } + ] + }, + { + "text": "change e-mail address to bagel@microsoft.com", + "intent": "None", + "entities": [ + { + "entity": "Workbook", + "startPos": 17, + "endPos": 17 + }, + { + "entity": "Workbook", + "startPos": 24, + "endPos": 24 + }, + { + "entity": "Text", + "startPos": 7, + "endPos": 7 + }, + { + "entity": "Text", + "startPos": 8, + "endPos": 8 + }, + { + "entity": "Text", + "startPos": 11, + "endPos": 11 + } + ] + }, + { + "text": "when i lookup a row i want to refer to the value by heading label eg change transmission to manual when viewing the mazda6", + "intent": "None", + "entities": [ + { + "entity": "Cell", + "startPos": 23, + "endPos": 23 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 19, + "endPos": 19 + } + ] + }, + { + "text": "update loanyears to 7", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "update jobtitle to ceo", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change title to ceo", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change loanyears to 3", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change jobtitle to cio", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "open 311nyc raw sms", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set loanamount to 500", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "show me country", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "show me the charts", + "intent": "listCharts", + "entities": [ ] + }, + { + "text": "please open salesforce workbook", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "which charts do i have", + "intent": "listCharts", + "entities": [ ] + }, + { + "text": "lookup 1 in logentries", + "intent": "lookupTableRow", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what is amount?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "open giving campaign 2015.xlsx", + "intent": "openWorkbook", + "entities": [ + { + "entity": "Workbook", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Workbook", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Workbook", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Workbook", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Workbook", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "set interestrate to 0.0225", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "get b21", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "get loanamount", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "get named", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "get b25", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "get c25", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "get thisisacell", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "get b57", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "get value of b25", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "get nameditem", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "get onecount", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "get chart 1", + "intent": "getChartImage", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "get value of transactionstable", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "get value of a2", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "get active workbook", + "intent": "getActiveWorkbook", + "entities": [ ] + }, + { + "text": "get the value of a1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "get value of cell b5", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "edited previous message: get name location_trey_research", + "intent": "None", + "entities": [ + { + "entity": "Workbook", + "startPos": 8, + "endPos": 8 + }, + { + "entity": "Workbook", + "startPos": 34, + "endPos": 34 + }, + { + "entity": "Text", + "startPos": 28, + "endPos": 28 + }, + { + "entity": "Text", + "startPos": 30, + "endPos": 30 + } + ] + }, + { + "text": "i want you to get better at suggesting an example of what to type early on in our conversation.", + "intent": "None", + "entities": [ + { + "entity": "Text", + "startPos": 14, + "endPos": 14 + } + ] + }, + { + "text": "switch worksheet", + "intent": "selectWorksheet", + "entities": [ ] + }, + { + "text": "switch sheets", + "intent": "selectWorksheet", + "entities": [ ] + }, + { + "text": "switch to sheet2", + "intent": "selectWorksheet", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "switch to transactions", + "intent": "selectWorksheet", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "switch sheet", + "intent": "selectWorksheet", + "entities": [ ] + }, + { + "text": "switch to ribbon capacity", + "intent": "selectWorksheet", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "switch to \"spending by state\"", + "intent": "selectWorksheet", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Name", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Name", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "switch to spending by state", + "intent": "selectWorksheet", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Name", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "set b1 to 1", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set a1 to test", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set interestrate to 3", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set interestrate to 0.0425", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set s2 to 20", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set interestrate to 0.02", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set b6 to 8", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set interestrate to 0.031", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set interstate to 0.03", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set a2 to rob", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set a3 to 10", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set loanamount to 200", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set xyz to bla", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set loanamount to 5000", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set it to 45", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "set c31 to 0", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set a1 to 7", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set c24 to 5", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set a1 to 9", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set loanamount to 4000", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set c31 to 100000", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set interestrate to .0008", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set loanamount to 20000", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set c30 to 0", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set a1 to 3", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set c6 to 8", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set state to or", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set s1 to 66", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set b1 to =a3", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "set c4 5", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set loanamount is 2000", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set a2 to 5", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set a1 to 1000", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set location_trey_research to 2", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Name", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Name", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "set c30 to 10000", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set loanyears to 7", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set loanamiount to 500", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set a1 to -10", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set loanamount to 6000", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set s1 to 10", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set f23 to co", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set c31 to 10000", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set note to work", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set name to hello", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set a1 to 8", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set city to portland", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set firstname to kathrine", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set loanamount to 100", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set a2 to 100", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set loanamount to 2000", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set loanamount to 7000", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set loanamount to 10000", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set loanamount to 500000", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set that to 0.03", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "set loanamount to 440000", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set loanamout to 3000", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set a2 to 1000", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set a2 to 2000", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set f23 to or", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set interestrate to 0.08%", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set b6 to 7", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set it to 66", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "set s2 to 25", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set loanamount to 1000", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set loanamount to 3000", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set loanamount to 78000", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set it to -10", + "intent": "setActiveCellValue", + "entities": [ ] + }, + { + "text": "set note to world", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set s4 to hellow &*&&*&* ^^^ !!", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Text", + "startPos": 6, + "endPos": 6 + }, + { + "entity": "Text", + "startPos": 7, + "endPos": 7 + }, + { + "entity": "Text", + "startPos": 8, + "endPos": 8 + }, + { + "entity": "Text", + "startPos": 9, + "endPos": 9 + }, + { + "entity": "Text", + "startPos": 10, + "endPos": 10 + }, + { + "entity": "Text", + "startPos": 11, + "endPos": 11 + }, + { + "entity": "Text", + "startPos": 12, + "endPos": 12 + }, + { + "entity": "Text", + "startPos": 13, + "endPos": 13 + }, + { + "entity": "Text", + "startPos": 14, + "endPos": 14 + }, + { + "entity": "Text", + "startPos": 15, + "endPos": 15 + } + ] + }, + { + "text": "set interestrate to 0.07", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set interestrate to .025", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set c52 to 5", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set location to wa", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set cell a5 pbutter", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set interestrate to .08", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set a2 to 2", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set a2 to 15", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set loanamount to $1000", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set loanamount to 199999", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set b1 to good", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set that to 2000", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set status to open", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set note to hi", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set jobtitle to founder", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set interestrate to 0.025", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set that to rob smith", + "intent": "setActiveCellValue", + "entities": [ + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "set f23 to wa", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set b2 to 9", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set onecount to 78", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set loan to 100", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set note to hello world", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "set note to hello world!", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "set comments to hello world!", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "set a2 to rob smith", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "set value of a1 to bbb", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "set value of a1 to 20", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set s4 to =max(s1:s2)", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 9 + } + ] + }, + { + "text": "set a1 to test hello world", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "set a1 to test 67 ^&^&^&^ world 1000", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Text", + "startPos": 6, + "endPos": 6 + }, + { + "entity": "Text", + "startPos": 7, + "endPos": 7 + }, + { + "entity": "Text", + "startPos": 8, + "endPos": 8 + }, + { + "entity": "Text", + "startPos": 9, + "endPos": 9 + }, + { + "entity": "Text", + "startPos": 10, + "endPos": 10 + }, + { + "entity": "Text", + "startPos": 11, + "endPos": 11 + }, + { + "entity": "Text", + "startPos": 12, + "endPos": 12 + }, + { + "entity": "Text", + "startPos": 13, + "endPos": 13 + } + ] + }, + { + "text": "set s3 to =sum(s1:s2)", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 9 + } + ] + }, + { + "text": "set value of a2 to 10", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "set a3 to =sum(a1:a2)", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 9 + } + ] + }, + { + "text": "set a1 to test hello world 100 whatever", + "intent": "setCellStringValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Text", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Text", + "startPos": 6, + "endPos": 6 + }, + { + "entity": "Text", + "startPos": 7, + "endPos": 7 + } + ] + }, + { + "text": "change state to ny", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "change b12 to 10", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change loanamount to 7500", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change b10 to 10", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change loanamount to 8000", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "change category to fast food", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "change c12 to 10", + "intent": "setCellNumberValue", + "entities": [ + { + "entity": "Cell", + "startPos": 1, + "endPos": 1 + } + ] + }, + { + "text": "set category to fast food", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Text", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "change category to coffee", + "intent": "setNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Text", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what is ?", + "intent": "None", + "entities": [ ] + }, + { + "text": "what is stringconstant", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is b1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is your name ?", + "intent": "None", + "entities": [ ] + }, + { + "text": "what is?", + "intent": "None", + "entities": [ ] + }, + { + "text": "what is in a10", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what is booleanconstant?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is hello?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is your name?", + "intent": "None", + "entities": [ ] + }, + { + "text": "what is b1 ?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is totalloancost", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is loan amount", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is in c25", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what is location_trey_research", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Name", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Name", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Name", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "what is in d3", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what is in c!", + "intent": "None", + "entities": [ ] + }, + { + "text": "what is in table1?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what is loanamout?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is in d2", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what is in b1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what is rc format", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is in b4?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what is in c5", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what is a2 ?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is active workbook?", + "intent": "getActiveWorkbook", + "entities": [ ] + }, + { + "text": "what workbook is open", + "intent": "getActiveWorkbook", + "entities": [ ] + }, + { + "text": "what is a2?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "well, what is it?", + "intent": "None", + "entities": [ ] + }, + { + "text": "what is in c2", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what is a3", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is a6", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is a1 ?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is cars", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is categories?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is numberofpayments", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is in b27?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what is c1 ?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is interestrate", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is cars?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is in table3", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what is loanamount", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is stringconstants?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is chartdata?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is vlookup?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is value g13", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what is anotherone?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is g3", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is loantotalcost", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is loanyears", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is in i89?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what is anotherone", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is a5", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is totalloanamount", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is doubleconstant?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is loanyears, totalloancost", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is total_interest", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Name", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "what is numberofpayments?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is in a1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what is first_category", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Name", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "what is 1 + 1?", + "intent": "None", + "entities": [ ] + }, + { + "text": "what is in e9", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what workbook is this", + "intent": "getActiveWorkbook", + "entities": [ ] + }, + { + "text": "what is in a4", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what is thisisacell?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is integerconstant?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is totalloancost?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is it now", + "intent": "getActiveCellValue", + "entities": [ ] + }, + { + "text": "what is a1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is 1 + 1", + "intent": "None", + "entities": [ ] + }, + { + "text": "what is interestrate?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is in e5", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what is in a3", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what is loanamount?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is the totalloancost", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what is transactions!b24", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "what is b1?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is b24", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is in a2", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 3, + "endPos": 3 + } + ] + }, + { + "text": "what is your naem", + "intent": "None", + "entities": [ ] + }, + { + "text": "what is june sales", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is maysales", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is loanyear", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is my credit limit", + "intent": "None", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is in cell b2", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "what is the active worlbook?", + "intent": "getActiveWorkbook", + "entities": [ ] + }, + { + "text": "what is the current workbook?", + "intent": "getActiveWorkbook", + "entities": [ ] + }, + { + "text": "what is in cell b2?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "what is the active workbook?", + "intent": "getActiveWorkbook", + "entities": [ ] + }, + { + "text": "what is value of a1", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "what is a1 and a2", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "what is value of k9", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "what is in cell a1?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "what is in my onedrive", + "intent": "None", + "entities": [ ] + }, + { + "text": "what is the active table?", + "intent": "None", + "entities": [ ] + }, + { + "text": "what is in row 1?", + "intent": "None", + "entities": [ ] + }, + { + "text": "excelbot, what is in b5", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "what is in a1:a3", + "intent": "None", + "entities": [ ] + }, + { + "text": "what is the value of b1?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "what is the value of a28?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "what is the value of onecount?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "what is the value of totalloancost", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "what is the value of thisisa1?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "what is the value of first_category", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Name", + "startPos": 6, + "endPos": 6 + }, + { + "entity": "Name", + "startPos": 7, + "endPos": 7 + } + ] + }, + { + "text": "what is the highest inventory value", + "intent": "None", + "entities": [ ] + }, + { + "text": "what is the value of cars", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "what is the value of interestrate?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "what is the value of d3", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "what is the value at b12", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "what is the value of c4", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "what is row 3 of table1?", + "intent": "None", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "what is the value of onechart?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "what is the value in c$?", + "intent": "None", + "entities": [ ] + }, + { + "text": "what is the value of totalinterest?", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "what is the value of a78?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "what is the value if a1?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "what is the value of g4?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "what is the value of b3?", + "intent": "getCellValue", + "entities": [ + { + "entity": "Cell", + "startPos": 5, + "endPos": 5 + } + ] + }, + { + "text": "switch to sales by region", + "intent": "selectWorksheet", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Name", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "switch to sheet1", + "intent": "selectWorksheet", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + } + ] + }, + { + "text": "switch to sheet no 4", + "intent": "selectWorksheet", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Name", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "what is trey_research", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Name", + "startPos": 4, + "endPos": 4 + } + ] + }, + { + "text": "value of location_trey_research", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Name", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Name", + "startPos": 5, + "endPos": 5 + }, + { + "entity": "Name", + "startPos": 6, + "endPos": 6 + } + ] + }, + { + "text": "get location_trey_research", + "intent": "getNamedItemValue", + "entities": [ + { + "entity": "Name", + "startPos": 1, + "endPos": 1 + }, + { + "entity": "Name", + "startPos": 2, + "endPos": 2 + }, + { + "entity": "Name", + "startPos": 3, + "endPos": 3 + }, + { + "entity": "Name", + "startPos": 4, + "endPos": 4 + }, + { + "entity": "Name", + "startPos": 5, + "endPos": 5 + } + ] + } + ] +} \ No newline at end of file diff --git a/ExcelBot/Model/ObjectType.cs b/ExcelBot/Model/ObjectType.cs new file mode 100644 index 0000000..a05af09 --- /dev/null +++ b/ExcelBot/Model/ObjectType.cs @@ -0,0 +1,20 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace ExcelBot.Model +{ + public enum ObjectType + { + Cell, + NamedItem, + Chart, + Table + } +} \ No newline at end of file diff --git a/ExcelBot/Model/UserData.cs b/ExcelBot/Model/UserData.cs new file mode 100644 index 0000000..7dbabba --- /dev/null +++ b/ExcelBot/Model/UserData.cs @@ -0,0 +1,17 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace ExcelBot.Model +{ + public class UserData + { + public string AuthResult { get; set; } + } +} \ No newline at end of file diff --git a/ExcelBot/Properties/AssemblyInfo.cs b/ExcelBot/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..524da8a --- /dev/null +++ b/ExcelBot/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ExcelBot")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ExcelBot")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("a8ba1066-5695-4d71-abb4-65e5a5e0c3d4")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ExcelBot/Web.Debug.config b/ExcelBot/Web.Debug.config new file mode 100644 index 0000000..f12b423 --- /dev/null +++ b/ExcelBot/Web.Debug.config @@ -0,0 +1,32 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/ExcelBot/Web.Release.config b/ExcelBot/Web.Release.config new file mode 100644 index 0000000..e450c08 --- /dev/null +++ b/ExcelBot/Web.Release.config @@ -0,0 +1,33 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/ExcelBot/Web.config b/ExcelBot/Web.config new file mode 100644 index 0000000..0bd6670 --- /dev/null +++ b/ExcelBot/Web.config @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ExcelBot/Workers/CellWorker.cs b/ExcelBot/Workers/CellWorker.cs new file mode 100644 index 0000000..c09de43 --- /dev/null +++ b/ExcelBot/Workers/CellWorker.cs @@ -0,0 +1,104 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Web; + +using Microsoft.Bot.Builder.Dialogs; + +using ExcelBot.Helpers; + +namespace ExcelBot.Workers +{ + public static class CellWorker + { + #region Get Cell Values + public static async Task DoGetCellValue(IDialogContext context) + { + var workbookId = context.UserData.Get("WorkbookId"); + var worksheetId = context.UserData.Get("WorksheetId"); + var cellAddress = context.UserData.Get("CellAddress"); + + await ReplyWithValue(context, workbookId, worksheetId, cellAddress); + } + #endregion + + #region Set Cell Values + public static async Task DoSetCellNumberValue(IDialogContext context, double value) + { + var workbookId = context.UserData.Get("WorkbookId"); + var worksheetId = context.UserData.Get("WorksheetId"); + var cellAddress = context.UserData.Get("CellAddress"); + + await SetCellValue(context, workbookId, worksheetId, cellAddress, value); + } + + public static async Task DoSetCellStringValue(IDialogContext context, string value) + { + var workbookId = context.UserData.Get("WorkbookId"); + var worksheetId = context.UserData.Get("WorksheetId"); + var cellAddress = context.UserData.Get("CellAddress"); + + await SetCellValue(context, workbookId, worksheetId, cellAddress, value); + } + + public static async Task DoSetCellValue(IDialogContext context, object value) + { + var workbookId = context.UserData.Get("WorkbookId"); + var worksheetId = context.UserData.Get("WorksheetId"); + var cellAddress = context.UserData.Get("CellAddress"); + + await SetCellValue(context, workbookId, worksheetId, cellAddress, value); + } + #endregion + + #region Helpers + public static async Task SetCellValue(IDialogContext context, string workbookId, string worksheetId, string cellAddress, object value) + { + try + { + var range = await ServicesHelper.ExcelService.UpdateRangeAsync( + workbookId, worksheetId, cellAddress, + new object[] { new object[] { value } }, + await ExcelHelper.GetSessionIdForUpdateAsync(context)); + await ServicesHelper.LogExcelServiceResponse(context); + + await context.PostAsync($"**{cellAddress}** is now **{range.Text[0][0]}**"); + } + catch (Exception ex) + { + await context.PostAsync($"Sorry, something went wrong setting the value of **{cellAddress}** to **{value.ToString()}** ({ex.Message})"); + } + } + + public static async Task ReplyWithValue(IDialogContext context, string workbookId, string worksheetId, string cellAddress) + { + try + { + var range = await ServicesHelper.ExcelService.GetRangeAsync( + workbookId, worksheetId, cellAddress, + ExcelHelper.GetSessionIdForRead(context)); + await ServicesHelper.LogExcelServiceResponse(context); + + if ((string)(range.ValueTypes[0][0]) != "Empty") + { + await context.PostAsync($"**{cellAddress}** is **{range.Text[0][0]}**"); + } + else + { + await context.PostAsync($"**{cellAddress}** is empty"); + } + } + catch (Exception ex) + { + await context.PostAsync($"Sorry, something went wrong getting the value of **{cellAddress}** ({ex.Message})"); + } + } + #endregion + } +} \ No newline at end of file diff --git a/ExcelBot/Workers/ChartsWorker.cs b/ExcelBot/Workers/ChartsWorker.cs new file mode 100644 index 0000000..73385cc --- /dev/null +++ b/ExcelBot/Workers/ChartsWorker.cs @@ -0,0 +1,122 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web; + +using Microsoft.Bot.Builder.Dialogs; +using Microsoft.Bot.Connector; + +using Microsoft.ExcelServices; + +using ExcelBot.Helpers; + +namespace ExcelBot.Workers +{ + public static class ChartsWorker + { + #region List Charts + public static async Task DoListCharts(IDialogContext context) + { + var workbookId = context.UserData.Get("WorkbookId"); + var worksheetId = context.UserData.Get("WorksheetId"); + + try + { + var charts = await ServicesHelper.ExcelService.ListChartsAsync( + workbookId, worksheetId, + ExcelHelper.GetSessionIdForRead(context)); + await ServicesHelper.LogExcelServiceResponse(context); + + if (charts.Length > 0) + { + var reply = new StringBuilder(); + + if (charts.Length == 1) + { + reply.Append($"There is **1** chart on **{worksheetId}**:\n"); + } + else + { + reply.Append($"There are **{charts.Length}** on **{worksheetId}**:\n"); + } + + foreach (var chart in charts) + { + reply.Append($"* **{chart.Name}**\n"); + } + await context.PostAsync(reply.ToString()); + } + else + { + await context.PostAsync($"There are no charts on {worksheetId}"); + } + } + catch (Exception ex) + { + await context.PostAsync($"Sorry, something went wrong getting the charts ({ex.Message})"); + } + } + #endregion + #region Get the Image of a Chart + public static async Task DoGetChartImage(IDialogContext context) + { + var workbookId = context.UserData.Get("WorkbookId"); + var worksheetId = context.UserData.Get("WorksheetId"); + var name = context.UserData.Get("ChartName"); + + // Get the chart + var chart = await GetChart(context, workbookId, worksheetId, name); + if (chart != null) + { + await ReplyWithChart(context, workbookId, worksheetId, chart); + } + else + { + await context.PostAsync($"**{name}** is not a chart on **{worksheetId}**"); + } + } + #endregion + + #region Helpers + // Lookup a name assuming that it is named item, return null if it doesn't exist + public static async Task GetChart(IDialogContext context, string workbookId, string worksheetId, string name) + { + Chart chart = null; + try + { + chart = await ServicesHelper.ExcelService.GetChartAsync( + workbookId, worksheetId, name, + ExcelHelper.GetSessionIdForRead(context)); + await ServicesHelper.LogExcelServiceResponse(context); + } + catch + { + } + return chart; + } + + public static async Task ReplyWithChart(IDialogContext context, string workbookId, string worksheetId, Chart chart) + { + try + { + var reply = context.MakeMessage(); + reply.To.Id = (reply.To.Id != null) ? reply.To.Id : (string)(HttpContext.Current.Items["UserId"]); + reply.Attachments = new List(); + reply.Attachments.Add(new Attachment() { ContentType = "image/png", ContentUrl = $"{RequestHelper.RequestUri.Scheme}://{RequestHelper.RequestUri.Authority}/api/{reply.To.ChannelId}/{reply.ConversationId}/{reply.To.Id}/{workbookId}/{worksheetId.Replace(" ", "%20")}/{chart.Name.Replace(" ","%20")}/image" }); + await context.PostAsync(reply); + } + catch (Exception ex) + { + await context.PostAsync($"Sorry, something went wrong getting the **{chart.Name}** chart ({ex.Message})"); + } + } + #endregion + } +} \ No newline at end of file diff --git a/ExcelBot/Workers/NamedItemsWorker.cs b/ExcelBot/Workers/NamedItemsWorker.cs new file mode 100644 index 0000000..50631ae --- /dev/null +++ b/ExcelBot/Workers/NamedItemsWorker.cs @@ -0,0 +1,304 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web; + +using Microsoft.Bot.Builder.Dialogs; + +using Microsoft.ExcelServices; + +using ExcelBot.Helpers; +using ExcelBot.Model; + +namespace ExcelBot.Workers +{ + public static class NamedItemsWorker + { + #region List Named Items + public static async Task DoListNamedItems(IDialogContext context) + { + var workbookId = context.UserData.Get("WorkbookId"); + + try + { + var namedItems = await ServicesHelper.ExcelService.ListNamedItemsAsync( + workbookId, + ExcelHelper.GetSessionIdForRead(context)); + await ServicesHelper.LogExcelServiceResponse(context); + + if (namedItems.Length > 0) + { + var reply = new StringBuilder(); + + if (namedItems.Length == 1) + { + reply.Append($"There is **1** named item in the workbook:\n"); + } + else + { + reply.Append($"There are **{namedItems.Length}** named items in the workbook:\n"); + } + + foreach (var namedItem in namedItems) + { + reply.Append($"* **{namedItem.Name}**\n"); + } + await context.PostAsync(reply.ToString()); + } + else + { + await context.PostAsync($"There are no named items in the workbook"); + } + } + catch (Exception ex) + { + await context.PostAsync($"Sorry, something went wrong getting the named items ({ex.Message})"); + } + } + #endregion + + #region Get Value of Named Item + public static async Task DoGetNamedItemValue(IDialogContext context) + { + var workbookId = context.UserData.Get("WorkbookId"); + var worksheetId = context.UserData.Get("WorksheetId"); + var name = context.UserData.Get("Name"); + var type = context.UserData.Get("Type"); + + // Check if the name refers to a cell + if (type == ObjectType.Cell) + { + await CellWorker.ReplyWithValue(context, workbookId, worksheetId, name); + } + else + { + // Check if the name refers to a named item + var namedItem = await GetNamedItem(context, workbookId, name); + if (namedItem != null) + { + context.UserData.SetValue("Type", ObjectType.NamedItem); + await ReplyWithValue(context, workbookId, namedItem); + } + else + { + // Check if the name refers to a chart + var chart = await ChartsWorker.GetChart(context, workbookId, worksheetId, name); + if (chart != null) + { + context.UserData.SetValue("Type", ObjectType.Chart); + await ChartsWorker.ReplyWithChart(context, workbookId, worksheetId, chart); + } + else + { + // Check if the name refers to a table + var table = await TablesWorker.GetTable(context, workbookId, name); + if (table != null) + { + context.UserData.SetValue("TableName", name); + context.UserData.SetValue("Type", ObjectType.Table); + await TablesWorker.ReplyWithTable(context, workbookId, table); + } + else + { + await context.PostAsync($"**{name}** is not a named item, chart or table in the workbook"); + } + } + } + } + } + #endregion + + #region Set Value of Named Item + public static async Task DoSetNamedItemValue(IDialogContext context, object value) + { + var workbookId = context.UserData.Get("WorkbookId"); + var type = context.UserData.Get("Type"); + var name = context.UserData.Get("Name"); + + switch (type) + { + case ObjectType.Cell: + var worksheetId = context.UserData.Get("WorksheetId"); + await CellWorker.SetCellValue(context, workbookId, worksheetId, name, value); + break; + case ObjectType.NamedItem: + await SetNamedItemValue(context, workbookId, name, value); + break; + case ObjectType.Chart: + await context.PostAsync($"I am not able to set the value of **{name}** because it is a chart"); + break; + case ObjectType.Table: + var tableName = context.UserData.Get("TableName"); + + int? rowIndex = null; + context.UserData.TryGetValue("RowIndex", out rowIndex); + + if (rowIndex != null) + { + await TablesWorker.SetColumnValue(context, workbookId, tableName, name, (int)rowIndex, value); + } + else + { + await context.PostAsync($"I need to know about a specific table row to set the value of one of the columns. Ask me to look up a table row first"); + } + break; + } + } + #endregion + + #region Helpers + // Lookup a name assuming that it is named item, return null if it doesn't exist + public static async Task GetNamedItem(IDialogContext context, string workbookId, string name) + { + NamedItem[] namedItems = null; + try + { + namedItems = await ServicesHelper.ExcelService.ListNamedItemsAsync( + workbookId, + ExcelHelper.GetSessionIdForRead(context)); + await ServicesHelper.LogExcelServiceResponse(context); + } + catch + { + } + return namedItems?.FirstOrDefault(n => n.Name.ToLower() == name.ToLower()); + } + + public static async Task SetNamedItemValue(IDialogContext context, string workbookId, string name, object value) + { + try + { + var namedItem = await GetNamedItem(context, workbookId, name); + if (namedItem != null) + { + switch (namedItem.Type) + { + case "Range": + var range = await ServicesHelper.ExcelService.NamedItemRangeAsync( + workbookId, namedItem.Name, + ExcelHelper.GetSessionIdForRead(context)); + await ServicesHelper.LogExcelServiceResponse(context); + + if ((range.RowCount == 1) && (range.ColumnCount == 1)) + { + // Named item points to a single cell + try + { + range = await ServicesHelper.ExcelService.UpdateRangeAsync( + workbookId, ExcelHelper.GetWorksheetName(range.Address), ExcelHelper.GetCellAddress(range.Address), + new object[] { new object[] { value } }, + await ExcelHelper.GetSessionIdForUpdateAsync(context)); + await ServicesHelper.LogExcelServiceResponse(context); + + await context.PostAsync($"**{namedItem.Name}** is now **{range.Text[0][0]}**"); + } + catch (Exception ex) + { + await context.PostAsync($"Sorry, something went wrong setting the value of **{namedItem.Name}** to **{value}** ({ex.Message})"); + } + } + else + { + await context.PostAsync($"Sorry, I can't set the value of **{namedItem.Name}** since it is a range of cells"); + } + break; + case "String": + case "Boolean": + case "Integer": + case "Double": + await context.PostAsync($"Sorry, I am not able to set the value of **{namedItem.Name}** since it is a constant"); + break; + default: + await context.PostAsync($"Sorry, I am not able to set the value of **{namedItem.Name}** ({namedItem.Type}, {namedItem.Value})"); + break; + } + } + else + { + await context.PostAsync($"**{name}** is not a named item in the workbook"); + } + } + catch (Exception ex) + { + await context.PostAsync($"Sorry, something went wrong setting the value of **{name}** ({ex.Message})"); + } + } + + public static async Task ReplyWithValue(IDialogContext context, string workbookId, NamedItem namedItem) + { + try + { + switch (namedItem.Type) + { + case "Range": + var range = await ServicesHelper.ExcelService.NamedItemRangeAsync( + workbookId, namedItem.Name, + ExcelHelper.GetSessionIdForRead(context)); + await ServicesHelper.LogExcelServiceResponse(context); + + if ((range.RowCount == 1) && (range.ColumnCount == 1)) + { + // Named item points to a single cell + if ((string)(range.ValueTypes[0][0]) != "Empty") + { + await context.PostAsync($"**{namedItem.Name}** is **{range.Text[0][0]}**"); + } + else + { + await context.PostAsync($"**{namedItem.Name}** is empty"); + } + } + else + { + // Named item points to a range with multiple cells + var reply = $"**{namedItem.Name}** has these values:\n\n{GetRangeReply(range)}"; + await context.PostAsync(reply); + } + break; + case "String": + case "Boolean": + case "Integer": + case "Double": + await context.PostAsync($"**{namedItem.Name}** is **{namedItem.Value}**"); + break; + default: + await context.PostAsync($"Sorry, I am not able to determine the value of **{namedItem.Name}** ({namedItem.Type}, {namedItem.Value})"); + break; + } + } + catch (Exception ex) + { + await context.PostAsync($"Sorry, something went wrong getting the value of **{namedItem.Name}** ({ex.Message})"); + } + } + + public static string GetRangeReply(Range range) + { + var newLine = ""; + var valuesString = new StringBuilder(); + + foreach (var row in (object[])range.Text) + { + valuesString.Append(newLine); + newLine = "\n"; + + var separator = ""; + valuesString.Append("* "); + foreach (var column in (object[])row) + { + valuesString.Append($"{separator}{column.ToString()}"); + separator = ", "; + } + } + return valuesString.ToString(); + } + #endregion + } +} \ No newline at end of file diff --git a/ExcelBot/Workers/TablesWorker.cs b/ExcelBot/Workers/TablesWorker.cs new file mode 100644 index 0000000..5188038 --- /dev/null +++ b/ExcelBot/Workers/TablesWorker.cs @@ -0,0 +1,286 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web; + +using Microsoft.Bot.Builder.Dialogs; + +using Microsoft.ExcelServices; + +using ExcelBot.Helpers; + +namespace ExcelBot.Workers +{ + public static class TablesWorker + { + #region List Tables + public static async Task DoListTables(IDialogContext context) + { + var workbookId = context.UserData.Get("WorkbookId"); + + try + { + var tables = await ServicesHelper.ExcelService.ListTablesAsync( + workbookId, + ExcelHelper.GetSessionIdForRead(context)); + await ServicesHelper.LogExcelServiceResponse(context); + + if (tables.Length > 0) + { + var reply = new StringBuilder(); + + if (tables.Length == 1) + { + reply.Append($"There is **1** table in the workbook:\n"); + } + else + { + reply.Append($"There are **{tables.Length}** tables in the workbook:\n"); + } + + foreach (var table in tables) + { + reply.Append($"* **{table.Name}**\n"); + } + await context.PostAsync(reply.ToString()); + } + else + { + await context.PostAsync($"There are no tables in the workbook"); + } + } + catch (Exception ex) + { + await context.PostAsync($"Sorry, something went wrong getting the tables ({ex.Message})"); + } + } + #endregion + + #region Lookup Table Row + public static async Task DoLookupTableRow(IDialogContext context, string value) + { + var workbookId = context.UserData.Get("WorkbookId"); + + string tableName = string.Empty; + context.UserData.TryGetValue("TableName", out tableName); + + try + { + if ((tableName != null) && (tableName != string.Empty)) + { + Table table = null; + + try + { + table = await ServicesHelper.ExcelService.GetTableAsync( + workbookId, tableName, + ExcelHelper.GetSessionIdForRead(context)); + await ServicesHelper.LogExcelServiceResponse(context); + } + catch + { + } + + if (table != null) + { + if ((value != null) && (value != string.Empty)) + { + var range = await ServicesHelper.ExcelService.GetTableDataBodyRangeAsync( + workbookId, tableName, + ExcelHelper.GetSessionIdForRead(context)); + + + if ((range != null) && (range.RowCount > 0)) + { + var lowerValue = value.ToLower(); + var rowIndex = -1; + var columnIndex = 0; + + while ((rowIndex < 0) && (columnIndex < range.ColumnCount)) + { + // Look for a full match in the first column of the table + rowIndex = range.Text.IndexOf(r => (((string)(r[columnIndex])).ToLower() == lowerValue)); + if (rowIndex >= 0) + { + break; + } + else + { + // Look for a partial match in the first column of the table + rowIndex = range.Text.IndexOf(r => (((string)(r[columnIndex])).ToLower().Contains(lowerValue))); + if (rowIndex >= 0) + { + break; + } + } + ++columnIndex; + } + if (rowIndex >= 0) + { + context.UserData.SetValue("RowIndex", rowIndex); + await ReplyWithTableRow(context, workbookId, table, range.Text[rowIndex]); + } + else + { + await context.PostAsync($"**{value}** is not in **{table.Name}**"); + } + } + else + { + await context.PostAsync($"**{table.Name}** doesn't have any rows"); + } + } + else + { + await context.PostAsync($"Need a value to look up a row in **{table.Name}**"); + } + } + else + { + await context.PostAsync($"**{tableName}** is not a table in the workbook"); + } + } + else + { + await context.PostAsync($"Need the name of a table to look up a row"); + } + } + catch (Exception ex) + { + await context.PostAsync($"Sorry, something went wrong looking up the table row ({ex.Message})"); + } + } + #endregion + + #region Helpers + // Lookup a name assuming that it is named item, return null if it doesn't exist + public static async Task GetTable(IDialogContext context, string workbookId, string name) + { + Table table = null; + try + { + table = await ServicesHelper.ExcelService.GetTableAsync( + workbookId, name, + ExcelHelper.GetSessionIdForRead(context)); + await ServicesHelper.LogExcelServiceResponse(context); + } + catch + { + } + return table; + } + + public static async Task SetColumnValue(IDialogContext context, string workbookId, string tableName, string name, int rowIndex, object value) + { + // Get the table + var table = await ServicesHelper.ExcelService.GetTableAsync( + workbookId, tableName, + ExcelHelper.GetSessionIdForRead(context)); + + if ((bool)(table.ShowHeaders)) + { + // Get the table header + var header = await ServicesHelper.ExcelService.GetTableHeaderRowRangeAsync( + workbookId, tableName, + ExcelHelper.GetSessionIdForRead(context)); + await ServicesHelper.LogExcelServiceResponse(context); + + // Find the column + var lowerName = name.ToLower(); + var columnIndex = header.Text[0].IndexOf(h => h.ToString().ToLower() == lowerName); + if (columnIndex >= 0) + { + var dataBodyRange = await ServicesHelper.ExcelService.GetTableDataBodyRangeAsync(workbookId, tableName, ExcelHelper.GetSessionIdForRead(context), "$select=columnIndex, rowIndex, rowCount, address"); + var rowAddress = ExcelHelper.GetRangeAddress( + (int)(dataBodyRange.ColumnIndex) + columnIndex, + (int)(dataBodyRange.RowIndex) + rowIndex, + 1, + 1 + ); + + var range = await ServicesHelper.ExcelService.UpdateRangeAsync( + workbookId, + ExcelHelper.GetWorksheetName(dataBodyRange.Address), + rowAddress, + new object[] { new object[] { value } }, + await ExcelHelper.GetSessionIdForUpdateAsync(context) + ); + await ServicesHelper.LogExcelServiceResponse(context); + + await context.PostAsync($"**{header.Text[0][columnIndex]}** is now **{range.Text[0][0]}**"); + } + else + { + await context.PostAsync($"**{name}** is not a column in **{table.Name}**"); + } + } + else + { + await context.PostAsync($"I cannot set values in **{table.Name}** because it does not have any headers"); + } + } + + + public static async Task ReplyWithTable(IDialogContext context, string workbookId, Table table) + { + try + { + var range = await ServicesHelper.ExcelService.GetTableRangeAsync( + workbookId, table.Id, + ExcelHelper.GetSessionIdForRead(context)); + await ServicesHelper.LogExcelServiceResponse(context); + + var reply = $"**{table.Name}**\n\n{NamedItemsWorker.GetRangeReply(range)}"; + await context.PostAsync(reply); + } + catch (Exception ex) + { + await context.PostAsync($"Sorry, something went wrong getting the **{table.Name}** table ({ex.Message})"); + } + } + + public static async Task ReplyWithTableRow(IDialogContext context, string workbookId, Table table, object[] row) + { + if ((bool)(table.ShowHeaders)) + { + // Get the table header + var header = await ServicesHelper.ExcelService.GetTableHeaderRowRangeAsync( + workbookId, table.Id, + ExcelHelper.GetSessionIdForRead(context)); + await ServicesHelper.LogExcelServiceResponse(context); + + + var reply = new StringBuilder(); + var separator = ""; + for (var i = 0; i < row.Length; i++) + { + if ((row[i] != null) && (((string)row[i]) != string.Empty)) + { + reply.Append($"{separator}* {header.Text[0][i]}: **{row[i]}**"); + separator = "\n"; + } + } + await context.PostAsync(reply.ToString()); + } + else + { + var reply = new StringBuilder(); + var separator = ""; + for (var i = 0; i < row.Length; i++) + { + reply.Append($"{separator}* **{row[i]}**"); + separator = "\n"; + } + await context.PostAsync(reply.ToString()); + } + } + #endregion + } +} diff --git a/ExcelBot/Workers/WorkbookWorker.cs b/ExcelBot/Workers/WorkbookWorker.cs new file mode 100644 index 0000000..14df730 --- /dev/null +++ b/ExcelBot/Workers/WorkbookWorker.cs @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Web; + +using Microsoft.Bot.Builder.Dialogs; + +using ExcelBot.Helpers; + +namespace ExcelBot.Workers +{ + public static class WorkbookWorker + { + public static async Task DoOpenWorkbookAsync(IDialogContext context, string workbookName) + { + try + { + // Add extension to filename, if needed + var filename = workbookName.ToLower(); + if (!(filename.EndsWith(".xlsx"))) + { + filename = $"{filename}.xlsx"; + } + + // Get meta data for the workbook + var item = await ServicesHelper.OneDriveService.GetItemMetadataAsync("", filename); + await ServicesHelper.LogOneDriveServiceResponse(context); + + context.UserData.SetValue("WorkbookId", item.Id); + context.ConversationData.SetValue("WorkbookName", item.Name); + context.ConversationData.SetValue("WorkbookWebUrl", item.WebUrl); + + context.UserData.RemoveValue("Type"); + context.UserData.RemoveValue("Name"); + context.UserData.RemoveValue("CellAddress"); + context.UserData.RemoveValue("TableName"); + context.UserData.RemoveValue("RowIndex"); + + // Get the first worksheet in the workbook + var worksheets = await ServicesHelper.ExcelService.ListWorksheetsAsync( + item.Id, + ExcelHelper.GetSessionIdForRead(context), + "$top=1"); + + context.UserData.SetValue("WorksheetId", worksheets[0].Name); + + // Respond + await context.PostAsync($"We are ready to work with **{worksheets[0].Name}** in {ExcelHelper.GetWorkbookLinkMarkdown(context)}"); + } + catch (Exception ex) + { + await context.PostAsync($"Sorry, something went wrong when I tried to open the **{workbookName}** workbook on your OneDrive for Business ({ex.Message})"); + } + } + + public static async Task DoGetActiveWorkbookAsync(IDialogContext context) + { + await context.PostAsync($"We are working with the {ExcelHelper.GetWorkbookLinkMarkdown(context)} workbook"); + } + } +} \ No newline at end of file diff --git a/ExcelBot/Workers/WorksheetWorker.cs b/ExcelBot/Workers/WorksheetWorker.cs new file mode 100644 index 0000000..6985529 --- /dev/null +++ b/ExcelBot/Workers/WorksheetWorker.cs @@ -0,0 +1,133 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. + * See LICENSE in the project root for license information. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Web; +using System.Text; + +using Microsoft.Bot.Builder.Dialogs; + +using Microsoft.ExcelServices; + +using ExcelBot.Helpers; + +namespace ExcelBot.Workers +{ + public static class WorksheetWorker + { + #region List Worksheets + public static async Task DoListWorksheetsAsync(IDialogContext context) + { + var workbookId = context.UserData.Get("WorkbookId"); + var worksheetId = context.UserData.Get("WorksheetId"); + + try + { + var worksheets = await ServicesHelper.ExcelService.ListWorksheetsAsync( + workbookId, + ExcelHelper.GetSessionIdForRead(context)); + await ServicesHelper.LogExcelServiceResponse(context); + + var reply = new StringBuilder(); + + if (worksheets.Length == 1) + { + reply.Append($"There is **1** worksheet in the workbook:\n"); + } + else + { + reply.Append($"There are **{worksheets.Length}** worksheets in the workbook:\n"); + } + + var active = ""; + foreach (var worksheet in worksheets) + { + active = (worksheet.Name.ToLower() == worksheetId.ToLower()) ? " (active)" : ""; + reply.Append($"* **{worksheet.Name}**{active}\n"); + } + await context.PostAsync(reply.ToString()); + } + catch (Exception ex) + { + await context.PostAsync($"Sorry, something went wrong getting the worksheets ({ex.Message})"); + } + } + #endregion + + #region Select Worksheet + public static async Task DoSelectWorksheetAsync(IDialogContext context, string worksheetName) + { + try + { + var workbookId = context.UserData.Get("WorkbookId"); + var worksheetId = context.UserData.Get("WorksheetId"); + + // Check if we are already working with the new worksheet + if (worksheetName.ToLower() == worksheetId.ToLower()) + { + await context.PostAsync($"We are already working with the **{worksheetId}** worksheet"); + return; + } + + // Check if the new worksheet exist + var worksheets = await ServicesHelper.ExcelService.ListWorksheetsAsync( + workbookId, + ExcelHelper.GetSessionIdForRead(context)); + await ServicesHelper.LogExcelServiceResponse(context); + + var lowerWorksheetName = worksheetName.ToLower(); + var worksheet = worksheets.FirstOrDefault(w => w.Name.ToLower() == lowerWorksheetName); + if (worksheet == null) + { + await context.PostAsync($@"**{worksheetName}** is not a worksheet in the workbook. Type ""select worksheet"" to select the worksheet from a list"); + return; + } + + // Save the worksheet id + context.UserData.SetValue("WorksheetId", worksheet.Name); + + // Respond + await context.PostAsync($"We are ready to work with the **{worksheet.Name}** worksheet"); + } + catch (Exception ex) + { + await context.PostAsync($"Sorry, something went wrong selecting the {worksheetName} worksheet ({ex.Message})"); + } + } + #endregion + + #region Get Active Worksheet + public static async Task DoGetActiveWorksheetAsync(IDialogContext context) + { + var worksheetId = context.UserData.Get("WorksheetId"); + + // Respond + await context.PostAsync($"We are on the **{worksheetId}** worksheet"); + } + #endregion + + #region Helpers + public async static Task GetWorksheetNamesAsync(IDialogContext context, string workbookId) + { + try + { + var worksheets = await ServicesHelper.ExcelService.ListWorksheetsAsync( + workbookId, + ExcelHelper.GetSessionIdForRead(context)); + await ServicesHelper.LogExcelServiceResponse(context); + + return worksheets.Select(w => w.Name).ToArray(); + } + catch (Exception) + { + return new string[] { }; + } + } + #endregion + } +} \ No newline at end of file diff --git a/ExcelBot/chat.htm b/ExcelBot/chat.htm new file mode 100644 index 0000000..de7b964 --- /dev/null +++ b/ExcelBot/chat.htm @@ -0,0 +1,24 @@ + + + + + + Excel Bot + + + + +
+ +
+ + diff --git a/ExcelBot/default.htm b/ExcelBot/default.htm new file mode 100644 index 0000000..3029a13 --- /dev/null +++ b/ExcelBot/default.htm @@ -0,0 +1,24 @@ + + + + + + + + + + +

ExcelBot

+

Describe your bot here and your terms of use etc.

+

Visit Bot Framework to register your bot. When you register it, remember to set your bot's endpoint to

https://your_bots_hostname/api/messages

+ + diff --git a/ExcelBot/loggedin.htm b/ExcelBot/loggedin.htm new file mode 100644 index 0000000..6423f61 --- /dev/null +++ b/ExcelBot/loggedin.htm @@ -0,0 +1,23 @@ + + + + + + Excel Bot + + + + +

Sign-in Successful

+

You can now chat with the bot.

+ + diff --git a/ExcelBot/packages.config b/ExcelBot/packages.config new file mode 100644 index 0000000..888fc6d --- /dev/null +++ b/ExcelBot/packages.config @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0125905 --- /dev/null +++ b/LICENSE @@ -0,0 +1,26 @@ +Microsoft-Graph-Bot-Framework-CSharp-ExcelBot-Rest-Sample + +Copyright (c) Microsoft Corporation. All rights reserved. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..59d6847 --- /dev/null +++ b/README.md @@ -0,0 +1,48 @@ +# Excel Bot + +Excel Bot is a sample that demonstrates how to use the [Microsoft Graph](https://graph.microsoft.io) and specifically the [Excel REST API](https://graph.microsoft.io/en-us/docs/api-reference/v1.0/resources/excel) to access Excel workbooks stored in OneDrive for Business through a conversational user interface. It is written in C# and it uses the [Microsoft Bot Framework](https://dev.botframework.com/) and the [Language Understanding Intelligent Service (LUIS)](https://www.luis.ai/). + +*Note*: The code in this sample was originally written for a user experience prototype and does not necessarily demonstrate how to create production quality code. + +## Prerequisites ## + +This sample requires the following: + + * Visual Studio 2015 with Update 3 + * An Office 365 for business account. You can sign up for an [Office 365 Developer subscription](https://msdn.microsoft.com/en-us/office/office365/howto/setup-development-environment) that includes the resources that you need to start building Office 365 apps. + +## Getting started ## + +Complete the these steps to setup your development environment to build and test the Excel bot: + + * Clone this repo to a local folder + * Clone the [Excel REST API Explorer](https://github.com/microsoftgraph/uwp-csharp-excel-snippets-rest-sample) sample to the same folder. Excel Bot uses a library in the Excel REST API Explorer project to make the REST API calls to the Microsoft Graph. + * Open the ExcelBot.sln solution file + * Register the bot in the [Bot Framework](https://dev.botframework.com/bots/new) + * Copy the the bot AppId and AppSecret to the Web.config file + * [Register the bot to call the Microsoft Graph](http://dev.office.com/app-registration) + * Copy the Azure Active Directory Client Id and Secret to the Web.config file + * Create a new model in the [LUIS](http://luis.ai) service + * Import the LUIS\excelbot.json file into LUIS + * Train and publish the LUIS model + * Copy the LUIS model id and subscription key to the Dialogs\ExcelBotDialog.cs file + * (Optional) Enable Web Chat for the bot in the Bot Framework and copy the Web Chat embed template the chat.htm file + * (Optional) To get the bot to send telemetry to [Visual Studio Application Insights](https://azure.microsoft.com/en-us/services/application-insights/), copy the instrumentation key to the following files: ApplicationInsights.config, default.htm, loggedin.htm, chat.htm + * Build the solution + * Press F5 to start the bot locally + * Test the bot locally with the [Bot Framework Emulator](https://docs.botframework.com/en-us/tools/bot-framework-emulator) + * Create a web app in Azure + * Replace the bots host name in the Web.config file + * Publish the solution to the Azure web app + * Test the deployed bot using the Web Chat control by browsing to the chat.htm page + +## Give us your feedback + +Your feedback is important to us. + +Check out the sample code and let us know about any questions and issues you find by [submitting an issue](https://github.com/microsoftgraph/botframework-csharp-excelbot-rest-sample/issues) directly in this repository. Provide repro steps, console output, and error messages in any issue you open. + +## Copyright + +Copyright (c) 2016 Microsoft. All rights reserved. +