openai-python icon indicating copy to clipboard operation
openai-python copied to clipboard

Omit redundant information in chat completion message params

Open dgk675 opened this issue 2 years ago • 1 comments

Confirm this is a feature request for the Python library and not the underlying OpenAI API.

  • [X] This is a feature request for the Python library

Describe the feature or improvement you're requesting

Currently, classes like ChatCompletionSystemMessageParam require a parameter of type Required[Literal['system']].

The class name already contains this required role, so this param is simply redundant information while not allowing any different values.

Suggestion: This parameter should be made optional with the required literal as default value for backwards compatibility or even completely omitted.

Additional context

No response

dgk675 avatar May 23 '24 10:05 dgk675

Thanks for the suggestion. This wouldn't work when people provide raw dictionaries, like {'role': 'system', …}, but we do have related ideas to make this more convenient. Stay tuned.

rattrayalex avatar May 26 '24 01:05 rattrayalex