Templates face an issue similar to that outlined for Tools in #699
Templates carry both input and output types, but the LLM API currently only receives the schema of the output type (which is used for structured output generation). The input arguments to a Template call are encoded and interpolated into the user message in call_user, so the LLM sees their values but does not see their types, even when the types carry useful contextual information that complements what's in the prompt template.
We should therefore consider injecting the type schemas into the message generated by call_user upon first calling a Template.
Templates face an issue similar to that outlined forTools in #699Templates carry both input and output types, but the LLM API currently only receives the schema of the output type (which is used for structured output generation). The input arguments to aTemplatecall are encoded and interpolated into the user message incall_user, so the LLM sees their values but does not see their types, even when the types carry useful contextual information that complements what's in the prompt template.We should therefore consider injecting the type schemas into the message generated by
call_userupon first calling aTemplate.