More info on use of xml and fix formatting in examples
This commit is contained in:
44
readme.md
44
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
|
||||
<context>
|
||||
<system
|
||||
time="2024-10-18T12:00:00Z"
|
||||
cpu=12
|
||||
gpu=26
|
||||
memory_used=9556302234
|
||||
memory_total=17179869184
|
||||
disk_used=244434939904
|
||||
disk_total=273145991168
|
||||
context=3
|
||||
stdin=0
|
||||
cpu="12"
|
||||
gpu="26"
|
||||
memory_used="9556302234"
|
||||
memory_total="17179869184"
|
||||
disk_used="244434939904"
|
||||
disk_total="273145991168"
|
||||
context="3"
|
||||
stdin="0"
|
||||
/>
|
||||
<containers/>
|
||||
<previous>
|
||||
@@ -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
|
||||
</file>
|
||||
<file name="/user/general_info.txt" type="file">
|
||||
Name: John (I don't know his last name)
|
||||
Name: John (I don't know his last name)
|
||||
Location: Somewhere in Belgium
|
||||
</file>
|
||||
</files>
|
||||
@@ -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.
|
||||
<actions>
|
||||
<write_stdout message="I'll remind you to feed the cat tomorrow morning at 9am. Is a message on the standard output ok?"/>
|
||||
<start_container image="busybox:latest" timeout="1000" volumes="/tasks:/tasks" command="sh -c 'echo \'Remind John to feed the cat on 2024-10-18T09:00:00+02:00. Use standard output.\' > /tasks/reminder.txt'"/>
|
||||
<start_container image="busybox:latest" timeout="1000" volumes="/tasks:/tasks">
|
||||
<command>sh</command>
|
||||
<parameter>-c</parameter>
|
||||
<parameter><![CDATA[echo 'Remind John to feed the cat on 2024-10-18T09:00:00+02:00. Use standard output.' > /tasks/reminder.txt]]></parameter>
|
||||
</start_container>
|
||||
<monitor_file path="/tasks/reminder.txt"/>
|
||||
</actions>
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user