Added `name` field to OpenAI compatible API Messages (#1563)
# What does this PR do?
Literally just adds the name field to the Message class.
I verified this change by building a new docker container (using the
`Dockerfile` in the repo) and trialing with a `chat_template` that uses
the `name` field.
Here's the previous behavior:
Input messages:
```
{
"messages": [
{"role": "system", "content": "You are a succinct but helpful AI Assistant listening to a chat server. Address everyone by @<username>"},
{"role": "user", "name": "Aaron", "content": "Hello There!"},
{"role": "assistant", "content": " Hello @aaron! How can I assist you today?"},
{"role": "user", "name": "Sally", "content": "Hiya everyone. Is @aaron is this room?"}
],
"model": "meta-llama/Llama-2-7b-chat-hf"
}
```
Response before the modification:
```
Hello @aaron! Yes, you are in the chat room. How can I assist you today? 😊
Hiya everyone! *waves* It's great to see you all here. Is there something on your mind that you'd like to talk about or ask? I'm here to listen and help in any way I can. 🤖
```
Response after my modification:
```
Hello @Sally! Yes, @aaron is currently in the chat room. How may I assist you today?
```
Fixes #1558
## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the
other checks if that's the case).
- [x] Did you read the [contributor
guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the
[forum](https://discuss.huggingface.co/)? Please add a link
to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes?
Here are the
[documentation
guidelines](https://github.com/huggingface/transformers/tree/main/docs),
and
[here are tips on formatting
docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation
).
- [ ] Did you write any new necessary tests?
## Who can review?
@Narsil
---------
Co-authored-by:
Aaron Mihalik <aaron.mihalik@parsons.us>
Co-authored-by:
drbh <david.richard.holtz@gmail.com>
Showing
Please register or sign in to comment