<< Click to Display Table of Contents >> Navigation: 3. Script Language > AI - Artificial Intelligence Commands > AIC. - Artificial Intelligence Command > AI - History > Add to History |
MiniRobotLanguage (MRL)
AIC.Add to History
Add custom Prompt and Answer to internal History.
Intention
The AIC.Add to History command will add a custom Prompt and a custom Answer to the internally stored History, that you can retrieve using the
AIC.Get Several|2 or the AIC.Get History - Command. It will automatically add the delimiter that is defined with AIC.Set Delimiter QS and AIC.Set Delimiter AN to the History.
It will also add a Count and a Date to each Block of Question and Answer.
This Command works together with the AIC.Get History Command and the AIC.Set Delimiter QS and AIC.Set Delimiter AN Commands.
You can get the history of the chat, and the last Question, or the last Answer using the Commands:
AIC.Get_History|$$HIS
AIC.Get_Last_Question|$$QUE
AIC.Get_Last_Answer|$$ANS
AIC.Add to History|<Question>|<Anwer>
$$QUS=This is just a divider.
$$ANS=--------------------------------
AIC.Add to History|$$QUS|$$ANS
This example adds a custom Block to the History. This can be useful to mark Blocks as dividers. Or add comments to the history.
Syntax
AIC.Add to History[|P1][|P2]
AIC.ATH[|P1][|P2]
Parameter Explanation
P1 - opt. Variable or Text representing the Prompt (Question).
P2 - opt. Variable or or Text representing the Answer.
If omitted the default value is "-".
Example
'*****************************************************
' EXAMPLE 1: AIC.-Commands
'*****************************************************
' Set OpenAI API-Key from the saved File
AIC.SetKey|File
' Set Model
AIC.SetModel_Completion|4
' Set Model-Temperature
AIC.Set_Temperature|0
' Set Max-Tokens (Possible lenght of answer, depending on the Model up to 2000 Tokens which is about ~6000 characters)
' The more Tokens you use the more you need to pay.
AIC.SetMax_Token|25
AIC.Add to History|The next block shows the use of step by step prompting|-------------------------
' Ask Question and receive answer to $$RET
AIC.Ask_Completion|What is a "Windows Button"?|$$RET
MBX.$$RET
:enx
ENR.
Remarks
-
Limitations:
Currently the history has a hard-cap of the last ~200 kb.This is not a limitation but just to prevent it from memory overflow.
See also:
•