From fecd54cc61f1b6c60ec3702c6e9d1925d4788b32 Mon Sep 17 00:00:00 2001 From: Geens Date: Sat, 19 Oct 2024 11:44:52 +0200 Subject: [PATCH] More info on use of xml and fix formatting in examples --- readme.md | 44 ++++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/readme.md b/readme.md index 4306381..0a1083b 100644 --- a/readme.md +++ b/readme.md @@ -152,9 +152,25 @@ The LLM Engine is responsible for: This section explains technical details of the implementation. -### Context structure +### Use of XML -The context is formatted as XML. +The context and actions are formatted as XML. +For the context this adds clear rules for escaping. +This is usefull in case a previous context is embedded. + +The response starts with freeform reasoning followed by XML formatted actions. +In case the LLM makes a mistake it can start over. +Only the last XML block is evaluated. + +XML is verbose by nature. +To avoid overflowing the context window, it should only be used where it adds value. +Directory listings, for instance, are formatted in the well known ls command format. + +Parameters for actions can be passed as attributes or as child elements. +This allows the LLM to pass multiple volumes or environment variables in a clear way. +It also simplifies escaping of command line arguments. + +Action results are added in the context as text nodes after the last parameter. ## Example iterations @@ -166,14 +182,14 @@ This example shows how to work with standard IO, run simple scripts and monitor @@ -197,7 +213,7 @@ drwxr-xr-x 1 sia 197121 0 2024-10-16 22:35:31.806079500 +0200 user/ -rw-r--r-- 1 sia 197121 71 2024-10-16 22:41:23.223580300 +0200 general_info.txt -Name: John (I don't know his last name) +Name: John (I don't know his last name) Location: Somewhere in Belgium @@ -209,7 +225,11 @@ Location: Somewhere in Belgium John did not specify an exact time. I'll suggest 9am. He also did not specify how to be reminded. I'll ask but if he doesn't respond I'll assume a text message on standard output is fine. I'll write down this task in a file so I can keep it in context. I can write simple files with busybox:latest and echo but I will need to use sh -c to do the redirect. - + + sh + -c + /tasks/reminder.txt]]> + ```