Commit 6168c49
committed
fix(agent_tool): wrap input_schema JSON in ReAct prompt; propagate tool_choice to LiteLLM
When AgentTool uses input_schema, the inner agent receives a raw JSON blob
that causes Claude models to skip the tool-calling loop (ReAct). Fix by
wrapping the payload in a natural-language instruction.
Also propagate tool_config.function_calling_config.mode to LiteLLM's
tool_choice parameter so callers can enforce tool_choice='required'.
Addresses #773.
Fixes: #59261 parent 4006fe4 commit 6168c49
2 files changed
Lines changed: 29 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1883 | 1883 | | |
1884 | 1884 | | |
1885 | 1885 | | |
| 1886 | + | |
1886 | 1887 | | |
1887 | 1888 | | |
1888 | 1889 | | |
| |||
1891 | 1892 | | |
1892 | 1893 | | |
1893 | 1894 | | |
1894 | | - | |
1895 | | - | |
| 1895 | + | |
| 1896 | + | |
1896 | 1897 | | |
1897 | 1898 | | |
1898 | 1899 | | |
| |||
1967 | 1968 | | |
1968 | 1969 | | |
1969 | 1970 | | |
1970 | | - | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
1971 | 1986 | | |
1972 | 1987 | | |
1973 | 1988 | | |
| |||
2228 | 2243 | | |
2229 | 2244 | | |
2230 | 2245 | | |
2231 | | - | |
| 2246 | + | |
2232 | 2247 | | |
2233 | 2248 | | |
2234 | 2249 | | |
| |||
2260 | 2275 | | |
2261 | 2276 | | |
2262 | 2277 | | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
2263 | 2281 | | |
2264 | 2282 | | |
2265 | 2283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| 220 | + | |
220 | 221 | | |
221 | 222 | | |
222 | 223 | | |
223 | 224 | | |
224 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
225 | 231 | | |
226 | 232 | | |
227 | 233 | | |
| |||
0 commit comments