Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev model agnostic structured output #22

Closed
wants to merge 12 commits into from

Conversation

ohdearquant
Copy link
Collaborator

@ohdearquant ohdearquant commented Nov 15, 2024

Why are these changes needed?

Related issue number

See #23 and please feel free to discuss the feature in there and the code development in here.

Checks

@ohdearquant ohdearquant marked this pull request as draft November 15, 2024 15:23
@Hk669
Copy link
Collaborator

Hk669 commented Nov 15, 2024

Hey @ohdearquant you can check on the new issue #23, feel free to propose new changes. Thanks

cc @marklysze

@Hk669 Hk669 requested a review from davorrunje November 28, 2024 14:00
@qingyun-wu
Copy link
Collaborator

@ohdearquant let's work out a plan here. I would encourage to start from smaller PRs. Thank you!

@ohdearquant
Copy link
Collaborator Author

ohdearquant commented Dec 3, 2024

ok, @qingyun-wu I can make smaller PRs in future. Above requires a lot of architecture changes, maybe not the right move.

@ohdearquant
Copy link
Collaborator Author

@qingyun-wu @marklysze @davorrunje thoughts on making message into objects?

Why Object-Based Messages?

  1. Enables more flexible operations on messages
  2. Improves configuration and parameter management
  3. Creates synergy with structured output patterns

Implementation Strategy

We could pursue a hybrid approach that balances structure and flexibility. For example, for structured output content formatting (per @marklysze's recent point), adding a custom format() to the Pydantic model is low overhead, @sternakt.

However, requiring specialized handling for every structured output can burden users. Not every output needs custom formatting, but conversation context benefits from flexible structure.

One potential solution: maintain the Pydantic structure while adding optional uniform formatting capabilities alongside the format() function.

@ohdearquant ohdearquant closed this Dec 9, 2024
davorrunje pushed a commit that referenced this pull request Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants