From a077b777cc68a05f003dd9ff21016b7ef81e3e8b Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Mon, 5 Jan 2026 13:05:32 -0300 Subject: [PATCH] feat: allow openai-compat to use responses api (#112) This is needed for Copilot, but can potentially be used by other providers in the future. --- providers/openaicompat/openaicompat.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/providers/openaicompat/openaicompat.go b/providers/openaicompat/openaicompat.go index 236d43153c1defbe2d2aa05a45465c2a2e6a3a14..3595a6e423ca4260c87873bd46bd950d5e33031e 100644 --- a/providers/openaicompat/openaicompat.go +++ b/providers/openaicompat/openaicompat.go @@ -107,3 +107,10 @@ func WithObjectMode(om fantasy.ObjectMode) Option { o.objectMode = om } } + +// WithUseResponsesAPI configures the provider to use the responses API for models that support it. +func WithUseResponsesAPI() Option { + return func(o *options) { + o.openaiOptions = append(o.openaiOptions, openai.WithUseResponsesAPI()) + } +}