
' ----------------------------------------------
'  Commands to Theremino_OLLAMA
' ----------------------------------------------

Variable Numeric Slot_Commands = 85
Variable Numeric Slot_Responses = 86

Button 1 Label Stop_

Button 3 Label SetModel
Button 4 Label SetRandomness

Button 6 Label SendPrompt1
Button 7 Label SendPrompt2
Button 8 Label SendPrompt3

Button 10 Label NewChat

Controls OpenTextBox
Loop
Stop

Label Loop
	If SlotText(Slot_Responses) <> ""
		s1 = SlotText(Slot_Responses)
		If StringContains(s1, "<<<END>>>")
			'Controls ClearTextBox
			Print s1
			'SlotText(Slot_Responses) = ""
		EndIf
	EndIf
Goto Loop

' =============================================================
'  SEND COMMAND (default timeout = 0.5 Sec)
' =============================================================
Label SendCommand
	Variable Numeric SC1       '<-- Parameter Destinat.-Slot
	Variable String  SC2       '<-- Parameter Command-String
	Variable Numeric SC3 = 0.5 '<-- The timeout in seconds
	Variable Numeric SC4
	SlotText SC1 = SC2
	For SC4 = 0.1 To SC3 Step 0.1
		If SlotText(SC1) = ""
			Exit
		EndIf
		Wait Seconds 0.1
	Next
Return

Label Stop_
	SendCommand(Slot_Commands)("Stop")
Return

Label SetModel
	SendCommand(Slot_Commands)("SetModel " + Int(Rnd * 10))
Return
Label SetRandomness
	SendCommand(Slot_Commands)("SetRandomness " + Int(Rnd * 150))
Return

Label SendPrompt1
	SendCommand(Slot_Commands)("SendPrompt" + " How are you ?")
Return
Label SendPrompt2
	SendCommand(Slot_Commands)("SendPrompt" + " What time is it ?")
Return
Label SendPrompt3
	SendCommand(Slot_Commands)("SendPrompt" + " What is your name ?")
Return

Label NewChat
	Controls ClearTextBox
	SendCommand(Slot_Commands)("NewChat")
Return


'BOOKMARKS 

'EDITEDLINES 8 1 10 2 11 3 13 10 14 10 15 10 17 7 62 8 65 9 68 10 

