Theia AI Sneak Preview: Transparent variables and tool functions

September 23, 2024 | 6 min Read

For AI-assisted tools and IDEs, variables and tool functions play an essential role in enhancing the context and enabling dynamic interactions with the tools at hand. Variables allow AI agents to augment the context of user requests, e.g. with the content of a file. Tool functions serve as the bridge between the AI and the tools it operates, they allow the AI to request information, invoke actions or manipulate data in the tool. Despite their significance, many existing solutions suffer from a lack of control in their use of variables and functions, leaving tool builders and end users uncertain about how data is handled and how the AI interacts with their tools.

In this article we provide a sneak preview about Theia AI, a flexible and open AI framework for building AI-assistance for tools and IDEs. We will highlight one of the core capabilities, full control of data interactions. As you will see, in Theia AI the use of variables and tool functions is not only fully flexible but also transparent, optionally empowering even end users to customize and control how these concepts are employed in their workflows.

Theia AI is an open and flexible technology that enables developers and companies to build tailored AI-enhanced custom tools and IDEs. Theia AI significantly simplifies this task by taking care of base features such as LLM access, a customizable chat view, prompt templating and much more, and lets tool developers focus on engineering prompts for their use cases and integrate them seamlessly in Theia’s editors and views, as well as in the tool provider’s custom editors and views. Theia AI is part of the Theia Platform and is ready to be adopted by tool builders wanting to be in full control over their AI solutions. Learn more about the vision of Theia AI.

Theia IDE is a modern and open IDE built on the Theia platform. With version 1.54 Theia IDE will integrate experimental AI support based on Theia AI to showcase AI-powered functionalities in a highly customizable, transparent and open setting. Learn more about the Theia IDE.

In the following, we demonstrate the use of variables in Theia AI at the example of the AI support in the Theia IDE. In the Theia IDE, we generally aim at maximum transparency and flexibility for the end user. Let’s start with a very simple example use case for variables. Let’s assume the user has a code editor opened in the Theia IDE and asks the following question in the chat:

Disappointingly, the agent does not know about the code editor the user has opened. However, this is actually on purpose. Many other systems semi-automatically add additional context to the prompts without making this transparent at all. In Theia AI, the tool builder and optionally even the end users have full control over the usage of variables and functions. The universal agent, unlike most other agents in the Theia IDE, does not have any variable access by default. You can even verify that by looking at the AI configuration view, where all variables use by an agent are listed:

Anyways, of course we still want to answer the users question above and there are three ways to do so:

First, in the default chat provided by Theia AI, you can manually add variables and thereby provide the AI access to additional data. In the following screenshot, we provide the context via the currently selected text. Alternatively, we could also use variables such as the current file, the cursor position, etc. As you can see, the default chat assistant can now correctly answer the question.

Second, you can actually easily adapt the universal agent to have access to more context. As highlighted before, in the Theia IDE you can see and edit the used prompts. Variables and tool functions can be referenced in prompts. So by adding something like the following to the prompt template of the default agent, it will be able to access the selected text automatically from now on without a manual user interaction or changing its implementation.

Please note that Theia IDE makes this fully transparent to the user. You do not even have to review the prompt template, the AI Configuration view will show that the universal agent makes use of a variable now (see following screenshot). Theia AI supports this level of transparency, but tool builders can of course decide how much they want to expose to the users in their custom tools.

Finally, and third as working with the user’s current context is a very common use case, we do not want to bother all users individually to adapt the universal agent. We are working on an agent for the Theia IDE that has access to the typical user context as you would expect. You will be able to review what context it accesses and you can disable it though.

Please note that the same considerations described for variables also apply to so-called tool functions. These allow the underlying LLM to invoke functions, e.g. to request additional information from the tool (rather than having users proactively providing it). In the following example, we see an agent that allows the LLM to autonomously retrieve the list of files of a users workspace as well as their content of specific files.

Variables and tool functions are a core AI concept supported by Theia AI. As a tool builder, you can very easily define your own variables and functions to connect the underlying AI with your custom domain data and allow it to execute actions in your custom tool. Existing projects prove these concepts to be very useful to enable efficient and tailored workflows that go way beyond just providing a plain chat. Whether you as a tool builder provide transparency to the user how the AI interacts with the tool data is of course up to you. However, Theia AI enables you to easily be transparent and based on our experience, many users, specifically in critical domains appreciate to know what is going on with their proprietary data.

We will show more showcases demonstrating the core principles of Theia AI within the next few days, see also:

← Previous: Choose your own LLM   |   Next: Create your own agent →

Stay tuned and follow us on Twitter.

If you want to sponsor the project or use Theia AI to create your own AI solution, please get in contact with us. In particular, we are also looking for LLM providers who want to make their language models available via Theia AI.

EclipseSource is at the forefront of technological innovation, ready to guide and support your AI initiatives based on Theia AI or any other technology. Our comprehensive AI integration services provide the specialized know-how necessary to develop customized, AI-enhanced solutions that elevate your tools and IDEs. Explore how we can assist in integrating AI into your tools with our AI technology services. Reach out to begin your AI integration project with us.

Jonas, Maximilian & Philip

Jonas Helming, Maximilian Koegel and Philip Langer co-lead EclipseSource. They work as consultants and software engineers for building web-based and desktop-based tools. …