GitHub Issue: Enable Schema-Formatted Output for Tool-Using Chains
1. Problem:
Currently, the llm
CLI's --schema
option applies to the direct output of a single Language Model (LLM) call. When tools (via --tool
or --functions
) are used, the LLM engages in a multi-step chain (e.g., ReAct pattern) where intermediate outputs are tool call requests or textual reasoning. There's no direct way to specify that the final, user-visible result of such a multi-step, tool-using chain should conform to a user-defined schema. The existing --schema
option doesn't automatically apply to the culmination of this chain.
2. Alternatives Considered:
- A. New CLI Option: Introducing a distinct option (e.g.,
--final-schema
or--output-schema
) specifically for specifying the schema of the final output after a tool chain. This would keep the existing--schema
behavior for direct, single-turn schema output and make the post-chain formatting explicit. - **B. Overload Existing
--schema
(Implic