https://retellai.com/?utm_source=discord&utm_medium=seo logo
dynamic variables in function query parameters are...
# ❓・bug-report
c
i put {{nearest_location.id}} but the url is like location_id=%7B%7Bnearest_location.id%7D%7D double "{" are ignored. #❓・bug-report
o
Can you show me where you get the location value .
c
o
make it neares_location_id -> locations[0].id
i can try that. but if it works in the prompt. it should also work in the query parameters becaue they both convert json variables to strings.
just string operations
o
make the conversation from prompt to static and show me the result
c
the nearest location is {{nearest_location.id}} {{nearest_location.address.locality}} {{nearest_location.administrative_district_level_1}}. do you want to proceed with this location?
your static node doesn't work
prompt node works as expected. So, Tom, the nearest Supercut is LF7PCTC9FJBEV in Newark, CA. Uh, does that work for you, or would you like to check out another location?
o
my friend you just doing it the wrong way
the static node works fine.
you asking why the prompt node works although you did in the wrong why right?
c
while i think the prompt node is working as what i expect
if i am only limited to "make it neares_location_id -> locations[0].id", it is so troublesome that we have to create a lot of variables in the response of a function
o
because the llm already have access to the information you received and it sees the prompt as exact letters so the llm will go ahead and answer from the information but as exact variables but as a text
on your backend send them without the list just the variables you want to sends each on on it's own .
c
no. sometimes we need a list
for example, my customer wants a list of customers.
o
It's fine , you can do it as you want , you just need to know that variables are strings not object , you cant store an object inside them.
c
i don't understand this. why does the prompt node work as i expect? it extracted the correct info
do u mean there is no code to extract varibale but the llm is intelligent enought to replace variable on its own?
o
the prompt doesn't see variable it see it as a text and based on that text it go get it from the information it have , try to change a latter from small to capital and you will see it still works because it see it as text , if did see it as variable this won't work , try it and let me know
c
o
show me
i believe it is a bug. u can check your code base.
o
I just tested it works fine
this happens if locations[0].id has no value so it will be text make sure you are send the information and you updated your function
c
this static node print out the nearest_location object. this is what i expect.
but the fact that prompt node works even if i didn't set it correct is suprisinng. Maybe it is intelligent enough.
thank you, have a nice day!