Use Type ChatCompletionRole for ChatCompletionMessage.role by chasleslr · Pull Request #1295 · openai/openai-python

  • I understand that this repository is auto-generated and my pull request may not be merged

Changes being requested

It appears that the role attribute of ChatCompletionMessage is incorrectly using the type Literal["assistant"] instead of ChatCompletionRole. Messages sent to, and received from, the Chat Completions API can indeed accept all values defined in ChatCompletionRole, and not just "assistant".

Additional context & links

Chat Completions API documentation showing an example with messages of various roles (i.e. assistant, user, system).