Skip to content

Add support for the developer role in chat completion messages#117

Merged
yuzisun merged 2 commits intoenvoyproxy:mainfrom
nacx:dev-role
Jan 18, 2025
Merged

Add support for the developer role in chat completion messages#117
yuzisun merged 2 commits intoenvoyproxy:mainfrom
nacx:dev-role

Conversation

@nacx
Copy link
Copy Markdown
Member

@nacx nacx commented Jan 17, 2025

With o1 models and newer, developer messages replace the previous system messages.

@nacx nacx requested a review from a team as a code owner January 17, 2025 11:58
@yuzisun
Copy link
Copy Markdown
Contributor

yuzisun commented Jan 17, 2025

thanks @nacx ! Can you help add a test?

@nacx
Copy link
Copy Markdown
Member Author

nacx commented Jan 17, 2025

What kind of additional test do you mean? I already modified the unit test that unmarshals the request to make sure it it properly handled, so I think that should be enough for the scope of the change? I mean, by adding, say, an e2e test we would be jsu testing that the backend understands that developer value, but wouldn't be testing anything specific to the ai-gateway project.

@wengyao04
Copy link
Copy Markdown
Contributor

How does it translated into Bedrock request ? In OpenAIMessageToBedrockMessage, if the role is ChatMessageRoleDeveloper, it will print error.

@mathetake
Copy link
Copy Markdown
Member

ommit / External Processor Test (pull_request)Failing after 2s

fyi this is a bug in ci setting - i am working on it

@mathetake
Copy link
Copy Markdown
Member

i think the existing unit test should be good. Now the question is how to translate this in aws bedrock request. Erring seems reasonable though

@mathetake
Copy link
Copy Markdown
Member

leaving it as a TODO with a new issue would be good as well

@mathetake
Copy link
Copy Markdown
Member

@nacx can you merge the main? I think we could merge as-is

@yuzisun yuzisun merged commit 85fc9d3 into envoyproxy:main Jan 18, 2025
@nacx nacx deleted the dev-role branch January 18, 2025 19:08
mathetake pushed a commit that referenced this pull request Jan 20, 2025
This is a follow-up PR for:
#117 (comment)

I think it makes sense to do the same conversions and set it as
"system"? The "developer" role is a replacement for "system" in OpenAI,
so it should be fine?

Signed-off-by: Ignasi Barrera <[email protected]>
aabchoo pushed a commit that referenced this pull request Jan 21, 2025
This is a follow-up PR for:
#117 (comment)

I think it makes sense to do the same conversions and set it as
"system"? The "developer" role is a replacement for "system" in OpenAI,
so it should be fine?

Signed-off-by: Ignasi Barrera <[email protected]>
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.

4 participants