General Requirements for a V0 Arcade Chat bot for ArcGIS Pro.
Description
The goal is to create a chatbot that is embedded in ArcGIS Pro. In V0 of the bot, it will help you write arcade expressions for popups.
General Requirements
- Nice UI that allows the user to talk back and forth with the bot (this should match the Pro UI but not look like WPF/windows from the 2000s...)
- Code coming from the bot (or the user) (enclosed in either "```" or "`") should be highlighted as appropriate.
- Code highlighting should only highlight for "arcade" even if the bot declares the language as something else (javascript is an acceptable default for starting out)
- User should be able to get the code out by clicking a button to copy the code block
- A button that the user can press to get the code into an Arcade Editor (see Arcade Editor section for more thoughts)
- The Context sent with each request should be updated using the current list of layers in the map (basically, the user could add or remove a layer at any time, and we should be aware that happened)
- The context sent with each request should contain a "current" layer, either by the current layer highlighted in the TOC, or via a dropdown or other selector in the chatbot window. We had some discussion about this being a popup, but I don't think that we want to do that with each chat submission. An advanced user might manipulate the script via the bot a couple of times before using the code. Selecting it from a dropdown also helps with the Arcade editor section as well since we'll know what layer we are working on. The layer selected in the TOC is probably too fragile to work well here.
- A button to reset the entire chat. (this would just clear the chat history) We also don't need/want to keep history right now.
Other Optional things we have talked about
- Having a "get a person to help me" button. We don't need that right now since we have no way to support it. Maybe we can throw it in to the demo as a placeholder and I can see how it goes over at the UC, but we wouldn't want to actually implement that right now.
Arcade Editor
For this V0, we are only focusing on using Arcade to generate a "text" output in a popup. There are several different incarnations of Aracde that we might try to support in the future, but we'll stick with this one for now.
When you edit the popup for a layer (right-click in the TOC and click Configure Popups) you are on this screen on the right side of the app. It is from here that you would likely use our bot, so the location of the bot should be flexible enough to help you move around.

In this example, I have already clicked on Arcade -> Text Template to create an empty template.
Clicking on the pencil on that arcade row that was created takes me here:

This is where the code would need to go.
So, one way this could work is:
- The user asks the bot a question
- The user likes the code, and clicks a button on that code
- The app would open the popup editor for the selected layer
- The app would add a new Arcade Text template to the popup
- The app would add the code from the bot to that template (replacing the template code, if it is there)
- Open the Edit UI so the user is looking at the code the bot just generated in an editor that they can click preview on or edit, etc. like they had written it themselves.
This is likely not the only way this could work, but it is a nice, integrated solution that makes the bot immediately useful for people using Arcade in Pro a lot.
Issues I know of
- I don't know how easy/hard it will be to invoke these Pro dialogs. It is my impression that we are able to invoke any dialog in the app, but finding how to do that, might be challenging.
- Max length of a chat - The GPT API can only handle about 4000 tokens (in and out combined) so it's possible that we get to a size where the API just says no. I want to just ignore this problem for now. I'm hoping the azure tools have some ways to help us with this. But we shall see. There are several ways for us to get around this issue in the future from adding memory to the bot to just removing the oldest chat messages (which is obviously the easiest).
Other Arcade Types
Arcade gets used a lot in Pro, and in AGOL. Likely a next stop would be arcade expressions in ArcGIS Online, but once we get the pro one working, let's loop in the GIS team and get feedback before we try to make it work in a wider way. Also, this is a good working example for me to use to demo at the UC (I mean this Arcade for popups bot).
A Python version
The next easy step (I think) will be to build a version of this that works for the Python console window. I think it might be easier than the rest of this b/c it would just have to copy the code to the console so the user can press enter to run it, or edit it. However this will require the AI bot being smarter (needing to look up Python/ArcGIS package docs, which will be much easier to achieve with the Azure AI studio stuff instead of having to write all that from the ground up ourselves. So for now, we'll stay away from this.
General Requirements for a V0 Arcade Chat bot for ArcGIS Pro.
Description
The goal is to create a chatbot that is embedded in ArcGIS Pro. In V0 of the bot, it will help you write arcade expressions for popups.
General Requirements
Other Optional things we have talked about
Arcade Editor
For this V0, we are only focusing on using Arcade to generate a "text" output in a popup. There are several different incarnations of Aracde that we might try to support in the future, but we'll stick with this one for now.
When you edit the popup for a layer (right-click in the TOC and click
Configure Popups) you are on this screen on the right side of the app. It is from here that you would likely use our bot, so the location of the bot should be flexible enough to help you move around.In this example, I have already clicked on Arcade -> Text Template to create an empty template.
Clicking on the pencil on that arcade row that was created takes me here:

This is where the code would need to go.
So, one way this could work is:
This is likely not the only way this could work, but it is a nice, integrated solution that makes the bot immediately useful for people using Arcade in Pro a lot.
Issues I know of
Other Arcade Types
Arcade gets used a lot in Pro, and in AGOL. Likely a next stop would be arcade expressions in ArcGIS Online, but once we get the pro one working, let's loop in the GIS team and get feedback before we try to make it work in a wider way. Also, this is a good working example for me to use to demo at the UC (I mean this Arcade for popups bot).
A Python version
The next easy step (I think) will be to build a version of this that works for the Python console window. I think it might be easier than the rest of this b/c it would just have to copy the code to the console so the user can press enter to run it, or edit it. However this will require the AI bot being smarter (needing to look up Python/ArcGIS package docs, which will be much easier to achieve with the Azure AI studio stuff instead of having to write all that from the ground up ourselves. So for now, we'll stay away from this.