Commit Graph

24 Commits

Author SHA1 Message Date
leo-gan fd69cc7e42 Removed duplicate BaseModel dependencies (#2471)
Removed duplicate BaseModel dependencies in class inheritances.
Also, sorted imports by `isort`.
2023-04-06 12:45:16 -07:00
Harrison Chase 0e21463f07 (rfc) chat models (#1424)
Co-authored-by: Ankush Gola <ankush.gola@gmail.com>
2023-03-06 08:34:24 -08:00
Ankush Gola fe30be6fba add async and streaming support to OpenAIChat (#1378)
title says it all
2023-03-01 21:55:43 -08:00
Ankush Gola caa8e4742e Enable streaming for OpenAI LLM (#986)
* Support a callback `on_llm_new_token` that users can implement when
`OpenAI.streaming` is set to `True`
2023-02-14 15:06:14 -08:00
Ankush Gola bc7e56e8df Add asyncio support for LLM (OpenAI), Chain (LLMChain, LLMMathChain), and Agent (#841)
Supporting asyncio in langchain primitives allows for users to run them
concurrently and creates more seamless integration with
asyncio-supported frameworks (FastAPI, etc.)

Summary of changes:

**LLM**
* Add `agenerate` and `_agenerate`
* Implement in OpenAI by leveraging `client.Completions.acreate`

**Chain**
* Add `arun`, `acall`, `_acall`
* Implement them in `LLMChain` and `LLMMathChain` for now

**Agent**
* Refactor and leverage async chain and llm methods
* Add ability for `Tools` to contain async coroutine
* Implement async SerpaPI `arun`

Create demo notebook.

Open questions:
* Should all the async stuff go in separate classes? I've seen both
patterns (keeping the same class and having async and sync methods vs.
having class separation)
2023-02-07 21:21:57 -08:00
Bagatur 7658263bfb Check type of LLM.generate prompts arg (#886)
Was passing prompt in directly as string and getting nonsense outputs.
Had to inspect source code to realize that first arg should be a list.
Could be nice if there was an explicit error or warning, seems like this
could be a common mistake.
2023-02-04 22:49:17 -08:00
Harrison Chase 5f73d06502 Harrison/fix caching bug (#788)
Co-authored-by: thepok <richterthepok@yahoo.de>
2023-01-28 14:24:30 -08:00
Ankush Gola 57609845df add tracing support to langchain (#741)
* add implementations of `BaseCallbackHandler` to support tracing:
`SharedTracer` which is thread-safe and `Tracer` which is not and is
meant to be used locally.
* Tracers persist runs to locally running `langchain-server`

Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
2023-01-26 17:38:13 -08:00
Harrison Chase 0ffeabd14f Harrison/serialize llm chain (#671) 2023-01-24 21:36:19 -08:00
Harrison Chase cbc146720b verbose flag (#683) 2023-01-22 12:44:14 -08:00
Harrison Chase 9833fcfe32 fix caching (#555) 2023-01-06 07:30:10 -08:00
Harrison Chase 5aefc2b7ce add handling on error (#541) 2023-01-04 20:23:55 -08:00
Harrison Chase 1631981f84 Harrison/fix and test caching (#538) 2023-01-04 18:39:06 -08:00
Harrison Chase 9e04c34e20 Add BaseCallbackHandler and CallbackManager (#478)
Co-authored-by: Ankush Gola <9536492+agola11@users.noreply.github.com>
2023-01-04 07:54:25 -08:00
Harrison Chase 6be5747466 RFC: add cache override to LLM class (#379) 2022-12-19 17:36:14 -05:00
Harrison Chase 3474f39e21 Harrison/improve cache (#368)
make it so everything goes through generate, which removes the need for
two types of caches
2022-12-18 16:22:42 -05:00
Harrison Chase 2dd895d98c add openai tokenizer (#355) 2022-12-15 22:35:42 -08: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
Harrison Chase 595cc1ae1a RFC: more complete return (#313)
Co-authored-by: Andrew Williamson <awilliamson10@indstate.edu>
Co-authored-by: awilliamson10 <aw.williamson10@gmail.com>
2022-12-13 05:50:03 -08:00
Harrison Chase 8861770bd0 expose get_num_tokens method (#327) 2022-12-13 05:22:42 -08:00
Harrison Chase 05c5d0b8ee add custom prompt notebooks (#198) 2022-11-26 06:07:02 -08:00
Harrison Chase db37bd089f model laboratory (#95) 2022-11-08 22:17:10 -08:00
Harrison Chase 18aeb72012 initial commit 2022-10-24 14:51:15 -07:00