Prompt Management
The Prompt Table
Because LLMs hallucinate (spread false information) when given too much information, we need to limit our prompts. For that reason, in our implementation, we only provide 10 slots for the LLM. The slots should not be filled with too much information.
We reserve the first four slots ourselves, though. Here's a quick rundown of the purpose of each slot:
Slot-ID | Name | Purpose | Reserved? |
---|---|---|---|
0 | Premise | Tells the LLM the Working Environment it currently is in. | Yes |
1 | Formal Language | Tells the LLM to output the message according to the rules of our Formal Language. | Yes |
2 | Mood | Tells the LLM the current mood of the Robot, using the Arousal/Valence vector. | Yes |
3 | Exhibit Context | Tells the LLM at which exhibit the Robot is currently located. | Yes |
4 | Exhibit List | Tells the LLM some vague details about some outer features of exhibits. | Yes |
5 | Summary Point | This is the first slot where custom prompt data may be stored. This is also the point which the LLM will use to summarize all the points 5-10 in one slot, such that new data can be stored whenever it runs full. Note: It will override any given data in Slot 5 in doing so. | No |
6-10 | Custom Data | Those slots store custom prompt data for the LLM. | No |
There also are some premade prompts stored in src/llm/premade
. You can even specify the language that the LLM may talk in by either selecting premise_de.txt
or premise_en.txt
(German or English).
The Prompt Manager Class
set_exhibit_context(key)
Sets the momentary exhibit context, so that the robot knows which exponat could possibly be the current topic.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str
|
The exponat key. |
required |
set_mood(arousal, valence)
Sets the mood prompt at space 2.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
arousal
|
int
|
The arousal. |
required |
valence
|
int
|
The valence. |
required |
squash_various_space()
Sums up the prompt spaces 5-8 in slot 5 so that the space for new prompts can come.