mirror of
https://github.com/hwchase17/langchain.git
synced 2025-10-07 21:30:03 +00:00
docs: agents & callbacks fixes (#10066)
Various improvements to the Agents & Callbacks sections of the documentation including formatting, spelling, and grammar fixes to improve readability.
This commit is contained in:
@@ -72,7 +72,7 @@ class BaseCallbackHandler:
|
||||
|
||||
LangChain provides a few built-in handlers that you can use to get started. These are available in the `langchain/callbacks` module. The most basic handler is the `StdOutCallbackHandler`, which simply logs all events to `stdout`.
|
||||
|
||||
**Note** when the `verbose` flag on the object is set to true, the `StdOutCallbackHandler` will be invoked even without being explicitly passed in.
|
||||
**Note**: when the `verbose` flag on the object is set to true, the `StdOutCallbackHandler` will be invoked even without being explicitly passed in.
|
||||
|
||||
```python
|
||||
from langchain.callbacks import StdOutCallbackHandler
|
||||
@@ -137,6 +137,6 @@ The `verbose` argument is available on most objects throughout the API (Chains,
|
||||
|
||||
### When do you want to use each of these?
|
||||
|
||||
- Constructor callbacks are most useful for use cases such as logging, monitoring, etc., which are _not specific to a single request_, but rather to the entire chain. For example, if you want to log all the requests made to an LLMChain, you would pass a handler to the constructor.
|
||||
- Constructor callbacks are most useful for use cases such as logging, monitoring, etc., which are _not specific to a single request_, but rather to the entire chain. For example, if you want to log all the requests made to an `LLMChain`, you would pass a handler to the constructor.
|
||||
- Request callbacks are most useful for use cases such as streaming, where you want to stream the output of a single request to a specific websocket connection, or other similar use cases. For example, if you want to stream the output of a single request to a websocket, you would pass a handler to the `call()` method
|
||||
|
||||
|
Reference in New Issue
Block a user