Harrison Chase
6b60c509ac
(WIP) add HyDE ( #393 )
...
Co-authored-by: cameronccohen <cameron.c.cohen@gmail.com>
Co-authored-by: Cameron Cohen <cameron.cohen@quantco.com>
2 years ago
Keiji Kanazawa
543db9c2df
Add Azure OpenAI LLM ( #395 )
...
Hi! This PR adds support for the Azure OpenAI service to LangChain.
I've tried to follow the contributing guidelines.
Co-authored-by: Keiji Kanazawa <{ID}+{username}@users.noreply.github.com>
2 years ago
Harrison Chase
c104d507bf
Harrison/improve data augmented generation docs ( #390 )
...
Co-authored-by: cameronccohen <cameron.c.cohen@gmail.com>
Co-authored-by: Cameron Cohen <cameron.cohen@quantco.com>
2 years ago
Harrison Chase
6be5747466
RFC: add cache override to LLM class ( #379 )
2 years ago
Harrison Chase
46c428234f
MMR example selector ( #377 )
...
implement max marginal relevance example selector
2 years ago
Harrison Chase
ffed5e0056
Harrison/jinja formatter ( #385 )
...
Co-authored-by: Benjamin <BenderV@users.noreply.github.com>
2 years ago
mrbean
fc66a32c6f
fix docstring ( #383 )
...
![Screenshot 2022-12-19 at 11 06 48
AM](https://user-images.githubusercontent.com/43734688/208468970-5cb9bafb-f535-486e-b41f-312a2f9ffffb.png )
2 years ago
Harrison Chase
cf98f219f9
Harrison/tools exp ( #372 )
2 years ago
Harrison Chase
e7b625fe03
fix text splitter ( #375 )
2 years ago
Harrison Chase
3474f39e21
Harrison/improve cache ( #368 )
...
make it so everything goes through generate, which removes the need for
two types of caches
2 years ago
Ankush Gola
8d0869c6d3
change run to use args and kwargs ( #367 )
...
Before, `run` was not able to be called with multiple arguments. This
expands the functionality.
2 years ago
Harrison Chase
a7084ad6e4
Harrison/version 0040 ( #366 )
2 years ago
mrbean
50257fce59
Support Streaming Tokens from OpenAI ( #364 )
...
https://github.com/hwchase17/langchain/issues/363
@hwchase17 how much does this make you want to cry?
2 years ago
mrbean
fe6695b9e7
Add HuggingFacePipeline LLM ( #353 )
...
https://github.com/hwchase17/langchain/issues/354
Add support for running your own HF pipeline locally. This would allow
you to get a lot more dynamic with what HF features and models you
support since you wouldn't be beholden to what is hosted in HF hub. You
could also do stuff with HF Optimum to quantize your models and stuff to
get pretty fast inference even running on a laptop.
2 years ago
Benjamin
85c1bd2cd0
add sqlalchemy generic cache ( #361 )
...
Created a generic SQLAlchemyCache class to plug any database supported
by SQAlchemy. (I am using Postgres).
I also based the class SQLiteCache class on this class SQLAlchemyCache.
As a side note, I'm questioning the need for two distinct class
LLMCache, FullLLMCache. Shouldn't we merge both ?
2 years ago
Harrison Chase
809a9f485f
Harrison/new version ( #362 )
2 years ago
Harrison Chase
750edfb440
add optional collapse prompt ( #358 )
2 years ago
Harrison Chase
2dd895d98c
add openai tokenizer ( #355 )
2 years ago
Harrison Chase
c1b50b7b13
Harrison/map reduce merge ( #344 )
...
Co-authored-by: John Nay <JohnNay@users.noreply.github.com>
2 years ago
Harrison Chase
ed143b598f
improve openai embeddings ( #351 )
...
add more formal support for explicitly specifying each model, but in a
backwards compatible way
2 years ago
Harrison Chase
78b31e5966
Harrison/cache ( #343 )
2 years ago
Harrison Chase
8cf62ce06e
Harrison/single input ( #347 )
...
allow passing of single input into chain
Co-authored-by: thepok <richterthepok@yahoo.de>
2 years ago
Harrison Chase
e26b6f9c89
fix batching ( #339 )
2 years ago
Harrison Chase
996b5a3dfb
Harrison/llm final stuff ( #332 )
2 years ago
Harrison Chase
9bb7195085
Harrison/llm saving ( #331 )
...
Co-authored-by: Akash Samant <70665700+asamant21@users.noreply.github.com>
2 years ago
Harrison Chase
595cc1ae1a
RFC: more complete return ( #313 )
...
Co-authored-by: Andrew Williamson <awilliamson10@indstate.edu>
Co-authored-by: awilliamson10 <aw.williamson10@gmail.com>
2 years ago
Harrison Chase
8861770bd0
expose get_num_tokens method ( #327 )
2 years ago
thepok
137356dbec
-1 max token description for openai ( #330 )
2 years ago
Harrison Chase
a7c8e37e77
Harrison/token counts ( #311 )
...
Co-authored-by: thepok <richterthepok@yahoo.de>
2 years ago
Shobith Alva
19a9fa16a9
Add `clear()` method for `Memory` ( #305 )
...
a simple helper to clear the buffer in `Conversation*Memory` classes
2 years ago
Harrison Chase
e02d6b2288
beta: logger ( #307 )
2 years ago
Harrison Chase
36b4c58acf
expose more stuff ( #306 )
2 years ago
Harrison Chase
7827f0a844
fix typing (int -> float) ( #308 )
2 years ago
Harrison Chase
853894dd47
add moderation chain ( #299 )
2 years ago
andersenchen
5267ebce2d
Add LLMCheckerChain ( #281 )
...
Implementation of https://github.com/jagilley/fact-checker . Works pretty
well.
<img width="993" alt="Screenshot 2022-12-07 at 4 41 47 PM"
src="https://user-images.githubusercontent.com/101075607/206302751-356a19ff-d000-4798-9aee-9c38b7f532b9.png ">
Verifying this manually:
1. "Only two kinds of egg-laying mammals are left on the planet
today—the duck-billed platypus and the echidna, or spiny anteater."
https://www.scientificamerican.com/article/extreme-monotremes/
2. "An [Echidna] egg weighs 1.5 to 2 grams (0.05 to 0.07
oz)[[19]](https://en.wikipedia.org/wiki/Echidna#cite_note-19 ) and is
about 1.4 centimetres (0.55 in) long."
https://en.wikipedia.org/wiki/Echidna#:~:text=sleep%20is%20suppressed.-,Reproduction,a%20reptile%2Dlike%20egg%20tooth .
3. "A [platypus] lays one to three (usually two) small, leathery eggs
(similar to those of reptiles), about 11 mm (7⁄16 in) in diameter and
slightly rounder than bird eggs."
https://en.wikipedia.org/wiki/Platypus#:~:text=It%20lays%20one%20to%20three,slightly%20rounder%20than%20bird%20eggs .
4. Therefore, an Echidna is the mammal that lays the biggest eggs.
cc @hwchase17
2 years ago
Samantha Whitmore
b10be842f6
ChatGPT Clone: adding ConversationBufferWindowMemory to replicate vir… ( #288 )
...
…tual env example
2 years ago
Harrison Chase
e2e501aa06
Harrison/version 0032 ( #283 )
2 years ago
Harrison Chase
e9b1c8cdfa
Harrison/base combine doc chain ( #264 )
2 years ago
Harrison Chase
834b391792
update notebooks ( #275 )
2 years ago
Harrison Chase
3c1c7ba672
update branch name in gha ( #274 )
2 years ago
Akash Samant
48b093823e
Add a Transformation Chain ( #257 )
...
Arbitrary transformation chains that can be used to add dictionary
extractions from llms/other chains
2 years ago
coyotespike
b7bef36ee1
BashChain ( #260 )
...
Love the project, a ton of fun!
I think the PR is pretty self-explanatory, happy to make any changes! I
am working on using it in an `LLMBashChain` and may update as that
progresses.
Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
2 years ago
Harrison Chase
28be37f470
LLMRequestsChain ( #267 )
2 years ago
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
2 years ago
Harrison Chase
2163d064f3
add return of ids ( #254 )
...
not actually sure the desired return in add_example to example selector
is actually general/good - whats the use case?
2 years ago
Harrison Chase
8cba5b791a
hotfix for api logging ( #262 )
2 years ago
Harrison Chase
5cd6956d58
Harrison/version 0028 ( #259 )
2 years ago
Harrison Chase
f5c665a544
combine python files ( #256 )
2 years ago
Harrison Chase
988cb51a7c
fix out of date docs ( #255 )
2 years ago
Harrison Chase
9481a23314
stop using chained input except in agent ( #249 )
2 years ago
Harrison Chase
ac2c2f6f28
Harrison/delete bad code ( #253 )
2 years ago
Harrison Chase
db58032973
introduce output parser ( #250 )
2 years ago
Harrison Chase
a9ce04201f
Harrison/improve usability of api chain ( #247 )
...
improve usability of api chain
2 years ago
Harrison Chase
c897bd6cbd
api chain ( #246 )
...
Co-authored-by: Subhash Ramesh <33400216+thecooltechguy@users.noreply.github.com>
2 years ago
Harrison Chase
8145c79fd8
bump version to 0.0.27 ( #244 )
2 years ago
Harrison Chase
78a29f1060
text world agent ( #240 )
2 years ago
Xupeng (Tony) Tong
bb4bf9d6d0
chore: minor clean up / formatting ( #233 )
...
to get familiarize with the project
2 years ago
Harrison Chase
473943643e
bump version 0026 ( #235 )
2 years ago
Harrison Chase
3ca2c8d6c5
allow passing of stop params into openai ( #232 )
2 years ago
Harrison Chase
347fc49d4d
Harrison/combine documents chain ( #212 )
...
combine documents chain powering vector db qa with sources chain
2 years ago
Harrison Chase
ab9abf53b7
Harrison/version 0025 ( #227 )
2 years ago
Harrison Chase
ca2394028f
move search to not be a chain ( #226 )
2 years ago
Harrison Chase
b19a73be26
pal chain touch ups ( #225 )
...
expose PAL in main entrypoint
2 years ago
Andrew Gleave
ea67c049f0
Support SQL statements that return no results ( #222 )
...
Adds support for statements such as insert, update etc which do not
return any rows.
`engine.execute` is deprecated and so execution has been updated to use
`connection.exec_driver_sql` as-per:
https://docs.sqlalchemy.org/en/14/core/connections.html#sqlalchemy.engine.Engine.execute
2 years ago
Akash Samant
d368c43648
Bug Fix ( #221 )
...
Quick bug fix for semantic similarity vector injection
2 years ago
Harrison Chase
1db7b18341
bump version to 0.0.24 ( #220 )
2 years ago
Harrison Chase
1b9b8efbc9
pal chain ( #207 )
...
from https://arxiv.org/pdf/2211.10435.pdf
2 years ago
Shyamal H Anadkat
de4b255c1f
Switch default openai model to text-davinci-003 ( #215 )
2 years ago
Harrison Chase
0568998166
Harrison/fix react stateful ( #219 )
...
fix issue with react being stateful
2 years ago
Harrison Chase
03c7140228
fix self ask template ( #216 )
2 years ago
Harrison Chase
cf3569fb1b
remove check ( #217 )
...
doesnt do much
2 years ago
Hansen Qian
a39c998342
Add chain name to verbose logging ( #214 )
...
Adds some context over what chain is running, thereby making it more
obvious how different chains are entered and existed
<img width="867" alt="Screen Shot 2022-11-28 at 11 55 34 AM"
src="https://user-images.githubusercontent.com/2548973/204336849-25d87b44-6f5d-487b-b583-5455f306a470.png ">
(note that the `...` is because the output is too long and VSCode
truncated it)
2 years ago
Harrison Chase
261029cef3
bump version to 0.0.23 ( #211 )
2 years ago
Harrison Chase
b94244eb12
nits ( #210 )
...
use json.dump
move test to integration tests (since it requires huggingface_hub)
2 years ago
Akash Samant
ae72cf84b8
Save Prompts ( #194 )
2 years ago
Bagatur
b90e25f786
Add HuggingFace Hub Embeddings ( #125 )
...
Add support for calling HuggingFace embedding models
using the HuggingFaceHub Inference API. New class mirrors
the existing HuggingFaceHub LLM implementation. Currently
only supports 'sentence-transformers' models.
Closes #86
2 years ago
Harrison Chase
287f1857ee
fix self ask w search ( #206 )
2 years ago
Harrison Chase
3eddbd11e4
bump version to 22 ( #202 )
2 years ago
Harrison Chase
05c5d0b8ee
add custom prompt notebooks ( #198 )
2 years ago
Harrison Chase
fcb9b2ffe5
Harrison/agent memory ( #197 )
...
add doc for agent with memory
2 years ago
Harrison Chase
6eab5254e5
add docs for custom agents ( #196 )
2 years ago
Harrison Chase
08deed9002
Harrison/memory docs ( #195 )
...
update memory docs and change variables
2 years ago
Harrison Chase
199794086d
bump verion to 0.0.21 ( #190 )
2 years ago
Harrison Chase
b913df3774
make attrs public ( #187 )
...
since they are used outside of the class, should be public
2 years ago
Harrison Chase
ae9c6257fe
Harrison/arbitrary params ( #186 )
2 years ago
Samantha Whitmore
a408ed3ea3
Samantha/add conversation chain ( #166 )
...
Add MemoryChain and ConversationChain as chains that take a docstore in
addition to the prompt, and use the docstore to stuff context into the
prompt. This can be used to have an ongoing conversation with a chatbot.
Probably needs a bit of refactoring for code quality
Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
2 years ago
Harrison Chase
736b6ee65c
fix search return type ( #177 )
2 years ago
Samantha Whitmore
09f301cd38
Add add_example method to all ExampleSelector classes, with tests ( #178 )
...
Also updated docs, and noticed an issue with the add_texts method on
VectorStores that I had missed before -- the metadatas arg should be
required to match the classmethod which initializes the VectorStores
(the add_example methods break otherwise in the ExampleSelectors)
2 years ago
Harrison Chase
1b81f3b125
bump version 0.0.20 ( #174 )
2 years ago
Harrison Chase
5d887970f6
change to agent ( #173 )
2 years ago
Harrison Chase
d70b5a2cbe
Harrison/version 0019 ( #172 )
2 years ago
Harrison Chase
d3a7429f61
(WIP) agents ( #171 )
2 years ago
Harrison Chase
22bd12a097
make prompt a variable in vector db qa ( #170 )
2 years ago
Harrison Chase
4a4dfbfbed
Harrison/sequential chains ( #168 )
...
add support for basic sequential chains
2 years ago
Harrison Chase
15c19fcc60
bump version to 0.0.18 ( #167 )
2 years ago
Samantha Whitmore
315b0c09c6
wip: add method for both docstore and embeddings ( #119 )
...
this will break atm but wanted to get thoughts on implementation.
1. should add() be on docstore interface?
2. should InMemoryDocstore change to take a list of documents as init?
(makes this slightly easier to implement in FAISS -- if we think it is
less clean then could expose a method to get the number of documents
currently in the dict, and perform the logic of creating the necessary
dictionary in the FAISS.add_texts method.
Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
2 years ago
Harrison Chase
243211a5ae
bump version to 0017 ( #161 )
2 years ago
Harrison Chase
a19ad935b3
Harrison/verbose prompt ( #159 )
...
Add printing of prompt to LLMChain
2 years ago
Harrison Chase
c02eb199b6
add few shot example ( #148 )
2 years ago
Harrison Chase
8869b0ab0e
bump version to 0.0.16 ( #157 )
2 years ago
Harrison Chase
b15c84e19d
Harrison/chain lab ( #156 )
2 years ago
Harrison Chase
0ac08bbca6
bump version to 0.0.15 ( #154 )
2 years ago
Nicholas Larus-Stone
0c3ae78ec1
chore: update ascii colors to work with dark mode ( #152 )
2 years ago
Nicholas Larus-Stone
ca4b10bb74
feat: add option to ignore or restrict to SQL tables ( #151 )
...
`SQLDatabase` now accepts two `init` arguments:
1. `ignore_tables` to pass in a list of tables to not search over
2. `include_tables` to restrict to a list of tables to consider
2 years ago
Harrison Chase
d2f9288be6
add metadata to documents ( #153 )
...
add concept of metadata to document
2 years ago
Harrison Chase
d775ddd749
add apply functionality ( #150 )
2 years ago
Harrison Chase
4f1bf159f4
bump version to 0.0.14 ( #145 )
2 years ago
Harrison Chase
b504cd739f
Harrison/cleanup env check ( #144 )
2 years ago
Harrison Chase
a4b502d92f
fix env var loader ( #143 )
2 years ago
Harrison Chase
1835e8a681
prompt nit ( #141 )
...
doing some cleanup, and i think this just simplifies things...
2 years ago
Harrison Chase
bbb405a492
update colors ( #140 )
2 years ago
Harrison Chase
9f223e6ccc
Harrison/fix lint ( #138 )
2 years ago
Delip Rao
76cecf8165
A fix for Jupyter environment variable issue ( #135 )
...
- fixes the Jupyter environment variable issues mentioned in issue #134
- fixes format/lint issues in some unrelated files (from make
format/lint)
![image](https://user-images.githubusercontent.com/347398/201599322-090af858-362d-4d69-bf59-208aea65419a.png )
2 years ago
Harrison Chase
ced29b816b
remove extra run from merge conflict ( #133 )
2 years ago
Harrison Chase
11d37d556e
bump version 0.0.13 ( #132 )
2 years ago
Harrison Chase
f23b3ceb49
consolidate run functions ( #126 )
...
consolidating logic for when a chain is able to run with single input
text, single output text
open to feedback on naming, logic, usefulness
2 years ago
Eugene Yurtsev
2910f50a3c
Fix a few typos and wrapped f-strings ( #128 )
...
Fix a few typos and wrapped f-strings
2 years ago
Edmar Ferreira
8a5ec894e7
Prompt from file proof of concept using plain text ( #127 )
...
This is a simple proof of concept of using external files as templates.
I'm still feeling my way around the codebase.
As a user, I want to use files as prompts, so it will be easier to
manage and test prompts.
The future direction is to use a template engine, most likely Mako.
2 years ago
Harrison Chase
d87e73ddb1
huggingface tokenizer ( #75 )
2 years ago
Eugene Yurtsev
f5a588a165
Add py.typed marker to package ( #121 )
...
- Update
- update
2 years ago
Harrison Chase
47af2bcee4
vector db qa ( #71 )
2 years ago
Harrison Chase
7467243a42
bump version 0.0.12 ( #116 )
2 years ago
Harrison Chase
e43534d41c
add integration with manifest ( #62 )
2 years ago
Harrison Chase
9f878e43d8
Harrison/lintai21 ( #114 )
2 years ago
tomeras91
d8734ce5ad
Add AI21 LLMs ( #99 )
...
Integrate AI21 /complete API into langchain, to allow access to Jurassic
models.
2 years ago
Harrison Chase
2179ea3103
remove unnecc variables ( #113 )
...
i dont think either of these variables are used?
2 years ago
Harrison Chase
da445e474d
version 0.0.11 ( #112 )
2 years ago
Samantha Whitmore
a0780cc930
OptimizedPrompt -- k-shot example choice backed by semantic search ( #91 )
2 years ago
Delip Rao
3ee6e332dd
Implements NLTK and Spacy-based TextSplitters ( #103 )
...
This PR is for Issue #88
- [x] `make format`
- [x] `make lint`
- [x] `make tests`
2 years ago
issam9
28282ad099
Issam9/cohere embeddings ( #105 )
...
Add support for cohere embeddings
2 years ago
Samantha Whitmore
386a14a19f
Change NLPCloud default model ( #100 )
2 years ago
Harrison Chase
5b7aed34a3
bump version to 0.0.10 ( #98 )
2 years ago
Harrison Chase
db37bd089f
model laboratory ( #95 )
2 years ago
Samantha Whitmore
2ddab88c06
Update VectorStore interface to contain from_texts, enforce common in… ( #97 )
...
…terface
2 years ago
Samantha Whitmore
61f12229df
Create VectorStore interface ( #92 )
2 years ago
Harrison Chase
b9f61390e9
add text2text generation ( #93 )
...
fixes issue #90
2 years ago
Samantha Whitmore
e48e562ea5
ElasticVectorSearch: Add in vector search backed by Elastic ( #67 )
...
![image](https://user-images.githubusercontent.com/6690839/200147455-33a68e20-c3c0-4045-9bff-598b38ae8fb2.png )
woo!
Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
2 years ago
Samantha Whitmore
efbc03bda8
NLPCloud client integration ( #81 )
...
lots of kwargs! generation docs here:
https://docs.nlpcloud.com/#generation
This somewhat breaks the paradigm introduced in LLM base class as the
stop sequence isn't a list, and should rightfully be introduced at the
time of initialization of the class, along with the other kwargs that
depend on its presence (e.g. remove_end_sequence, etc.) curious if you'd
want to refactor LLM base class to take out stop as a specific named
kwarg?
2 years ago
Harrison Chase
6d8a657676
bump to version 0.0.9 ( #82 )
2 years ago
Harrison Chase
6cff2837bb
Harrison/fix lint ( #80 )
2 years ago
Cameron Whitehead
54e325be2f
Improve credential handing to allow passing in constructors ( #79 )
...
Addresses the issue in #76 by either using the relevant environment
variable if set or using a string passed in the constructor.
Prefers the constructor string over the environment variable, which
seemed like the natural choice to me.
2 years ago
Harrison Chase
95d0e5f368
fix lint ( #77 )
2 years ago
issam9
990cd821cc
Issam/hf embeddings ( #68 )
...
Add support of HuggingFace embedding models
2 years ago
Harrison Chase
84e164e44b
update version to 0.0.8 ( #74 )
2 years ago
Harrison Chase
eb36317f9a
Harrison/fix imports ( #72 )
...
fix imports and add section to notebook
2 years ago
Samantha Whitmore
a5b61d59e1
Refactor prompts into module, add example generation utils ( #64 )
2 years ago
Harrison Chase
dce26dfcec
handle search errors ( #70 )
...
better error handling when serpapi raises an error (usually invalid key)
2 years ago
Harrison Chase
f772934108
improve logging ( #66 )
2 years ago
Harrison Chase
2456a547de
mrkl ( #42 )
2 years ago
Samantha Whitmore
c636488fe5
DynamicPrompt class creation ( #49 )
...
Checking that this structure looks generally ok -- going to sub in logic
where the TODO comment is then add a test.
2 years ago