langchain icon indicating copy to clipboard operation
langchain copied to clipboard

Support for OpenAI Responses API

Open xantrac opened this issue 10 months ago • 4 comments

https://platform.openai.com/docs/api-reference/responses

xantrac avatar Apr 07 '25 12:04 xantrac

@brainlid I'm working on a PR to support this for my own uses, but before going too-too far, would this be welcome from your end?

LannyBose avatar Jun 03 '25 22:06 LannyBose

Hi @LannyBose! Yes! I'd welcome the help and focus there. Thanks. 💯

brainlid avatar Jun 05 '25 20:06 brainlid

@brainlid See #318

LannyBose avatar Jun 07 '25 05:06 LannyBose

oh damn, i didnt notice anyone else was working on this. my idea for it can be found here https://github.com/brainlid/langchain/pull/336

fbettag avatar Jul 13 '25 08:07 fbettag

I'm trying to use tool calling with an OpenAI compatible API with gpt-oss-120B (namely scaleway generative API)

The current implementation fails with the following API error

Received error from API: "No call message found for call_830a6dbe8c1d4ca5b39a04caf053aa3d None"

After much time tinkering, the fix was to change the ToolCall support for_api/2 by statically adding the status as nil in the response

  # ToolCall support
  def for_api(%ChatOpenAIResponses{} = _model, %ToolCall{type: :function} = fun) do
    %{
      "arguments" => Jason.encode!(fun.arguments),
      "call_id" => fun.call_id,
      "name" => fun.name,
      "type" => "function_call",
      "status" => nil
    }
end

Given I'm not using the official OpenAI APIs I'm wondering if that's an issue with Scaleway or not. Could someone tell me if the current implementation works with OpenAI APIs so I can push a fix accordingly ?

Thanks

jfayad avatar Nov 18 '25 21:11 jfayad