We are stumped. Works fine with python and curl. But using MvCALL is returning this error: Fatal error in MiscRepo\Test_Groq.mvc @ [00000000:00000302]: E:\MiscRepo\Test_Groq.mv: Line 46: Array index must be positive integer.
Interestingly we comment out the api_key and we still get the error. If we also comment out the payload - we get authentication error. If we add back the key without payload - expected error. IF we add back payload (with key) - the fatal error.
Using normal <MvCAPTURE> - same result
<MIVA STANDARDOUTPUTLEVEL="html,text,compresswhitespace" >
<MvASSIGN NAME = "g.groqkey" VALUE = "REDACTED-THIS">
<MvASSIGN NAME="l.payload" VALUE='{"model":"openai/gpt-oss-120b","messages":[{"role":"user","content":"Hello"}],"max_tokens":50,"stream":false}'>
<MvASSIGN NAME="l.rawresponse" VALUE="">
<Miva MvCALL_ERROR="nonfatal,nodisplay">
<MvCALL ACTION="https://api.groq.com/openai/v1/chat/completions"
METHOD="RAW"
CONTENT-TYPE="application/json"
HEADERS="{ 'Authorization: Bearer ' $ g.groqkey }"
FIELDS="{ l.payload }">
<MvASSIGN NAME="l.rawresponse" VALUE="{ l.rawresponse $ s.callvalue }">
<MvCALLSTOP>
</MvCALL>
<Miva MvCALL_ERROR="fatal,display">
Raw Response: <MvEVAL EXPR="{ miva_json_decode(l.rawresponse, l.theresult) }">
theresult: <MvEVAL EXPR = "{ l.theresult }"><BR>
Thanks for any assistance.
-mike
Interestingly we comment out the api_key and we still get the error. If we also comment out the payload - we get authentication error. If we add back the key without payload - expected error. IF we add back payload (with key) - the fatal error.
Using normal <MvCAPTURE> - same result
<MIVA STANDARDOUTPUTLEVEL="html,text,compresswhitespace" >
<MvASSIGN NAME = "g.groqkey" VALUE = "REDACTED-THIS">
<MvASSIGN NAME="l.payload" VALUE='{"model":"openai/gpt-oss-120b","messages":[{"role":"user","content":"Hello"}],"max_tokens":50,"stream":false}'>
<MvASSIGN NAME="l.rawresponse" VALUE="">
<Miva MvCALL_ERROR="nonfatal,nodisplay">
<MvCALL ACTION="https://api.groq.com/openai/v1/chat/completions"
METHOD="RAW"
CONTENT-TYPE="application/json"
HEADERS="{ 'Authorization: Bearer ' $ g.groqkey }"
FIELDS="{ l.payload }">
<MvASSIGN NAME="l.rawresponse" VALUE="{ l.rawresponse $ s.callvalue }">
<MvCALLSTOP>
</MvCALL>
<Miva MvCALL_ERROR="fatal,display">
Raw Response: <MvEVAL EXPR="{ miva_json_decode(l.rawresponse, l.theresult) }">
theresult: <MvEVAL EXPR = "{ l.theresult }"><BR>
Thanks for any assistance.
-mike
Comment