langchain
langchain copied to clipboard
openai: read stream_options
OpenAI recently added a stream_options
parameter to its chat completions API (see release notes). When this parameter is set to {"usage": True}
, an extra "empty" message is added to the end of a stream containing token usage. Here we check for this parameter and propagate token usage to message.response_metadata.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
langchain | ⬜️ Ignored (Inspect) | Visit Preview | May 24, 2024 2:33pm |