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

Update ChatMessage type with 'refusal' and 'content' is now optional #46

Merged

Conversation

transitive-bullshit
Copy link
Collaborator

This change matches the updated types on OpenAI's side, which unfortunately means that ChatMessage.content is now no longer guaranteed to exist for assistant messages (if the model refused to generate the message).

Copy link
Collaborator

@rileytomasek rileytomasek left a comment

Choose a reason for hiding this comment

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

ugh, this is oh so annoying, but probably required. do you think we should have a special instance for this case and try to dynamically apply it when the structured output flag is enabled? or is this something that can actually apply to all cases now?

i guess we could also go the other way and keep this, and narrow the type when not in annoying mode :p

@transitive-bullshit
Copy link
Collaborator Author

yeah, I'm not sure the best way to handle it. imho openai-fetch should mirror the official types as closely as possible and not try to do anything too smart. that logic will come in dexter.

i've already made the switch for agentic, and it's actually not too bad; just annoying.

@rileytomasek
Copy link
Collaborator

That's fair. Let's keep this to spec and make it nicer to deal with in Dexter.

@transitive-bullshit
Copy link
Collaborator Author

@rileytomasek would you prefer this to be a minor or major bump version bump?

@rileytomasek
Copy link
Collaborator

@rileytomasek would you prefer this to be a minor or major bump version bump?

oh good catch. probably a major to be safe. it's not like were doing marketing around each major version bump 😂.

@transitive-bullshit transitive-bullshit merged commit 5f34047 into master Aug 8, 2024
8 checks passed
@transitive-bullshit transitive-bullshit deleted the feature/structured-outputs-chat-message-type branch August 8, 2024 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants