Commit Graph

11437 Commits

Author SHA1 Message Date
Bagatur
0746e55e9b doc: re-run all docs how-tos 2024-09-11 12:16:38 -07:00
Erick Friis
9f0968f9d2 docs: v0.3rc docs (#26277)
wip / don't merge
2024-09-11 11:12:39 -07:00
Eugene Yurtsev
8b7f5e1ec0 core[patch]: Remove non relevant todos (#26332)
Clean up TODO(0.3)
2024-09-11 13:38:39 -04:00
Eugene Yurtsev
b9575d586b docs: Handle existing env variables better (#26331)
Update tutorials, how-to and remaining integrations.

Using gritql

```
grit apply --language python '
`os.environ[$key] = getpass.getpass("$msg")` as $M where {
    $M <: ! within if_statement(),
    $M => `if $key not in os.environ: $M`
}' .
```
2024-09-11 13:11:57 -04:00
Eugene Yurtsev
934bc5b030 docs: update integration notebooks handling of env variables (#26330)
Using gritql

```
grit apply --language python '
`os.environ[$key] = getpass.getpass("$msg")` as $M where {
    $M <: ! within if_statement(),
    $M => `if $key not in os.environ: $M`
}' .
```
2024-09-11 13:10:27 -04:00
Eugene Yurtsev
da48c98eaf core[patch]: Add type literal to LLMResult (#26282)
Needed for LangServe serialization/deserializastion of callback events.
2024-09-11 11:46:13 -04:00
Eugene Yurtsev
844955d6e1 community[patch]: assign missed default (#26326)
Assigning missed defaults in various classes. Most clients were being
assigned during the `model_validator(mode="before")` step, so this
change should amount to a no-op in those cases.

---

This PR was autogenerated using gritql

```shell

grit apply 'class_definition(name=$C, $body, superclasses=$S) where {    
    $C <: ! "Config", // Does not work in this scope, but works after class_definition
    $body <: block($statements),
    $statements <: some bubble assignment(left=$x, right=$y, type=$t) as $A where {
        or {
            $y <: `Field($z)`,
            $x <: "model_config"
        }
    },
    // And has either Any or Optional fields without a default
    $statements <: some bubble assignment(left=$x, right=$y, type=$t) as $A where {
        $t <: or {
            r"Optional.*",
            r"Any",
            r"Union[None, .*]",
            r"Union[.*, None, .*]",
            r"Union[.*, None]",
        },
        $y <: ., // Match empty node        
        $t => `$t = None`,
    },    
}
' --language python .

```
2024-09-11 11:13:11 -04:00
Eugene Yurtsev
c417bbc313 core[patch]: Add default None to StructuredTool func (#26324)
This PR was autogenerated using gritql, tests written manually

```shell

grit apply 'class_definition(name=$C, $body, superclasses=$S) where {    
    $C <: ! "Config", // Does not work in this scope, but works after class_definition
    $body <: block($statements),
    $statements <: some bubble assignment(left=$x, right=$y, type=$t) as $A where {
        or {
            $y <: `Field($z)`,
            $x <: "model_config"
        }
    },
    // And has either Any or Optional fields without a default
    $statements <: some bubble assignment(left=$x, right=$y, type=$t) as $A where {
        $t <: or {
            r"Optional.*",
            r"Any",
            r"Union[None, .*]",
            r"Union[.*, None, .*]",
            r"Union[.*, None]",
        },
        $y <: ., // Match empty node        
        $t => `$t = None`,
    },    
}
' --language python .

```
2024-09-11 11:12:52 -04:00
Eugene Yurtsev
edcd348ce7 huggingface,box[patch]: Add missing default None (#26323)
This PR was autogenerated using gritql

```
engine marzano(0.1)
language python

class_definition(name=$C, $body, superclasses=$S) where {    
    $C <: ! "Config", // Does not work in this scope, but works after class_definition
    $body <: block($statements),
    $statements <: some bubble assignment(left=$x, right=$y, type=$t) as $A where {
        or {
            $y <: `Field($z)`,
            $x <: "model_config"
        }
    },
    // And has either Any or Optional fields without a default
    $statements <: some bubble assignment(left=$x, right=$y, type=$t) as $A where {
        $t <: or {
            r"Optional.*",
            r"Any",
            r"Union[None, .*]",
            r"Union[.*, None, .*]",
            r"Union[.*, None]",
        },
        $y <: ., // Match empty node        
        $t => `$t = None`,
    },    
}
```


```shell

grit apply 'class_definition(name=$C, $body, superclasses=$S) where {    
    $C <: ! "Config", // Does not work in this scope, but works after class_definition
    $body <: block($statements),
    $statements <: some bubble assignment(left=$x, right=$y, type=$t) as $A where {
        or {
            $y <: `Field($z)`,
            $x <: "model_config"
        }
    },
    // And has either Any or Optional fields without a default
    $statements <: some bubble assignment(left=$x, right=$y, type=$t) as $A where {
        $t <: or {
            r"Optional.*",
            r"Any",
            r"Union[None, .*]",
            r"Union[.*, None, .*]",
            r"Union[.*, None]",
        },
        $y <: ., // Match empty node        
        $t => `$t = None`,
    },    
}
' --language python .

```
2024-09-11 11:07:31 -04:00
Eugene Yurtsev
d3499cc90b langchain[patch]: Assign appropriate default for Optional/Any types (#26325)
This PR was autogenerated using gritql

```
engine marzano(0.1)
language python

class_definition(name=$C, $body, superclasses=$S) where {    
    $C <: ! "Config", // Does not work in this scope, but works after class_definition
    $body <: block($statements),
    $statements <: some bubble assignment(left=$x, right=$y, type=$t) as $A where {
        or {
            $y <: `Field($z)`,
            $x <: "model_config"
        }
    },
    // And has either Any or Optional fields without a default
    $statements <: some bubble assignment(left=$x, right=$y, type=$t) as $A where {
        $t <: or {
            r"Optional.*",
            r"Any",
            r"Union[None, .*]",
            r"Union[.*, None, .*]",
            r"Union[.*, None]",
        },
        $y <: ., // Match empty node        
        $t => `$t = None`,
    },    
}
```


```shell

grit apply 'class_definition(name=$C, $body, superclasses=$S) where {    
    $C <: ! "Config", // Does not work in this scope, but works after class_definition
    $body <: block($statements),
    $statements <: some bubble assignment(left=$x, right=$y, type=$t) as $A where {
        or {
            $y <: `Field($z)`,
            $x <: "model_config"
        }
    },
    // And has either Any or Optional fields without a default
    $statements <: some bubble assignment(left=$x, right=$y, type=$t) as $A where {
        $t <: or {
            r"Optional.*",
            r"Any",
            r"Union[None, .*]",
            r"Union[.*, None, .*]",
            r"Union[.*, None]",
        },
        $y <: ., // Match empty node        
        $t => `$t = None`,
    },    
}
' --language python .

```
2024-09-11 11:06:30 -04:00
Bagatur
2b15183980 docs: run tool, query analysis how tos (#26306) 2024-09-11 03:31:25 +00:00
Erick Friis
157d32b294 prompty: fix core dep for min testing (#26300) 2024-09-11 02:28:59 +00:00
Erick Friis
ec49d0d0b4 infra: codespell on all pr branches (#26299) 2024-09-10 19:21:53 -07:00
Erick Friis
19bce9aba1 community: model config cassandradatabasetool (#26296) 2024-09-10 19:17:22 -07:00
Bagatur
a56812f970 docs: replace gpt-3.5-turbo-0125 and -1106 with gpt-4o-mini (#26292) 2024-09-10 16:23:05 -07:00
ccurme
89c6cb6f8b mongo[patch]: release 0.2.0.dev1 (#26289) langchain-mongodb==0.2.0.dev1 2024-09-10 19:03:45 -04:00
Bagatur
aa9f247803 core[patch]: manually coerce ToolMessage args (#26283) 2024-09-10 15:57:57 -07:00
Bagatur
fce9322d2e core[patch]: use pydantic.v1 in old tracer code (#26290)
Thank you for contributing to LangChain!

- [ ] **PR title**: "package: description"
- Where "package" is whichever of langchain, community, core,
experimental, etc. is being modified. Use "docs: ..." for purely docs
changes, "templates: ..." for template changes, "infra: ..." for CI
changes.
  - Example: "community: add foobar LLM"


- [ ] **PR message**: ***Delete this entire checklist*** and replace
with
    - **Description:** a description of the change
    - **Issue:** the issue # it fixes, if applicable
    - **Dependencies:** any dependencies required for this change
- **Twitter handle:** if your PR gets announced, and you'd like a
mention, we'll gladly shout you out!


- [ ] **Add tests and docs**: 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. It lives in
`docs/docs/integrations` directory.


- [ ] **Lint and test**: Run `make format`, `make lint` and `make test`
from the root of the package(s) you've modified. See contribution
guidelines for more: https://python.langchain.com/docs/contributing/

Additional guidelines:
- Make sure optional dependencies are imported within a function.
- Please do not add dependencies to pyproject.toml files (even optional
ones) unless they are required for unit tests.
- Most PRs should not touch more than one package.
- Changes should be backwards compatible.
- If you are adding something to community, do not re-import it in
langchain.

If no one reviews your PR within a few days, please @-mention one of
baskaryan, efriis, eyurtsev, ccurme, vbarda, hwchase17.
2024-09-10 15:48:02 -07:00
ccurme
e2c8690e7f community[patch]: fix huggingface pydantic 2 init (#26286) 2024-09-10 18:15:39 -04:00
Eugene Yurtsev
287911adbc community[patch]: Add protected_namespace=() to models that use model namespace (#26284)
Add protected_namespaces=() for existing implementations that use the
pydantic
reserved model namespace.
2024-09-10 17:32:10 -04:00
ccurme
fc08f240ee huggingface[patch]: bump deps and increment version to 0.1.0.dev1 (#26263) langchain-huggingface==0.1.0.dev1 2024-09-10 16:49:12 -04:00
Eugene Yurtsev
bee8994b7e langchain,core: Deprecate pydantic.v1 shims (#26280)
Deprecate shim namespace
2024-09-10 16:19:20 -04:00
Bagatur
c62772885a docs: migrate pydantic imports (#26266) 2024-09-10 13:06:58 -07:00
Eugene Yurtsev
374bb40852 community: Force opt-in for qa chains (#26278)
The underlying code is already documented as requiring appropriate RBAC
control, but adding a forced user opt-in to make sure that users
that don't read documentation are still aware of what's required
from a security perspective.

https://huntr.com/bounties/8f4ad910-7fdc-4089-8f0a-b5df5f32e7c5
2024-09-10 15:59:03 -04:00
Bagatur
c43c62b6c9 merge msater (#26275) 2024-09-10 12:57:18 -07:00
Eugene Yurtsev
bb83f1b875 community[patch]: Resolve parse_obj (#26262)
Update parse_obj
2024-09-10 15:56:34 -04:00
Eugene Yurtsev
ed412d89b4 core[patch]: Do not hard coded name for RunnableBranch (#26276)
This is no longer necessary
2024-09-10 15:49:51 -04:00
Bagatur
789f4b1c9c fmt 2024-09-10 12:48:06 -07:00
Bagatur
13ba15b2cc Merge branch 'v0.3rc' into bagatur/09-10/v0.3_merge_master 2024-09-10 12:44:49 -07:00
Bagatur
b904763115 fmt 2024-09-10 12:44:11 -07:00
Bagatur
cecdc119bf merge 2024-09-10 12:32:47 -07:00
Eugene Yurtsev
7975c1f0ca core[patch]: Propagate module name to create model (#26267)
* This allows pydantic to correctly resolve annotations necessary for
building pydantic models dynamically.
* Makes a small fix for RunnableWithMessageHistory which was fetching
the OutputType from the RunnableLambda that was yielding another
RunnableLambda. This doesn't propagate the output of the RunnableAssign
fully (i.e., with concrete type information etc.)

Resolves issue: https://github.com/langchain-ai/langchain/issues/26250
2024-09-10 15:22:56 -04:00
ccurme
622cb7d2cf huggingface[patch]: update integration tests on v0.3rc branch (#26274)
cherry-pick these from master branch
2024-09-10 15:06:48 -04:00
ccurme
979232257b huggingface[patch]: add integration tests for embeddings (#26272) 2024-09-10 14:57:16 -04:00
ccurme
3a0c7c705c ollama[patch]: bump core dep and increment version to 0.2.0.dev1 (#26271)
Confirmed no pydantic warnings in unit or integration tests.
langchain-ollama==0.2.0.dev1
2024-09-10 14:41:53 -04:00
ccurme
4ffd27c4d0 huggingface[patch]: add integration tests (#26269)
Add standard tests for ChatHuggingFace. About half of these fail
currently.
2024-09-10 18:31:51 +00:00
Bagatur
162d3ff54b docs: fix language_models docstring (#26268) 2024-09-10 10:41:28 -07:00
Bagatur
301be2d40a core[patch]: de-beta astream_events (#26248) 2024-09-10 10:09:29 -07:00
ccurme
6df9178056 groq[patch]: bump deps (#26261)
To confirm no pydantic warnings.
2024-09-10 10:42:56 -04:00
ccurme
6208773c77 community[patch]: set protected namespaces on embeddings (#26156)
Also fix serdes test for langchain-google-genai.
2024-09-10 09:28:41 -04:00
Bagatur
e24259fee7 docs: update pydantic api ref templates (#26246) 2024-09-09 18:14:12 -07:00
Emad Rad
16d41eab1e docs: typos fixed (#26234)
While going through the chatbot tutorial, I noticed a couple of typos
and grammatical issues. Also, the pip install command for
langchain_community was commented out, but the document mentions
installing it.

---------

Co-authored-by: Erick Friis <erickfriis@gmail.com>
2024-09-10 00:52:20 +00:00
Bagatur
9132516c84 core[patch]: add back ChatModel.callback_manager deprecation (#26244) 2024-09-09 17:46:48 -07:00
venkatram-dev
fa229d6c02 docs: fix_typo_llm_chain_tutorial (#26229)
Thank you for contributing to LangChain!

- [ ] **PR title**: "package: description"
docs:tutorials:llm_chain:fix typo



- [ ] **PR message**: 
fix typo in llm chain tutorial

- [ ] **Add tests and docs**: 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. It lives in
`docs/docs/integrations` directory.


- [ ] **Lint and test**: Run `make format`, `make lint` and `make test`
from the root of the package(s) you've modified. See contribution
guidelines for more: https://python.langchain.com/docs/contributing/

Additional guidelines:
- Make sure optional dependencies are imported within a function.
- Please do not add dependencies to pyproject.toml files (even optional
ones) unless they are required for unit tests.
- Most PRs should not touch more than one package.
- Changes should be backwards compatible.
- If you are adding something to community, do not re-import it in
langchain.

If no one reviews your PR within a few days, please @-mention one of
baskaryan, efriis, eyurtsev, ccurme, vbarda, hwchase17.

Co-authored-by: Erick Friis <erick@langchain.dev>
2024-09-10 00:39:29 +00:00
Christophe Bornet
9cf7ae0a52 community: Add docstring for HtmlLinkExtractor (#26213)
Co-authored-by: Erick Friis <erick@langchain.dev>
2024-09-10 00:27:37 +00:00
Christophe Bornet
56580b5fff community: Add docstring for GLiNERLinkExtractor (#26218)
Co-authored-by: Erick Friis <erick@langchain.dev>
2024-09-10 00:27:23 +00:00
Bagatur
f2f9187919 community[patch]: fix community warnings 1 (#26239) 2024-09-09 17:27:00 -07:00
Christophe Bornet
e235a572a0 community: Add docstring for KeybertLinkExtractor (#26210)
Co-authored-by: Erick Friis <erick@langchain.dev>
2024-09-10 00:26:29 +00:00
Bagatur
438301db90 community[patch]: update docstrings (#26243) 2024-09-09 17:16:56 -07:00
Bagatur
7842e2c460 langchain[patch]: docstring update (#26242) 2024-09-09 17:12:32 -07:00