Commit Graph

10 Commits

Author SHA1 Message Date
Harrison Chase
3efee27e56 cr 2023-01-03 14:12:43 -08:00
Ankush Gola
db5c8e0c42
explicitly set global verbosity flag in unit tests that test callbacks (#502)
If another file anywhere in `unit_tests` sets `langchain.verbose =
True`, it messes up all of the tests that check for no callbacks because
the `None` for verbose gets overridden by the global verbosity flag. By
explicitly setting it in unit tests, we bypass that potential issue
2023-01-02 14:06:46 -08:00
Harrison Chase
52490e2dcd
add explicit agent end method (#486) 2022-12-29 22:23:15 -05:00
Harrison Chase
7e36f28e78
Harrison/not verbose (#487) 2022-12-29 22:23:02 -05:00
Harrison Chase
5d43246694
WIP: stdout callback (#479)
first pass at stdout callback

for the most part, went pretty smoothly. aside from the code here, here
are some comments/observations.

1. 
should somehow default to stdouthandler so i dont have to do 
```
from langchain.callbacks import get_callback_manager
from langchain.callbacks.stdout import StdOutCallbackHandler

get_callback_manager().add_handler(StdOutCallbackHandler())
```

2. I kept around the verbosity flag. 1) this is pretty important for
getting the stdout to look good for agents (and other things). 2) I
actually added this for LLM class since it didn't have it.

3. The only part that isn't basically perfectly moved over is the end of
the agent run. Here's a screenshot of the new stdout tracing
![Screen Shot 2022-12-29 at 4 03 50
PM](https://user-images.githubusercontent.com/11986836/210011538-6a74551a-2e61-437b-98d3-674212dede56.png)

Noticing it is missing logging of the final thought, eg before this is
what it looked like
![Screen Shot 2022-12-29 at 4 13 07
PM](https://user-images.githubusercontent.com/11986836/210011635-de68b3f5-e2b0-4cd3-9f1a-3afe970a8716.png)

The reason its missing is that this was previously logged as part of
agent end (lines 205 and 206)

this is probably only relevant for the std out logger? any thoughts for
how to get it back in?
2022-12-29 21:34:47 -05:00
Ankush Gola
36922318d3
allow for optional CallbackManager in LLM, Chain, and Agent (#482) 2022-12-29 17:30:31 -08:00
Harrison Chase
d0f194de73
add logic for agent stopping (#420) 2022-12-29 08:21:11 -05:00
Harrison Chase
78b31e5966
Harrison/cache (#343) 2022-12-15 07:53:32 -08:00
Harrison Chase
9bb7195085
Harrison/llm saving (#331)
Co-authored-by: Akash Samant <70665700+asamant21@users.noreply.github.com>
2022-12-13 06:46:01 -08:00
John McDonnell
68666d6a22
Gracefully degrade when model asks for nonexistent tool (#268)
Not yet tested, but very simple change, assumption is that we're cool
with just producing a generic output when tool is not found
2022-12-06 21:52:48 -08:00