Say I have the following template for a json:
{
"Group_i": {
"Person_j": {
"Mood": "",
"ActionData": {
"Action_k": {
"ActionBehavior": "",
}
}
}
}
}
iterators:
i, j, k
We want to be able to set limits:
i to 3 groups (adjustable)
j to 3 people (adjustable)
k to 5 actions (adjustable)
Each variable for "Mood" or "ActionBehavior" should also be limit-bound
The intention is to get something like this, where natural language can be translated into a consistently valid json within boundaries
Maybe saying something like "I want 1 group with 2 people, first person be happy and will have 2 actions: clap, sing, and second person will be sad and have 1 action, clap" should translate to this
{
"Group_1": {
"Person_1": {
"Mood": "Happy",
"ActionData": {
"Action_1": {
"ActionBehavior": "Clap",
},
"Action_2": {
"ActionBehavior": "Sing",
}
}
},
"Person_2": {
"Mood": "Sad",
"ActionData": {
"Action_1": {
"ActionBehavior": "Clap",
}
}
}
}
}
What would be the most efficient/effective way of going about building a chatbot that will always output a valid json of this structure?
My initial thought was to use a command-line interface because it made the most sense, or some type of coarse-grained configuration. But I wanted to know if there's a way to push the boundary to make a llm output something extremely configurable like this through Natural Languge in a consistent manner. Is this within the limits of what langchain + Llama can do at the moment?