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

Variable Numeric Slot_Commands = 85
Variable Numeric Slot_Responses = 86

Button 1 Label SetModel
Button 2 Label SetRandomness

Button 4 Label SendMessage1
Button 5 Label SendMessage2
Button 6 Label SendMessage3

Button 8 Label ClearChat

Controls OpenTextBox
Loop
Stop

Label Loop
	If SlotText(Slot_Responses) <> ""
		Controls ClearTextBox
		Print SlotText(Slot_Responses)
		SlotText(Slot_Responses) = ""
	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 SetModel
	SendCommand(Slot_Commands)("SetModel " + Int(Rnd * 10)) 
Return
Label SetRandomness
	SendCommand(Slot_Commands)("SetRandomness " + Int(Rnd * 140))
Return

Label SendMessage1
	SendCommand(Slot_Commands)("SendPrompt" + " How are you ?")
Return
Label SendMessage2
	SendCommand(Slot_Commands)("SendPrompt" + " What time is it ?")
Return
Label SendMessage3
	SendCommand(Slot_Commands)("SendPrompt" + " What is your name ?")
Return

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


'BOOKMARKS 

'EDITEDLINES 15 1 8 5 9 6 46 7 49 8 50 10 47 10 

