zuisong / gemini-openai-proxy

OpenAI to Google Gemini https://gemini-openai-proxy.deno.dev
https://gemini-openai-proxy.zuisong.workers.dev
MIT License
317 stars 89 forks source link

Normalize `created` timestamp to seconds in response from proxy handlers #38

Closed iamjimyes closed 7 months ago

iamjimyes commented 7 months ago

This commit adjusts the created field in both NonStreamingChatProxyHandler and StreamingChatProxyHandler to use a timestamp in seconds rather than milliseconds. It applies Math.floor(Date.now()/1000) to ensure the created timestamp is consistent with OpenAI's response, enhancing compatibility, especially to response handlers in strongly typed language like rust

zuisong commented 7 months ago

thanks