Computer interaction, example 1

A demonstration of computer interaction.

Request: “What are the largest files in the current directory and below?”

In this session, the user first inquires about the largest files in the current directory, then asks for suggestions on which of these might be deleted. This example demonstrates that:

  • The assistant can provide ready-to-use terminal commands, including command chaining.
  • The assistant can analyze the output of invoked tools, supported by an automatic contextual query.

❯ ./ditana-assistant -a “What are the largest files in the current directory and below?”

find . -type f -exec du -h {} + | sort -rh | head -n 10

Execute above command? (y/n) y

364K	./packaging/arch/ditana-assistant-1.036-1-any.pkg.tar.zst
284K	./src/ditana-logo.png
284K	./packaging/arch/pkg/ditana-assistant/usr/share/ditana/assistant/ditana-logo.png
284K	./packaging/arch/ditana-logo.png
276K	./.git/objects/21/e3382f3ee049d91368ce79218cb4049bae6222
248K	./myenv/lib/python3.12/site-packages/__pycache__/bottle.cpython-312.pyc
248K	./myenv/bin/__pycache__/bottle.cpython-312.pyc
204K	./myenv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_emoji_codes.cpython-312.pyc
160K	./myenv/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__pycache__/__init__.cpython-312.pyc
156K	./myenv/lib/python3.12/site-packages/pip/_vendor/idna/__pycache__/uts46data.cpython-312.pyc

Your Message (’enter’ to quit): Which one of these are safe to delete?

          contextual query: "Which file in the list has the smallest size and can be safely deleted?"
answer to contextual query: "The file with the smallest size in the list is:  ./myenv/lib/python3.12/site-packages/pip/_vendor..."

It is important to exercise caution when deleting files, especially system files or files related to applications. In the list provided, the file that appears to be safe to delete without causing any major issues is:

./myenv/lib/python3.12/site-packages/pip/_vendor/idna/__pycache__/uts46data.cpython-312.pyc

This file seems to be a Python cache file and deleting it should not have a significant impact on the functionality of the application. However, it is always recommended to make a backup of the file before deleting it, in case it is needed later on.