Skip to content

Conversation

@mbleigh
Copy link
Collaborator

@mbleigh mbleigh commented Oct 29, 2024

I needed to refactor this to handle the fact that formatters serve two purposes:

  1. They need to be able to configure (overridable) default configuration for the underlying model, things like JSON mode and constrained output.
  2. They need to be able to dynamically configure themselves based on a given request for maximum flexibility.

There is now essentially a "static" and "dynamic" aspect to formatters. I'm going with contentType as a model-only signal for the requested return type...by separating it from format we can have formats that build on top of JSON while still relying on it.

I'm trying to chop this up into reasonably reviewable chunks since otherwise this project would turn into a 10K line PR. Apologies if the pacing ends up being a bit strange.

Checklist (if applicable):

  • Tested (manually, unit tested, etc.)
  • Docs updated

@mbleigh mbleigh requested a review from apascal07 October 29, 2024 03:30
@mbleigh mbleigh merged commit 325c5b7 into next Oct 30, 2024
4 checks passed
@mbleigh mbleigh deleted the mb/formats branch October 30, 2024 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants