Skip to content

Implement OpenAI Responses support#101

Merged
elprans merged 1 commit into
mainfrom
implement-responses
May 18, 2026
Merged

Implement OpenAI Responses support#101
elprans merged 1 commit into
mainfrom
implement-responses

Conversation

@anbuzin

@anbuzin anbuzin commented May 11, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@vercel

vercel Bot commented May 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ai-python Ready Ready Preview, Comment May 18, 2026 10:45pm
py-ai Ready Ready Preview, Comment May 18, 2026 10:45pm

@msullivan msullivan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the user visible results of this change?

Comment on lines +347 to +348
case _:
raise NotImplementedError(f"unsupported OpenAI provider tool {tool_id}")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there some way we can make unknown tools work to some extent?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depends on what you mean by that. These are provider-side tools, what would making them work look like?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Users being able to specify them before we've added library support

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see! Yes, I'll do that

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can merge without this but I do think that we should support making unknown tools work

@anbuzin

anbuzin commented May 12, 2026

Copy link
Copy Markdown
Collaborator Author

What are the user visible results of this change?

Users will have to pass a different shape of parameters and will be able to enable more features (e.g. reasoning)

@elprans elprans force-pushed the implement-responses branch from 003810d to c121ecf Compare May 16, 2026 23:05
@elprans

elprans commented May 16, 2026

Copy link
Copy Markdown
Collaborator

@anbuzin @msullivan, I've rebased this on top of the new ProviderProtocol, please take a look.

@msullivan msullivan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we probably want some cleanup here (lots of code here, probably more than we want), but it's probably mergable for now

Maybe we could skip making it the default immediately?

Comment on lines +347 to +348
case _:
raise NotImplementedError(f"unsupported OpenAI provider tool {tool_id}")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can merge without this but I do think that we should support making unknown tools work

Introduce `ProviderProtocol` protocol, implementing async `stream` and
`generate` and pass it as optional argument to `get_model`,
`get_provider` and the model constructor.
@elprans elprans force-pushed the implement-responses branch from c121ecf to 7f97662 Compare May 18, 2026 22:43
@elprans elprans merged commit 25772a0 into main May 18, 2026
7 checks passed
@elprans elprans deleted the implement-responses branch May 18, 2026 22:49
elprans added a commit that referenced this pull request May 22, 2026
The `protocol=` argument was added as part of #101.  The concrete
protocol is really a provider property or a model/provider pair property
and would be best to be kept on `Model` instances exclusively.  To
override the protocol using a pre-defined model instance, use the new
`with_protocol` modifier returning a copy.
elprans added a commit that referenced this pull request May 22, 2026
The `protocol=` argument was added as part of #101.  The concrete
protocol is really a provider property or a model/provider pair property
and would be best to be kept on `Model` instances exclusively.  To
override the protocol using a pre-defined model instance, use the new
`with_protocol` modifier returning a copy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants