Problem with the shell command with a local server

jbv at souslelogo.com jbv at souslelogo.com
Mon Dec 30 11:13:04 EST 2024


Hi list,

Long story short : I am using LM Studio as a local server to send 
requests to an LLM model.
I use the shell command in LC 9.6 with curl on MacOS Sequoia 15.1.1.

The request looks like that :
curl http://127.0.0.1:1234/v1/embeddings \
   -H "Content-Type: application/json" \
   -d '{
     "model": "text-embedding-granite-embedding-278m-multilingual",
     "input": "some text"
   }'

The response is a json file with a list of vectors.
When I execute the command in Terminal, everything works fine.
But when I use "put shell(tcurl) into myjson" in a LC script,
I get the same result, except for a line that is inserted in the
middle of the json and looks like that :
...
         0.01324639841914177,
         0.085932932794094
100 23374  100 23264  100   110   873k   4227 --:--:-- --:--:-- --:--:-- 
  913k
09,
         -0.020998964086174965,
...

instead of
...
         0.01324639841914177,
         0.08593293279409409,
         -0.020998964086174965,
...

Because of that I can't parse the json and I get an error with 
JsonImport.

What am I doing wrong ?
How can I fix it ?

Thank you in advance
jbv



More information about the use-livecode mailing list