Log in
Log into community
Find answers from the community
View all posts
Related posts
Did this answer your question?
😞
😐
😃
Powered by
Hall
Inactive
Updated 2 years ago
0
Follow
Json prompting
Json prompting
Inactive
0
Follow
n
nbulkz
2 years ago
·
how can I use
{"foo":{}, "bar":{}}
in a prompt?
L
n
8 comments
Share
Open in Discord
L
Logan M
2 years ago
Its not a bug, just a symptom of how string formatting works in python
I think you should be able to use double brackets?
{{"foo": {}, "bar":{}}}
Or if that doesn't work, the inner brackets might also need doubles, I forget how it works
{{"foo":{{}}, "bar":{{}}}}
Then when the string is formatted, the double brackets go away
n
nbulkz
2 years ago
I tried both of those
n
nbulkz
2 years ago
try it yourself
n
nbulkz
2 years ago
see if you can get it to work - I could not.
n
nbulkz
2 years ago
and I also thought at first it was my naïveté on how to use f strings
L
Logan M
2 years ago
I had it working for one guy on the discord. When I get to my computer I'll give it a few tries
n
nbulkz
2 years ago
that would be amazing
n
nbulkz
2 years ago
thanks
Add a reply
Sign up and join the conversation on Discord
Join on Discord