langchain/docs/modules/agents
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
..
agent_executors/examples Documentation fixes (linting and broken links) (#5563) 2023-06-01 13:06:17 -07:00
agents Remove API key from docs (#5223) 2023-05-24 22:25:39 -07:00
toolkits/examples Add Multi-CSV/DF support in CSV and DataFrame Toolkits (#5009) 2023-05-25 14:23:11 -07:00
tools human approval callback (#5581) 2023-06-02 06:59:33 -07:00
agent_executors.rst big docs refactor (#1978) 2023-03-26 19:49:46 -07:00
agents.rst agent docs (#2551) 2023-04-07 10:01:23 -07:00
getting_started.ipynb Docs link custom agent page in getting started (#5250) 2023-05-25 13:11:30 -07:00
how_to_guides.rst Documentation fixes (linting and broken links) (#5563) 2023-06-01 13:06:17 -07:00
plan_and_execute.ipynb Harrison/spell executor (#4914) 2023-05-18 20:43:33 -07:00
streaming_stdout_final_only.ipynb QuickFix for FinalStreamingStdOutCallbackHandler: Ignore new lines & white spaces (#5497) 2023-06-03 15:05:58 -07:00
toolkits.rst big docs refactor (#1978) 2023-03-26 19:49:46 -07:00
tools.rst tool validation logic 2023-04-17 21:59:32 -07:00