← Back to Blog

Using Gwenai's Tools Effectively (Plus Ideas for Your own)

I've spent a lot of time with Gwenai—testing and debugging it, but also using it for my own tasks on Linux. There have been lots of trial and error implementing tools (I will make a post on the history of tools, and how they work, soon.) This blog system you are on right now was just recently created almost completely by Gwenai. It took around 20 minutes to create in ASP.NET. It did not write this blog post though, as I want that to be written by myself. In this blog post I will showcase what I have learned from using tools and using Gwenai to create multiple projects, from generating course material, creating websites, building backend applications, analysing websites for improvement and more.

I am genuinely a bit surprised at how much faster I can work with the help of my own program. I suppose that is why I created it, and it seems to have worked out. I have been using AI for a while now but it was always a bit frustrating to use since it does not have the necessary context. Usually, the AI does not have context of the projects I work on. For example, if I need help with a bug within some code, the AI needs to know what the code looks like, and it sometimes involves multiple files. It can be a pain to copy-paste all of it. With Gwenai I can just ask:

"Take a look at my files to figure out what's going on"

Gwenai will run the commands to look through your files, which is a lot faster than manually copy-pasting the necessary files, especially if there are a lot. I find it funny that I used to be skeptical about AI, never really using it, and now I am using it or working with it almost all the time. I am glad I changed my mindset from "AI is useless" to "AI is extremely useful if used correctly". If you've ever wasted time copy-pasting code into an AI chat just to debug a bug, you'll get why I built Gwenai. Okay, I am now done glazing myself and my program, let's get to the tips and tricks.

We'll cover firstly what tools are and why they are useful, then how they can be used effectively, and lastly how you can create your own tools to speed up your own workflows.

What tools are and why they are useful

Tools are special actions Gwenai can take to perform real work outside of just chatting. For example, if you need to create a lot of folders, Gwenai can run the run_command tool to quickly make them for you, saving a lot of time. It could look like this:

Example Tool Usage:

<<< run_command
mkdir first_folder
mkdir second_folder
mkdir third_folder
>>>

This is actually how Gwenai handles tools through text. It provides a simple format that almost all models can understand and use.

The run_command tool, as described by the name, allows Gwenai to run any command allowed by the users shell. This means Gwenai can do anything you can do on the computer, which is immensely helpful. For example, Gwenai could help you:

If you are safety-concerned you might be wondering about the security implications of this. Gwenai has a few options to increase (or decrease if you are daring) security:

Gwenai can technically do everything through commands, but there is also the run_python tool which is useful for more complex tasks, and it is sometimes easier to use for complex text. For example, on Windows shell scripting can be tricky and there are to my knowledge no easy ways to write code without special formats. When I tested with Claude it would use one-liner commands for every line of code. Python lets you handle things like file formatting without weird escapes. Again, like the name implies, run_python allows Gwenai to write and run Python code. You need Python installed for this to work.

Lastly, the web_search tool allows Gwenai to search the web using DuckDuckGo locally. If you want, you can enable or disable live mode, meaning an actual browser will open and display the queries written by Gwenai, to see exactly what the model sees.

Tools are optional, you can enable and disable them however you want. You can also create your own custom tools, which I will talk about later in the post.

Tips and trick to use tools effectively

Gwenai (depending on the model used) is usually quite smart in using tools from the get-go. You do not typically have to ask the model to use a tool specifically, it will just do it when needed. But sometimes it runs the wrong command (rare), or an inefficient command, or it does too much. Just like with any AI, it's important to be specific with instructions.

Provide clear and specific instructions

For example, say I wanted to find some images for a website, I could ask:

"Find images I can use for my website"

The last time I tried this (I was using Claude), I typed something like that, very short and unspecific. Claude started using the web_search tool and queried something like: "images for website". DuckDuckGo returned a popular image gallery website with lots of images, and then Claude just responded with: "I have found a website with images, look here: <url to website>". What I really wanted though was a bunch of URLs to actual images that I could just copy and use. The problem was that I did not specify that clearly enough, and there was very little context. Instead, I could have said something like:

"Search the web for images of <topic> that I could use for my website about <website description>. Return URLs of 10 images I could try."

That greatly helps the model understand what I actually want and run the appropriate tools to complete the task quickly. With that said, you can also utilize the next tip.

Running and re-running tools

This is perhaps not a tip about tools themselves, but is very useful. I myself use this all the time.

