Commit Graph

317 Commits (harrison/callback-updates)
 

Author SHA1 Message Date
Harrison Chase d3a6387ab9 cr 1 year ago
Harrison Chase 3efee27e56 cr 1 year ago
Harrison Chase 7d0b1cafd7 cr 1 year ago
Harrison Chase 6fe6af7048 cr 1 year ago
Harrison Chase 6953c2e707 cr 1 year ago
Harrison Chase 3086b752a3 Merge branch 'ankush/callbackhandler' into harrison/callback-updates 1 year ago
Harrison Chase 03e3cd468b cr 1 year ago
Harrison Chase 7eb33690a9 callback updates 1 year ago
Harrison Chase 23b8cfc123 cr 1 year ago
Nuno Campos 6d78be0c83
Add link to gihub repo in header of new docs (#524) 1 year ago
Harrison Chase 447683de6f
bump version to 0.0.55 (#521) 1 year ago
Harrison Chase 0db05b6725
Harrison/add human prefix (#520)
Co-authored-by: Andrew Huang <jhuang16888@gmail.com>
1 year ago
Harrison Chase 03f185bcd5
more robust handling for max iterations (#514)
add a `generate` method which makes one final forward pass through the
llm
1 year ago
Harrison Chase 40326c698c
unify argument name (#513)
unify names in map reduce and refine chains to just be
return_intermediate_steps

also unify the return key
1 year ago
lewtun 12108104c9
Add links to Hugging Face Hub docs (#518)
This PR adds some tweaks to the Hugging Face docs, mostly with links to
the Hub + relevant docs.
1 year ago
Harrison Chase 3efec55f93
update lobby link (#517) 1 year ago
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
1 year ago
Harrison Chase 8f6c08863a
bump version to 0.0.54 (#512) 1 year ago
Hunter Gerlach 7253fada0d
Fix/broken getting started link (#511)
I noticed (after publication) that the getting_started link on the main
page was borked. This should fix it.

Co-authored-by: Hunter Gerlach <hunter@huntergerlach.com>
1 year ago
Harrison Chase 985496f4be
Docs refactor (#480)
Big docs refactor! Motivation is to make it easier for people to find
resources they are looking for. To accomplish this, there are now three
main sections:

- Getting Started: steps for getting started, walking through most core
functionality
- Modules: these are different modules of functionality that langchain
provides. Each part here has a "getting started", "how to", "key
concepts" and "reference" section (except in a few select cases where it
didnt easily fit).
- Use Cases: this is to separate use cases (like summarization, question
answering, evaluation, etc) from the modules, and provide a different
entry point to the code base.

There is also a full reference section, as well as extra resources
(glossary, gallery, etc)

Co-authored-by: Shreya Rajpal <ShreyaR@users.noreply.github.com>
1 year ago
Keiji Kanazawa c5f0af9398
Minor docstring update (#507)
Update `model=` to `model_name=`.

No need to credit me for this 😄
1 year ago
Ankush Gola aae3609aa8
fix ontext comment (#500) 1 year ago
Harrison Chase a3d2a2ec2a
Harrison/streamlit handler (#488)
also add a set handler method

usage is:
```
from langchain.callbacks.streamlit import StreamlitCallbackHandler
import langchain
langchain.set_handler(StreamlitCallbackHandler())
```

produces the following output


![Screen Shot 2022-12-29 at 10 50 33
PM](https://user-images.githubusercontent.com/11986836/210032762-7f53fffa-cb2f-4dac-af39-7d4cf81e55dd.png)

only works for agent stuff currently
1 year ago
Harrison Chase 45d6de177e
remove logger (#491)
remove old logging class (no longer used anyways)
1 year ago
Harrison Chase 175a248506
Harrison/get rid of prints (#490)
deprecate all prints in favor of callback_manager.on_text (open to
better naming)
1 year ago
Harrison Chase b902bddb8a
fix verbosity (#496)
1. remove verbose from someplace it didnt relaly belong
2. everywhere else, make verbose Optional[bool] with default to None
3. make base classes accept None, and then look up globabl verbosity if
thats the case
1 year ago
Harrison Chase d95b39d37f
version 0.0.53 (#497) 1 year ago
Harrison Chase 0072686aab
Harrison/new search engine (#477)
Co-authored-by: Nicolas <nicolascamara29@gmail.com>
1 year ago
Ankush Gola 164806a844
quick comment fixes (#494) 1 year ago
Harrison Chase e3edd74eab
switch up defaults (#485)
i kinda like this just because we call `self.callback_manager` so many
times, and thats nicer than `self._get_callback_manager()`?
1 year ago
Harrison Chase 52490e2dcd
add explicit agent end method (#486) 1 year ago
Harrison Chase 7e36f28e78
Harrison/not verbose (#487) 1 year ago
Harrison Chase 3e41ab7bff
check keys before using (#475) 1 year ago
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?
1 year ago
Shuchang Zhou 12aa43469f
Update prompt_management.ipynb (#484) 1 year ago
Ankush Gola 36922318d3
allow for optional CallbackManager in LLM, Chain, and Agent (#482) 1 year ago
Ankush Gola 46b31626b5
Add BaseCallbackHandler and CallbackManager (#476) 1 year ago
Harrison Chase 0f1df0dc2c
bump to version 0.0.52 (#470) 1 year ago
Parth Chadha e88e66f982
Pass verbose argument to LLMChains when using *DocumentsChain (#458)
When using chains such as Summarization chain (`load_summarize_chain`),
the verbose flag wasn't propagated to the `LLMChain`.
1 year ago
Harrison Chase d0f194de73
add logic for agent stopping (#420) 1 year ago
Harrison Chase c65efd2986
fix llm math prompt (#466)
basically, it didnt realize that the question was over after the input
and would some times hallucinate more input
1 year ago
Harrison Chase 95157d0aad
Add schema property to sql database utility class (#448) (#462)
Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>

Signed-off-by: Diwank Singh Tomer <diwank.singh@gmail.com>
Co-authored-by: Nuno Campos <nuno@boringbits.io>
Co-authored-by: Diwank Singh Tomer <diwank.singh@gmail.com>
1 year ago
Nuno Campos 451665cfdf
Add watch mode for test runner (#453) 1 year ago
Harrison Chase 2b84e5cda3
Harrison/fix memory and serp (#457)
Co-authored-by: Bruno Bornsztein <bruno.bornsztein@gmail.com>
1 year ago
Harrison Chase d98607408b
Harrison/v0050 (#452) 1 year ago
Harrison Chase 55007e71be
add output key for memory (#443)
this allows chains that return multiple values to use memory
1 year ago
Harrison Chase 5208bb8c36
make tools editable (#445)
use dataclass instead of namedtuple, which makes it editable

add example in notebook
1 year ago
Harrison Chase 5cc6bf1a9c
fix regex parser (#446) 1 year ago
Harrison Chase 90e8ccc898
Harrison/update links (#450)
Co-authored-by: Sam Ching <samuelcwl@gmail.com>
Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
1 year ago
Ikko Ashimine f3c3288761
chore: fix typo in prompt.py (#447)
seperator -> separator
1 year ago