valentinegb / openai

An unofficial Rust library for the OpenAI API.
https://crates.io/crates/openai/
MIT License
61 stars 18 forks source link

ChatCompletionMessage.name -> ChatCompletionMessage.user_name refactor #34

Closed gubatron closed 1 year ago

gubatron commented 1 year ago

name is kind of ambiguous, might as well make the property name self-explanatory. Thanks for including the comment in the struct.

Cheers

gubatron commented 1 year ago

hmm, now I'm wondering if you named it this way because that's how it might be coming from in JSON from openai... in any case it should be mappable.

gubatron commented 1 year ago

yup, works now.

If the goal is to map fields identically to the openai api then I can understand if you don't accept this patch.

valentinegb commented 1 year ago

The comment is a documentation comment, so in most IDEs when you hover over the field it'll show that description. I don't think renaming it is really necessary. (Also, yeah, the API returns a name field, that would be renamed with the #[serde(rename = "user_name")] macro.)