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

add "name" property for ChatCompletionMessage

Open fussraider opened this issue 2 years ago • 1 comments

I found an undocumented possibility - for messages of the gpt-3.5 model, you can additionally specify the "name" property. This additional feature is useful for chats with multiple participants.

Found in the examples of the official library for python (Item No. 6 - Counting tokens for chat API calls): https://github.com/openai/openai-cookbook/blob/main/examples/How_to_count_tokens_with_tiktoken .ipynb

fussraider avatar Mar 04 '23 22:03 fussraider

Nice find! Thank you for the PR 🙌

Could you please add a comment in code about that field being non-documented in the official docs?

sashabaranov avatar Mar 05 '23 16:03 sashabaranov

Yes, no problem. Added 👌

fussraider avatar Mar 05 '23 22:03 fussraider