Commit Graph

4142 Commits

Author SHA1 Message Date
olgavrou
c9e9c0eeae add sentence transformers to extended test deps 2023-08-18 07:56:20 -04:00
olgavrou
44badd0707 add dependency requirements to test file 2023-08-18 07:19:56 -04:00
olgavrou
e276ae2616 linting and formatting 2023-08-18 07:12:39 -04:00
olgavrou
5aafb3bc46 resolving linting and formatting errors 2023-08-18 07:09:30 -04:00
Nuno Campos
d3f10d2f4f Update test 2023-08-18 11:36:16 +01:00
Nuno Campos
6ae58da668 Assign defaults in batch calls 2023-08-18 10:53:10 +01:00
olgavrou
a2f807e055 make vw dependency optional 2023-08-18 05:51:26 -04:00
olgavrou
1ae5a9c7a3 fix lock, imports, deps, test w deps, typo, formatting 2023-08-18 05:45:21 -04:00
Nuno Campos
ddcb4ff5fb Li t 2023-08-18 10:30:42 +01:00
Nuno Campos
1baedc4e18 Move patch_config 2023-08-18 10:28:39 +01:00
Nuno Campos
46f3850794 Lint 2023-08-18 10:25:41 +01:00
Nuno Campos
24a197f96a Merge branch 'master' into bagatur/locals_in_config 2023-08-18 10:12:10 +01:00
Nuno Campos
8ddaaf3d41 Move config helpers 2023-08-18 10:10:35 +01:00
Nuno Campos
a5e7dcec61 Lint 2023-08-18 10:03:28 +01:00
Nuno Campos
c1b1666ec8 Ensure config defaults apply even when a config is passed in 2023-08-18 10:02:29 +01:00
Nuno Campos
7fe474d198 Update snapshots 2023-08-18 10:02:11 +01:00
olgavrou
a6f9dccc35 rename rl_chain_base to base and update paths and imports 2023-08-18 03:42:17 -04:00
olgavrou
b422dc035f fix imports 2023-08-18 03:23:20 -04:00
Jacob Lee
0689628489
Adds streaming for runnable maps (#9283)
@nfcampos @baskaryan

---------

Co-authored-by: Nuno Campos <nuno@boringbits.io>
2023-08-18 07:46:23 +01:00
olgavrou
c37fd29fd8 move tests to correct directory and cleanup slates examples 2023-08-18 02:22:00 -04:00
olgavrou
56b40beb0e keep only what is needed for first PR 2023-08-18 02:04:35 -04:00
olgavrou
6de1ca4251 Imported changes from repo VowpalWabbit/rl_chain into rl_chain directory 2023-08-18 02:02:01 -04:00
Bagatur
ab21af71be wip 2023-08-17 17:28:02 -07:00
Bagatur
6f69b19ff5 wip tests 2023-08-17 16:45:52 -07:00
Bagatur
89bec58cbb Merge branch 'master' into bagatur/locals_in_config 2023-08-17 16:24:28 -07:00
Bagatur
9e906c39ba nit 2023-08-17 16:22:22 -07:00
Bagatur
6b0a849f59 fix 2023-08-17 16:22:12 -07:00
Bagatur
c447e9a854 cr 2023-08-17 15:29:00 -07:00
Predrag Gruevski
0dd2c21089
Do not bust poetry install cache when manually installing pydantic v2. (#9407)
Using `poetry add` to install `pydantic@2.1` was also causing poetry to
change its lockfile. This prevented dependency caching from working:
- When attempting to restore a cache, it would hash the lockfile in git
and use it as part of the cache key. Say this is a cache miss.
- Then, it would attempt to save the cache -- but the lockfile will have
changed, so the cache key would be *different* than the key in the
lookup. So the cache save would succeed, but to a key that cannot be
looked up in the next run -- meaning we never get a cache hit.

In addition to busting the cache, the lockfile update itself is also
non-trivially long, over 30s:

![image](https://github.com/langchain-ai/langchain/assets/2348618/d84d3b56-484d-45eb-818d-54126a094a40)

This PR fixes the problems by using `pip` to perform the installation,
avoiding the lockfile change.
2023-08-17 18:23:00 -04:00
Lance Martin
589927e9e1
Update figure in OSS model guide (#9399) 2023-08-17 15:09:21 -07:00
Bagatur
bd80cad6db add 2023-08-17 13:52:19 -07:00
Bagatur
8c1a528c71 cr 2023-08-17 13:52:09 -07:00
Bagatur
25cbcd9374 merge 2023-08-17 13:03:28 -07:00
Bagatur
5d60ced7b3
pydantic compatibility guide fix (#9418) 2023-08-17 12:33:20 -07:00
Aashish Saini
ce78877a87
Replaced instances of raising ValueError with raising ImportError. (#9388)
Refactored code to ensure consistent handling of ImportError. Replaced
instances of raising ValueError with raising ImportError.

The choice of raising a ValueError here is somewhat unconventional and
might lead to confusion for anyone reading the code. Typically, when
dealing with import-related errors, the recommended approach is to raise
an ImportError with a descriptive message explaining the issue. This
provides a clearer indication that the problem is related to importing
the required module.

@hwchase17 , @baskaryan , @eyurtsev 

Thanks
Aashish

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
2023-08-17 12:24:08 -07:00
Bagatur
0c4683ebcc
Revert "Update compatibility guide for pydantic (#9396)" (#9417) 2023-08-17 12:14:32 -07:00
Eugene Yurtsev
b11c233304
Update compatibility guide for pydantic (#9396)
Use langchain.pydantic_v1 instead of pydantic_v1
2023-08-17 12:09:18 -07:00
Bagatur
8c986221e4
make openapi_schema_pydantic opt (#9408) 2023-08-17 11:49:23 -07:00
Predrag Gruevski
8f2d321dd0
Cache .mypy_cache across lint runs. (#9405)
Preserve the `.mypy_cache` directory across lint runs, to avoid having
to re-parse all dependencies and their type information.

Approximately a 1min perf win for CI.

Before:

![image](https://github.com/langchain-ai/langchain/assets/2348618/6524f2a9-efc0-4588-a94c-69914b98b382)

After:

![image](https://github.com/langchain-ai/langchain/assets/2348618/dd0af954-4dc9-43d3-8544-25846616d41d)
2023-08-17 13:53:59 -04:00
Leonid Kuligin
019aa04b06
fixed a pal chain reference (#9387)
#9386

Co-authored-by: Leonid Kuligin <kuligin@google.com>
2023-08-17 13:02:49 -04:00
Eugene Yurtsev
77b359edf5
More missing type annotations (#9406)
This PR fills in more missing type annotations on pydantic models. 

It's OK if it missed some annotations, we just don't want it to get
annotations wrong at this stage.

I'll do a few more passes over the same files!
2023-08-17 12:19:50 -04:00
Predrag Gruevski
7e63270e04
Ensure the in-project venv gets cached in CI tests. (#9336)
The previous caching configuration was attempting to cache poetry venvs
created in the default shared virtualenvs directory. However, all
langchain packages use `in-project = true` for their poetry virtualenv
setup, which moves the venv inside the package itself instead. This
meant that poetry venvs were not being cached at all.

This PR ensures that the venv gets cached by adding the in-project venv
directory to the cached directories list.

It also makes sure that the cache key *only* includes the lockfile being
installed, as opposed to *all lockfiles* (unnecessary cache misses) or
just the *top-level lockfile* (cache hits when it shouldn't).
2023-08-17 11:47:22 -04:00
Bagatur
a69d1b84f4
bump 267 (#9403) 2023-08-17 08:47:13 -07:00
Predrag Gruevski
f2560188ec
Cache linting venv on CI. (#9342)
Ensure that we cache the linting virtualenv as well as the pip cache for
the `pip install -e langchain` step.

This is a win of about 60-90s overall.

Before:

![image](https://github.com/langchain-ai/langchain/assets/2348618/f55f8398-2c3a-4112-bad3-2c646d186183)

After:

![image](https://github.com/langchain-ai/langchain/assets/2348618/984a9529-2431-41b4-97e5-7f5dd7742651)
2023-08-17 11:46:58 -04:00
Nuno Campos
c0d67420e5
Use a submodule for pydantic v1 compat (#9371)
<!-- Thank you for contributing to LangChain!

Replace this entire comment with:
  - Description: a description of the change, 
  - Issue: the issue # it fixes (if applicable),
  - Dependencies: any dependencies required for this change,
- Tag maintainer: for a quicker response, tag the relevant maintainer
(see below),
- Twitter handle: we announce bigger features on Twitter. If your PR
gets announced and you'd like a mention, we'll gladly shout you out!

Please make sure your PR is passing linting and testing before
submitting. Run `make format`, `make lint` and `make test` to check this
locally.

See contribution guidelines for more information on how to write/run
tests, lint, etc:

https://github.com/hwchase17/langchain/blob/master/.github/CONTRIBUTING.md

If you're adding a new integration, please include:
1. a test for the integration, preferably unit tests that do not rely on
network access,
2. an example notebook showing its use. These live is docs/extras
directory.

If no one reviews your PR within a few days, please @-mention one of
@baskaryan, @eyurtsev, @hwchase17, @rlancemartin.
 -->
2023-08-17 16:35:49 +01:00
Sanskar Tanwar
c194828be0
Fixed Typo in Fallbacks.ipynb (#9373)
Removed extra "the" in the sentence about the chicken crossing the road
in fallbacks.ipynb. The sentence now reads correctly: "Why did the
chicken cross the road?" This resolves the grammatical error and
improves the overall quality of the content.

@baskaryan , @hinthornw , @hwchase17
2023-08-17 02:06:49 -07:00
AashutoshPathakShorthillsAI
c71afb46d1
Corrected Sentence in .ipynb File (#9372)
Fixed grammatical errors in the sentence by repositioning the word "are"
for improved clarity and readability.

 @baskaryan @hwchase17 @hinthornw
2023-08-17 02:06:43 -07:00
Bagatur
995ef8a7fc
unpin pydantic (#9356) 2023-08-17 01:55:46 -07:00
Akshay Tripathi
de8dfde7f7
Corrected Grammatical errors in tutorials.mdx (#9358)
I want to extend my heartfelt gratitude to the creator for masterfully
crafting this remarkable application. 🙌 I am truly impressed by the
meticulous attention to grammar and spelling in the documentation, which
undoubtedly contributes to a polished and seamless reader experience.

As always, your feedback holds immense value and is greatly appreciated.

@baskaryan , @hwchase17
2023-08-17 01:55:21 -07:00
Md Nazish Arman
e842131425
Fixed Grammatical errors in tutorials.mdx (#9359)
I want to convey my deep appreciation to the creator for their expert
craftsmanship in developing this exceptional application. 👏 The
remarkable dedication to upholding impeccable grammar and spelling in
the documentation significantly enhances the polished and seamless
experience for readers.

I want to stress that your feedback is invaluable to us and is genuinely
cherished.

With gratitude,
@baskaryan, @hwchase17
2023-08-17 01:55:11 -07:00