langchain/docs/modules
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
..
agents QuickFix for FinalStreamingStdOutCallbackHandler: Ignore new lines & white spaces (#5497) 2023-06-03 15:05:58 -07:00
callbacks Dev2049/add argilla callback (#5621) 2023-06-02 09:05:06 -07:00
chains Fixed multi input prompt for MapReduceChain (#4979) 2023-06-03 14:41:03 -07:00
indexes Implements support for Personal Access Token Authentication in the ConfluenceLoader (#5385) 2023-06-03 14:57:49 -07:00
memory Documentation fixes (linting and broken links) (#5563) 2023-06-01 13:06:17 -07:00
models Bedrock llm and embeddings (#5464) 2023-05-31 07:17:01 -07:00
prompts docs: modules pages simplified (#5116) 2023-06-03 14:44:32 -07:00
utils/examples Pass parsed inputs through to tool _run (#4309) 2023-05-08 09:13:05 -07:00
agents.rst docs: modules pages simplified (#5116) 2023-06-03 14:44:32 -07:00
chains.rst docs: modules pages simplified (#5116) 2023-06-03 14:44:32 -07:00
indexes.rst docs: modules pages simplified (#5116) 2023-06-03 14:44:32 -07:00
memory.rst docs: modules pages simplified (#5116) 2023-06-03 14:44:32 -07:00
models.rst docs: modules pages simplified (#5116) 2023-06-03 14:44:32 -07:00
paul_graham_essay.txt Fix notebook example (#3142) 2023-04-19 08:55:06 -07:00
prompts.rst docs: modules pages simplified (#5116) 2023-06-03 14:44:32 -07:00
state_of_the_union.txt Docs refactor (#480) 2023-01-02 08:24:09 -08:00