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

Add missing From impl for ChatCompletionRequestMessage, replace trivial From impls with derive_more

Open grantslatton opened this issue 10 months ago • 1 comments

ChatCompletionRequestMessage didn't have From<ChatCompletionRequestDeveloperMessage>

I went to add it, and found the TODO:

// todo: write macro for bunch of same looking From trait implementations below

The crate derive_more does this by deriving From for simple wrapper-branching enums like this.

grantslatton avatar Jan 13 '25 18:01 grantslatton

Note from previous PR: https://github.com/64bit/async-openai/pull/318#pullrequestreview-2560514753

Please consider using derive_more::From for all Enums (or when it make sense) for consistency.

64bit avatar Jan 18 '25 18:01 64bit