You're already reading the file as binary, and you're already encoding it with 
Base64.  You've addressed the basics well.  But we see the issue lies in a 
murkier place.

Without the complete relevant code and the API spec, anything offered here 
would be just a guess.

So let's guess: are you sending data from one image file, or several, in this 
test?  If multiple, how does the reciever parse them? What headers are you 
using?  What headers are expected? What are the other modes available in this 
"multimodal" API? What encodings are used, and what are expected? Is the error 
coming from the server or LC?  If the server, what is the error number? If LC, 
what line is the debugger pointing to, and may we see that line? Are you using 
POST?  Are the POST delimiters appropriate?

The range of things that aren't the solution is vast.  It's always simpler to 
diagnose code that doesn't meet expectations when we can see the code and the 
expectations.

On this list we have the collective experience of a great many professionals 
who've been building networked applications for decades.  We'd like to help.  
The more information we have, the more that helps us help.

--
Richard Gaskin
FourthWorld.com



jbv wrote:

> I am stuck.
> No matter what I try, I always get the same error :
>   "url" field must be a base64 encoded image
>
> So I'm back to my very first question : how to base64encode
> a jpeg file in LC to be used in a regular multimodal json
> curl request...
>
>> Le 2025-02-03 19:00, Richard Gaskin via use-livecode a écrit :
>> 
>>> You'd already done that. It did't solve it.  Now we need to find out 
>>> why.
>>> 
>>> Learning what the receiver expects will help us meet its expectations.
>>> 
>>> --
>>> Richard Gaskin
>>> FourthWorld.com
>>

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to