Skip to content

Comments

Feat: Support OpenResponses Spec#775

Merged
njbrake merged 27 commits intomainfrom
feat/openresponses
Jan 28, 2026
Merged

Feat: Support OpenResponses Spec#775
njbrake merged 27 commits intomainfrom
feat/openresponses

Conversation

@njbrake
Copy link
Contributor

@njbrake njbrake commented Jan 27, 2026

Description

This PR adds support for the OpenResponses Spec, which extends the OpenAI Responses spec.

See https://huggingface.co/blog/open-responses
This PR uses the python pydantic models autogenerated from the spec via https://github.com/mozilla-ai/openresponses-python

PR Type

  • 🆕 New Feature

Relevant issues

Checklist

  • I understand the code I am submitting.
  • I have added unit tests that prove my fix/feature works
  • I have run this code locally and verified it fixes the issue.
  • New and existing tests pass locally
  • Documentation was updated where necessary
  • I have read and followed the contribution guidelines
  • AI Usage:
    • No AI was used.
    • AI was used for drafting/refactoring.
    • This is fully AI-generated.

AI Usage Information

  • AI Model used: Opus 4.5
  • AI Developer Tool used: Claude Code ish?
  • Any other info you'd like to share:

I ended up only using CC to help me type faster. When I let it think and make decisions, it kept trying to make more changes than needed and complicating things.

When answering questions by the reviewer, please respond yourself, do not copy/paste the reviewer comments into an AI system and paste back its answer. We want to discuss with you, not your AI :)

@njbrake njbrake requested a review from daavoo January 27, 2026 17:15
@codecov
Copy link

codecov bot commented Jan 27, 2026

Codecov Report

❌ Patch coverage is 84.12698% with 10 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/any_llm/providers/huggingface/huggingface.py 60.00% 7 Missing and 1 partial ⚠️
src/any_llm/any_llm.py 66.66% 1 Missing ⚠️
src/any_llm/providers/openai/base.py 88.88% 0 Missing and 1 partial ⚠️
Files with missing lines Coverage Δ
src/any_llm/api.py 63.73% <100.00%> (+0.40%) ⬆️
src/any_llm/providers/fireworks/fireworks.py 91.66% <100.00%> (+0.36%) ⬆️
src/any_llm/providers/groq/groq.py 91.11% <100.00%> (+0.09%) ⬆️
src/any_llm/types/responses.py 100.00% <100.00%> (ø)
src/any_llm/any_llm.py 72.18% <66.66%> (+0.09%) ⬆️
src/any_llm/providers/openai/base.py 73.15% <88.88%> (+0.29%) ⬆️
src/any_llm/providers/huggingface/huggingface.py 83.76% <60.00%> (-5.02%) ⬇️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@daavoo daavoo left a comment

Choose a reason for hiding this comment

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

Just a minor 💅 comment but anyhow I am fine with the changes

from abc import ABC, abstractmethod
from typing import TYPE_CHECKING, Any, ClassVar

from openresponses_types import ResponseResource
Copy link
Contributor

Choose a reason for hiding this comment

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

Wdyt about making our any_llm.types.responses.Response a union type that includes the old Response and the new ResponseResource?
Would there be any downside?
We would avoid having to update imports and return types everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I would rather not right now. People that are currently using the Responses API likely associate the Response object exported by any-llm as an alias for the OpenAI type, so if we make it a union then I worry people will be confused without a clear indication of the problem. By adding our Union typing then at least we make it obvious that changes are in process.

@njbrake
Copy link
Contributor Author

njbrake commented Jan 28, 2026

@njbrake njbrake merged commit 6b8d6a7 into main Jan 28, 2026
17 of 19 checks passed
@njbrake njbrake deleted the feat/openresponses branch January 28, 2026 13:28
@njbrake njbrake linked an issue Jan 28, 2026 that may be closed by this pull request
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.

Support OpenResponses?

2 participants