Using Structured Outputs as Inputs for More Structured Outputs
Has this ever happened to you?
You have the result of a structured output call from a conversation. Lets say it’s a profile of user data provided in the convo.
Same user starts a new conversation.
If you make the same API call and write the output to the same file, you’ll be overwriting all the data collected in the first conversation. Usually with empty values since the new conversation has less to draw from.
But, if you attach all of the users conversations, you will very quickly get to the point this API call is over the token max, not to mention expensive.
And if you save the output to a separate file, you end up with an even bigger problem of trying to merge each structured output response together.
Here’s what you can do: use the structured output as an input to the structured output.
For example, here we have a simulated conversation between a fictional persona ‘Barbara Nguyen’ and a chatbot that is named Boba because that’s code for a very special place in the PRD.
Here we have a structured output based on the conversation. It creates a profile of the user. This could be entered into a CRM or just used to give the user a profile page. (Possibly displayed behind the chatbot.)
Now we start a follow up conversation:
User (Barbara, assuming Boba remembers her): Hi Boba! It’s me again—I’d like to continue our conversation about getting your chatbot integrated for my restaurant.
Boba (no prior context yet): Hello there! I’m here to help, but I’m not entirely sure who I’m speaking with. Would you mind sharing your name and a bit more about what we last discussed?
Barbara Nguyen: Oh! Of course—it’s Barbara Nguyen. We’ve been talking about using your chatbot to handle reservations and common questions at my restaurant.
Boba: Great, Barbara! How can I assist you with the integration steps today?
This follow-up conversation gives us the following structured output. As you can see, many of the values have been overwritten and replaced based on less context and less information.
Now lets run it again. But this time, we provide the API with the previous structured output and the follow-up conversation. It does not have the full conversation. But the values produced from it are still preserved.
So there you go. That’s why you feed your structured outputs to your structured outputs.




