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

Allow specifying the role used for "system" messages #90

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

elliotb
Copy link

@elliotb elliotb commented Jan 12, 2025

OpenAI's o1 series of models require that the "system" messages are passed with a role of "developer", rather than "system".

While the developer can pass their initial set of messages with the correct role, the messages generated by Instructor for things such as validation retries were always sent with a "system" role, and rejected by the API.

This PR introduces an additional option to the chat_completion function, allowing overriding the role used for these messages, specified as :instructor_role that defaults to "system".

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.

1 participant