You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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
1 year ago
..
_static docs: Big Mendable Improvements (#4964) 1 year ago
additional_resources docs: `Deployments` page moved into `Ecosystem/` (#4949) 1 year ago
ecosystem Add Chainlit to deployment options (#5314) 1 year ago
getting_started added DeepLearing.AI course link (#5518) 1 year ago
integrations Dev2049/add argilla callback (#5621) 1 year ago
modules QuickFix for FinalStreamingStdOutCallbackHandler: Ignore new lines & white spaces (#5497) 1 year ago
reference Documentation fixes (linting and broken links) (#5563) 1 year ago
templates docs `ecosystem/integrations` update 3 (#5470) 1 year ago
tracing py tracer fixes (#5377) 1 year ago
use_cases minor refactor GenerativeAgentMemory (#5315) 1 year ago
Makefile Feature: linkcheck-action (#534) (#542) 2 years ago
conf.py docs: Mendable Search integration (#2803) 1 year ago
dependents.md docs: added `ecosystem/dependents` page (#4941) 1 year ago
index.rst docs: `Deployments` page moved into `Ecosystem/` (#4949) 1 year ago
integrations.rst docs: `ecosystem/integrations` update 1 (#5219) 1 year ago
make.bat initial commit 2 years ago
reference.rst docs: `Deployments` page moved into `Ecosystem/` (#4949) 1 year ago
requirements.txt Harrison/docs reqs (#2199) 1 year ago