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

system_fingerprint type definition is missing in ChatCompletionChunk

Open Code-Hex opened this issue 2 years ago • 2 comments

Confirm this is a Node library issue and not an underlying OpenAI API issue

  • [X] This is an issue with the Node library

Describe the bug

This is an example from the api-reference to the streaming response:

{"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0613", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null}]}

{"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0613", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"content":"Hello"},"finish_reason":null}]}

{"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0613", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"content":"!"},"finish_reason":null}]}

....

{"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0613", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"content":" today"},"finish_reason":null}]}

{"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0613", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"content":"?"},"finish_reason":null}]}

{"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0613", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}

Actually, we can get system_fingerprint field from the response but openai api-reference and type definition are missing this field.

To Reproduce

Writing code to ChatCompletionChunk type

Code snippets

No response

OS

macOS

Node version

v18.18.0

Library version

4.16.1

Code-Hex avatar Nov 07 '23 02:11 Code-Hex

Thanks! This will be addressed via https://github.com/openai/openai-openapi/pull/109

rattrayalex avatar Nov 07 '23 07:11 rattrayalex

happy day everyone, where can I learn more about this unique identifier for "system_fingerprint" in relation to "seed" with the goal to make an app with deterministic responses based in a customized knowledge base? Thanks.

tonymynd avatar Mar 08 '24 18:03 tonymynd