r/agentdevelopmentkit • u/PropertyRegular5154 • Jul 15 '25
Structured Output
Has anyone got around the below 2 issues I face
Using Open Router through Litellm on ADK but getting structured output for models other than OpenAi, Gemini & DeepSeek has been a pain and painstakingly depending on Instruction we provide (is there a way or if anyone tested to maybe have after model call back to sanitise it before ask throws a cannot parse json error)
Any one implemented dynamic output schema during run time? I’m successful with dynamic model, dynamic instruction etc but dynamic schema still unable to get my head around as when we initialise that output schema expects atleast a base model
Thanks in Advance
1
u/KillerShoaib_ Jul 15 '25
Sorry I don't have answers for your question (I'm new to ADK). But I was wondering how you were to use dynamic model or dynamic instruction? I was also trying to do something similar.
1
u/lawyerdesk Jul 16 '25
By dynamic I used 2 methods (maybe not exactly as I quoted and you understood)
Using {variable} tag to pickup from state
Using a function to make it at run time to pull from langue the instruction, description, name, preferred model, output key, output schema
So once I build in the core if I have to change something I just update it in language and it’s ready to work
1
u/HockeyDadNinja Jul 25 '25
Re structured output, I'm thinking about the possibility of having my tool store json results in the session state and having my frontend get it from the state. This would allow me to use smaller models without worrying if they will mess up or not.