Commit Graph

11469 Commits

Author SHA1 Message Date
Erick Friis
c858c6cc09 docs: mdx v3 compat [wip] 2024-09-12 21:22:48 -07:00
Erick Friis
608c4a4327 docs: json load test (#26413) 2024-09-12 20:35:14 -07:00
Erick Friis
042ef83bbf docs: rag tutorial deps (#26174) 2024-09-13 02:08:50 +00:00
Erick Friis
409196add2 infra: small simplify (#26302) 2024-09-13 02:00:29 +00:00
Erick Friis
ed889192d4 docs: 404 page (#26338) 2024-09-12 18:51:49 -07:00
Erick Friis
89c2659f33 docs: ignore step 2 (#26410) 2024-09-12 18:33:10 -07:00
Erick Friis
df6cddafba docs: ignore step (#26409) 2024-09-12 18:32:17 -07:00
Erick Friis
e76e6046fc docs: urls for v0.3 (#26407) 2024-09-12 18:25:12 -07:00
Nuno Campos
d2a69a7b6b core: Cache serialized manifest for llms, chat models and prompts (#26404) 2024-09-12 14:57:06 -07:00
Eugene Yurtsev
85f673c7ea langchain-cli[patch]: Update to work with langchain 0.3 (#26403)
Update to work with pydantic 2 / langchain 0.3
2024-09-12 16:51:28 -04:00
Bagatur
41a632a2ae core[patch]: cherry-pick 212c688 (#26402)
Co-authored-by: Nuno Campos <nuno@langchain.dev>
2024-09-12 20:43:35 +00:00
ccurme
35aacff6c6 groq[patch]: cherry-pick 26391 into v0.3rc (#26397)
Co-authored-by: Erick Friis <erick@langchain.dev>
2024-09-12 18:24:24 +00:00
ccurme
40df0249fb pinecone: release 0.2.0.dev1 (#26386)
TODO: update `aiohttp` >= 3.10.
langchain-pinecone==0.2.0.dev1
2024-09-12 14:04:51 -04:00
Eugene Yurtsev
f298cd3446 community[patch]: Re-add pydantic usage linter (#26390)
Re-add pydantic linter.
2024-09-12 13:24:05 -04:00
Eugene Yurtsev
e19b6ad266 core[patch]: Lift restrictions on input variables due to pydantic (#26394)
This PR lifts the restrictions by pydantic by remapping the fields.

We could do a bit more work if we wanted to better catch issues if any
users are intentionally trying to create field collisions
2024-09-12 13:23:42 -04:00
Eugene Yurtsev
8defdb10d8 core[major]: Remove "Schema" suffix from tool name (#26389)
Remove the automatically appended "Schema" suffix to tool names.
2024-09-12 15:56:56 +00:00
ccurme
458d6f76ad qdrant: release 0.2.0.dev1 (#26388) langchain-qdrant==0.2.0.dev1 2024-09-12 11:38:12 -04:00
Eugene Yurtsev
bde3dbaed2 core[major]: Add restrictions on create_model field names to match pydantic constraints (#26345)
Pydantic 2 is stricter in terms of which field names are allowed in
pydantic models.

This PR results in the following breaking changes:

These will raise ValueErrors: 

```python
ChatPromptTemplate([("system", "{_private}")]).get_input_schema()
ChatPromptTemplate([("system","{model_json_schema}")]).get_input_schema()
```

This PR should properly suppress warnings for the following cases:

```python
ChatPromptTemplate([("system", "{schema}")]).get_input_schema()
ChatPromptTemplate([("system","{model_id}")]).get_input_schema()
```
2024-09-12 11:34:16 -04:00
ccurme
6b24eeb884 fireworks[patch]: fix warnings (#26385) langchain-fireworks==0.2.0.dev2 2024-09-12 14:03:24 +00:00
ccurme
d82eec6aad standard-tests[patch]: add standard test for structured output with optional param (#26384) 2024-09-12 09:39:51 -04:00
Bagatur
da037f1c55 docs: fix anthropic docstrings (#26367) 2024-09-12 02:01:07 +00:00
Bagatur
21a43ee3dc docs: update query analysis tutorial (#26363) 2024-09-11 17:13:12 -07:00
Bagatur
28594567de docs: fix structured output doc (#26360) 2024-09-11 16:56:15 -07:00
Bagatur
cacd68b2a7 docs: fix migrate agent (#26353) 2024-09-11 16:08:55 -07:00
Bagatur
1ee432e904 fix api ref reqs (#26357) 2024-09-11 15:19:59 -07:00
ccurme
0bfbd4f7bd community[patch]: release 0.3.0.dev2 (#26356) langchain-community==0.3.0.dev2 2024-09-11 17:00:21 -04:00
ccurme
7ededced7d langchain[patch]: release 0.3.0.dev2 (#26355) langchain==0.3.0.dev2 2024-09-11 16:45:55 -04:00
ccurme
284e1a7e9e core[patch]: support pydantic v1 annotations in tool arguments (#26336)
If all pydantic annotations in function signature are V1, use V1
`validate_arguments`.
langchain-core==0.3.0.dev5
2024-09-11 16:31:40 -04:00
Bagatur
d67e1dfe32 docs: fix merge messages how-to (#26351) 2024-09-11 13:29:35 -07:00
ccurme
df4fc60312 core[patch]: release 0.3.0.dev5 (#26352) 2024-09-11 16:29:25 -04:00
ccurme
c074922876 core[patch]: fix regression in convert_to_openai_tool with instances of Tool (v0.3rc) (#26349)
Cherry-pick https://github.com/langchain-ai/langchain/pull/26327 from
master.
2024-09-11 16:00:16 -04:00
Eugene Yurtsev
bbb7c267e5 docs[patch]: Improve env variable handling in documentation notebooks (#26347)
Updated using gritql

```
`os.environ[$key] = getpass($msg)` as $M where {
    $M <: ! within if_statement(),
    $M => `if $key not in os.environ: $M`
}
```
2024-09-11 19:39:39 +00:00
Bagatur
20f880ac84 infra: update api ref reqs (#26341) 2024-09-11 11:54:19 -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