langchain/docs
UmerHA 44ad9628c9
QuickFix for FinalStreamingStdOutCallbackHandler: Ignore new lines & white spaces (#5497)
# Make FinalStreamingStdOutCallbackHandler more robust by ignoring new
lines & white spaces

`FinalStreamingStdOutCallbackHandler` doesn't work out of the box with
`ChatOpenAI`, as it tokenized slightly differently than `OpenAI`. The
response of `OpenAI` contains the tokens `["\nFinal", " Answer", ":"]`
while `ChatOpenAI` contains `["Final", " Answer", ":"]`.

This PR make `FinalStreamingStdOutCallbackHandler` more robust by
ignoring new lines & white spaces when determining if the answer prefix
has been reached.

Fixes #5433

## Who can review?
Community members can review the PR once tests pass. Tag
maintainers/contributors who might be interested:
Tracing / Callbacks
- @agola11

Twitter: [@UmerHAdil](https://twitter.com/@UmerHAdil) | Discord:
RicChilligerDude#7589
2023-06-03 15:05:58 -07:00
..
_static docs: Big Mendable Improvements (#4964) 2023-05-19 15:31:48 -07:00
additional_resources docs: Deployments page moved into Ecosystem/ (#4949) 2023-05-21 21:18:22 -07:00
ecosystem Add Chainlit to deployment options (#5314) 2023-05-27 21:12:53 -07:00
getting_started added DeepLearing.AI course link (#5518) 2023-05-31 14:53:14 -07:00
integrations Dev2049/add argilla callback (#5621) 2023-06-02 09:05:06 -07:00
modules QuickFix for FinalStreamingStdOutCallbackHandler: Ignore new lines & white spaces (#5497) 2023-06-03 15:05:58 -07:00
reference Documentation fixes (linting and broken links) (#5563) 2023-06-01 13:06:17 -07:00
templates docs ecosystem/integrations update 3 (#5470) 2023-05-31 17:54:05 -07:00
tracing py tracer fixes (#5377) 2023-05-30 18:47:06 -07:00
use_cases minor refactor GenerativeAgentMemory (#5315) 2023-06-03 14:53:14 -07:00
conf.py
dependents.md docs: added ecosystem/dependents page (#4941) 2023-05-18 13:11:08 -07:00
index.rst docs: Deployments page moved into Ecosystem/ (#4949) 2023-05-21 21:18:22 -07:00
integrations.rst docs: ecosystem/integrations update 1 (#5219) 2023-05-29 07:25:17 -07:00
make.bat
Makefile
reference.rst docs: Deployments page moved into Ecosystem/ (#4949) 2023-05-21 21:18:22 -07:00
requirements.txt