HI! I have a problem that I’m not sure if anyone has encountered before. I’m using the Responses API (gpt-5.1-mini model) and we’re seeing problems enabling websearch. We only send websearch when it’s going to be used within the tools, but when there’s context (using resp_id), for some reason it says that websearch isn’t enabled, even though the tool is present in the Tools structure.
val INTERNET = mapOf(
"type" to "web_search",
"user_location" to mapOf(
"type" to "approximate"
),
"search_context_size" to "low"
)
Your phrase here is somewhat unclear. The AI is what decides when to use an offered tool. You provide the specification of what tools are to be available in each API call. The AI gets the list of available tools in can call, placed into the first internal system message.
The only reason this could be faulty is that with a continuing conversation, the chat history might have tool_call messages and “tool” return messages that demonstrate to the current AI in the current call that it had the tool before, and by seeing that “in-context training” it might try that unavailable tool again, even without the specification.
Also, what exactly is it that “says” web_search is not enabled? An error message? The AI?
What I expect on the API:
send any list of tools or functions per API call,
the AI uses what’s available,
A past response ID has no bearing on your ability to place the tools, which you must do in every call (or use a prompt ID that has tools)
You can use this ability to make functions dependent on use of another, such as no “schedule appointment” before “list appointments” is used.
It seems like a strange pattern to turn web_search on and off. You can’t really know “when its going to be used”, you can only make the tool unavailable for use per-turn. Perhaps you can explain better, and explain how to replicate this API issue?
Of course, I always send the same list of tools in every request, but with the difference that if the user activates websearch, in that request I send the previous tools and websearch, which means that in a conversation you can have 2 messages with websearch, for example, and 5 without it, since it has an additional cost and takes time to search, I decided that it should not always be in every request, but only when the user decides.