!Esperadoce
!Esperadoce2mo ago

How do I interpret a variable that exists in JSON data?

({
"messages": [
{
"role": "user",
"content": "$var:f/prompts/history_prompt"
}
],
"model": "o1",
"logprobs": false,
"response_format": {
"type": "text"
},
"stream": false,
"user": "$var:f/ai_api_key/opanai-lab-p1-key"
})
({
"messages": [
{
"role": "user",
"content": "$var:f/prompts/history_prompt"
}
],
"model": "o1",
"logprobs": false,
"response_format": {
"type": "text"
},
"stream": false,
"user": "$var:f/ai_api_key/opanai-lab-p1-key"
})
json But the history_prompt variable isn't being interpreted.
6 Replies
!Esperadoce
!EsperadoceOP2mo ago
Anyone ?
rubenf
rubenf2mo ago
you will need to do it yourself using get_variable, we only do it for top-level fields
!Esperadoce
!EsperadoceOP2mo ago
What do you mean by get_variable
Pyra
Pyra2mo ago
depends on language you use, but in python, ts, go and rust there are clients. For example python - https://www.windmill.dev/docs/advanced/clients/python_client#usage These clients expose certain functions/methods with get_variable being one of those (I hope the name is self-explanatory)
!Esperadoce
!EsperadoceOP5w ago
I use typescript in my case
Pyra
Pyra5w ago
there is ts client

Did you find this page helpful?