Calling custom Function during reasoning process

I see that in openai Web app, while model is reasoning, it uses tools like websearch , code execution ..etc ..

Is this also available through the API, that the model ( o3 , o4-mini ) interrupt reasoning and generate a tool_call , and wait for user to provide the tool_output , and continue its reasoning after that …

is this Available in the API or not ?
thank you for your time.

1 Like

if anyone is interrested in the answer. It does not seems that making a function call during reasoning is available, couldn’t find any documentation about it.

but, if your fan of conspiracy theories continue reading.

in the new response API (according to the offical API Spec ) there are 5 types of “response.output” obj, the returned response object look like this ..

{
  "id": "resp_67ccd3a9da748190baa7f1570fe91ac604becb25c45c1d41",
  "object": "response",
  "created_at": 1741476777,
  "output": [

        // can be any of the following 5 types..
    ]

    // other field
}
  1. Output message : (An output message from the model.)
  2. File search tool call : ( The results of a file search tool call. See the file search guide for more information.)
  3. Function tool call : ( A tool call to run a function. See the function calling guide for more information.)
  4. Web search tool call ( The results of a web search tool call. See the web search guide for more information. )
  5. Computer tool call : (A tool call to a computer use tool. See the computer use guide for more information.)
  6. Reasoning : (A description of the chain of thought used by a reasoning model while generating a response.)

but when streaming is enabled, the user receive these object in junks, the api docs [https://platform.openai.com/docs/api-reference/responses-streaming/response/output_item] specify the specification of these junks for all of the above types except for the Reasoning type, under these names :

  1. response.output_text.?
  2. response.function_call_arguments.?
  3. response.file_search_call.?
  4. response.web_search_call.?

funny enough , the response.reasoning.? type is not mentioned at all in the streaming API docs for the new response API.

looking at this issue [ Responses API: invalid_request_error - 'function_call' was provided without its required 'reasoning' item ]
where the user is trying to send a message containing a pair of function_call and function_call_output, but receiving and error :
“Responses API: invalid_request_error - ‘function_call’ was provided without its required ‘reasoning’ item”

this suggest that the api currently (internally) supports associating/embedding function calls and theirs output in the reasoning process, but the API does not expose this feature to the user yet.

at the end its only a theory, but it would be great if this feature is available in the future :slight_smile: .

1 Like

I don’t know, but I don’t think its because the reasoning is sensitive ( because openai already expose the reasoning summary “detailed,consize or breive” ) . but it might be a cost issue, since each custom function_call come with increased latency (the model has to wait for client to submit the function_call_output ) , and this will make the reasoning take longer, more expensive .

maybe, but they maybe sometime it will be available.

this careware really confused me at the beginning, took me time till I found out about its meaning “shareware” :smile:

Edit :
the last part of @Bleatlock where he mentioned something with careware or bear, Has absolutly no logical meaning and does not add anything to the context of my Post. I figured that after wasting 1 hours researching his profile and previous interaction, where he Post phylosophical stuff .
I highly advise every one not to get confused as I did, and completly ignore his reply .
with all respect to his Person ( if he was human, and not a BOT )

[ just added this message with good intention , in case Bleatlock tried to confuse someone else, with a little “deep” research the other person will find something releafing from the stress and frustration, that come when people think they are completly missing the point, or not undersatnding a “meme” quite good ]

1 Like