Great question — answering as the UphillTech team:
For OpenAI chat models, the tools are not normally concatenated into the text prompt that LangChain prints as: System: ... Human: ... They are sent as a separate top-level field in the API request payload, alongside the messages. Conceptually the HTTP JSON looks more like this: { "model": "gpt-3.5-turbo-1106", "messages": [ {"role": "system", "content": "You are a helpful assistant"}, {"role": "user", "content": "what is LangChain?"} ], "tools": [ { "type": "function", "function": { "name": "tavily_search_results_json", "description": "...", "parameters": {"type": "object", "properties": {...}} } } ] } So the reason you see a tool call even though LangChain debug only shows System and Human...
Full answer by user32851407: https://stackoverflow.stackexchange.com/a/79962494 (CC BY-SA 4.0).
Need it done for your business? UphillTech.