|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > AI - Artificial Intelligence Commands > AIC. - Artificial Intelligence Command > AIC. - Artificial Intelligence Command |
MiniRobotLanguage (MRL)
Using LM Studio
You can use LM Studio API with the AIC.-Commands

You can use the AIC.Ask Chat - Command to get answers from "Local AI LM Studio"
Intention
The available AIC. commands can be used also to interface all compatible APIs that are compatible with the OpenAI API standards.
For example, we have here a local AI that is called LM-Studio and you can just change the endpoint and you are ready to go using the ask chat command.
You can download LM-Studio for Windows here.
To use LM Studio from the SPR, you need to set the Server Options (see below) and start the Server.

In most cases you just need to download LM Studio (and a model), install it, run it and then start the server and you are ready to go.
Here is a Sample Script. It will first get an Information from LM Studio (Local AI) and then reset the ENdpoint to "Open AI default" and get the same Anwer from Open AI / ChatGPT.
' Setting the Endpoint
$$ENP=http://localhost:1234/v1/chat/completions
AIC.Set Chat Endpoint|$$ENP
$$PRO=How are you?
AIC.Ask Chat|$$PRO|$$RES
MBX.$$RES
' To use Open AI we need these steps:
AIC.Set Key|file
' Reset the Endpoint for Open AI Chat-Completion Endpoint
AIC.Set Chat Endpoint|
' Here is the Call to the AI
$$PRO=How are you?
AIC.Ask Chat|$$PRO|$$RES
MBX.$$RES
ENR.
Syntax / Example
'***********************************
' LM Studio-Sample
'***********************************
' Setting the Endpoint
$$ENP=http://localhost:1234/v1/chat/completions
AIC.Set Chat Endpoint|$$ENP
$$PRO=How are you?
AIC.Ask Chat|$$PRO|$$RES
MBX.$$RES
Remarks
-
Limitations:
-
See also:
•