Skip to content

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

Open
elliotb wants to merge 2 commits into
thmsmlr:mainfrom
elliotb:instructor_role
Open

Allow specifying the role used for "system" messages#90
elliotb wants to merge 2 commits into
thmsmlr:mainfrom
elliotb:instructor_role

Conversation

@elliotb

@elliotb elliotb commented Jan 12, 2025

Copy link
Copy Markdown

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".

@gordalina

Copy link
Copy Markdown

@elliotb you need to drop the instructor_role in all the adapters: gordalina@58b0194

@elliotb

elliotb commented Feb 21, 2025

Copy link
Copy Markdown
Author

@elliotb you need to drop the instructor_role in all the adapters: gordalina@58b0194

Thanks, I've updated the adapters that follow this pattern.

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.

2 participants