Sometimes you are simply not specific enough (often without realizing) in your instructions. You might ask something and Gwenai responds with something that you do not want. In these cases, you usually know what is wrong or missing. What you can do in these situations is simply write those things down in the chat, deny the response, add your new message which is appended on the old one, and send again. It's almost like looking into the future: you write something, see the result, go back and change the instructions to match better with what you want, and get results again. You can do this as many times as you want. Even if you already accepted a response you can just delete it (right click any message to delete) and go again.

There are limitations

There is another problem with the "searching the web for images" example: limitations. Gwenai is not all-powerful unfortunately, like all AI tools. If you ask just ask it to find images, it will search the web and return some random images it finds fitting. The limitation is that Gwenai cannot "see" websites, it only reads text currently, meaning it does not actually know what images look like. The lesson here is that you must keep in mind that Gwenai cannot do everything, like "see" images on websites for example, or watch videos. Because of this, it might return images that are nothing like you want. Luckily, you can go around this by instructing Gwenai to utilize tools multiple times. If you want Gwenai to be able to "see" images, you could first ask it to search for images, then ask it to download those images using curl or Python. Lastly, you attach those images to Gwenai manually as the user which will allow the model to then see the actual images (if the model supports images of course.)

Summary: Gwenai has limitations but you can usually go around them through instructions, being specific and utilizing tools. You can also create custom tools to bridge these gaps—like the one I just thought of and will describe in the custom tools section.

Learn context quickly

A lot of times, I work on a project which requires context (typically code.) In these cases there might be many files that are necessary to be able to work with the project. Since Gwenai is local and can run commands, if you ever need Gwenai to understand some context you can just ask it to learn it:

"I have a bug in my code, could you please take a look? There is a lot going on so start by checking out the files and content."

Or, if you need some documentation:

"How do I do X in Y library? Search the web."

Custom instructions and system prompts

Whilst working on the https://gwenai.io website itself, I really wanted to get the website right. I had tried various different themes, colors, layouts and such before (Gwenai makes it extremely fast to just test different things) but it just didn't seem right. I wanted to focus on conversion rate particularly, but every time I asked Gwenai to fix things it just wrote the same generic AI thing, like most AIs do. To change this, I created a custom system prompt which was to act as a conversion rate specialist, and this helped a lot in understanding what was "wrong" and what would be improved. One of the things I learned for example was that most people resonate more with "results" than "features". If you go on a website for something, you usually do not care about the features, only how your problems can be solved. Of course, the features are what help you solve the problem, but what's important is how they do that, and that is something that has to be explained.

Custom system prompts, or just normal instructions, can be extremely effective in tipping the models behavior in the direction you need. You can even use AI to generate the system prompt itself most of the times.

Creating and using custom tools

I am laughing from joy right now. While writing one of the previous tool-tips (limitations of web search and tool usage) I came up with an idea and the perfect example to describe why custom tools might be useful. Just quickly, to recap that point: when searching the web, the model will not be able to see images, just the urls for the images. To go around this you can download the images and then put them into Gwenai yourself, so that the models can actually see the images. While writing the tip, I had an idea: what if there was a tool which allows Gwenai to attach images by itself? As in, it provides a file path and then attaches the file just like the user can. In that case, Gwenai can fully read images by itself, which would speed up the process and be very useful when using automatic mode. If that is not the perfect example of why custom tools are useful, I don't know what is.

If you are in need of a new tool, you can always request it through GitHub or email, but you might need the tool right now, or perhaps the tool is more personal or specific to your situation. In these cases you can just create and use your own custom tool. Do this in the dashboard of Gwenai:

Gwenai dashboard interface showing where to create tools Gwenai create tool interface showing how to create tools

All arguments (to all tools, including custom tools) are just text. This means you can use any format you like: plain text, JSON, XML or other. Here are some examples:

Attach File

Attach a file, like images, that can be viewed. This could attach files in Gwenai automatically.

<<< attach_file
/path/to/file
>>>

Twitter

Upload a tweet from a single message. This could use a Python script to post via the Twitter API.

<<< tweet
This tweet was written and sent by Gwenai!
>>>

Log Error Listener

Listen for logs and return a message when errors or warnings occur. This could run a program which streams log files and writes summaries.

<<< subscribe_logs
[
  { "type": "filter", "type": "error" },
  { "type": "filter", "type": "warning" }
]
>>>

I hope this post was useful. Thank you for reading! If you haven't yet tried Gwenai, download it for free.

Afterword: After writing this post I asked Gwenai to scan the file and fix all typos and grammar issues (there were many that I missed.) It took about 2 minutes to first read the file and then write commands to replace the bad with the good.